Browse Source

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
changes/52/641152/1
Clark Boylan 2 months ago
parent
commit
41a3cc927d
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      manifests/init.pp

+ 1
- 1
manifests/init.pp View File

@@ -24,7 +24,7 @@ class project_config(
24 24
   $config_dir = Vcsrepo['/etc/project-config']
25 25
 
26 26
   # Note project_config_ref can be provided by facter if you want to use it.
27
-  if ($::project_config_ref != undef) {
27
+  if (defined('$::project_config_ref') and $::project_config_ref != undef) {
28 28
     $_revision = $::project_config_ref
29 29
   }
30 30
   else {

Loading…
Cancel
Save