From 25d81d27abb3de3b51ab0acea853ee4f28942df1 Mon Sep 17 00:00:00 2001 From: Chris Boot Date: Fri, 8 Jul 2016 16:20:04 +0100 Subject: [PATCH] Avoid compilation failure with strict_variables=true When strict_variables is on and mcollective has yet to be installed, mco_version isn't defined, so referring to it here breaks compilation. The fix here uses a pattern used by puppetlabs-apt. --- manifests/defaults.pp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/manifests/defaults.pp b/manifests/defaults.pp index 6c0e724..14aaac6 100644 --- a/manifests/defaults.pp +++ b/manifests/defaults.pp @@ -31,7 +31,10 @@ # https://docs.puppetlabs.com/mcollective/releasenotes.html#libdirloadpath-changes-and-core-plugins $mco_assumed_version = '2.8.5' - $_mco_version = pick_default($::mco_version, $mco_assumed_version) + $_mco_version = defined('$mco_version') ? { + true => $::mco_version, + default => $mco_assumed_version, + } if versioncmp($_mco_version, '2.8') >= 0 { $core_libdir = undef } else {