From 41a3cc927de32e099fcc3e00f7879749297f1be3 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Tue, 5 Mar 2019 14:50:38 -0800 Subject: [PATCH] Check if project_config_ref is defined before using it This checks if the $::project_config_ref fact is defined before accessing it. Puppet 4 seems to care about his more than puppet 3 so we are only just notcing this now. Note that this fix relies on puppet boolean operator 'and' short circuiting which I'm not entirely sure if it does yet. Change-Id: I2b89ac146609f9c3b22c05814b85c646f74b393a --- manifests/init.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/init.pp b/manifests/init.pp index e81c163..0323049 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -24,7 +24,7 @@ class project_config( $config_dir = Vcsrepo['/etc/project-config'] # Note project_config_ref can be provided by facter if you want to use it. - if ($::project_config_ref != undef) { + if (defined('$::project_config_ref') and $::project_config_ref != undef) { $_revision = $::project_config_ref } else {