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
This commit is contained in:
Clark Boylan 2019-03-05 14:50:38 -08:00
parent 3ebe44d16f
commit 41a3cc927d
1 changed files with 1 additions and 1 deletions

View File

@ -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 {