summaryrefslogtreecommitdiff
path: root/lib/puppet
diff options
context:
space:
mode:
authorHunter Haugen <hunter@puppetlabs.com>2014-09-24 15:47:13 -0700
committerHunter Haugen <hunter@puppetlabs.com>2014-09-24 15:47:13 -0700
commit0cd08b377b58927aefa15908689a69dfb99339d5 (patch)
tree5e2703fbf5d7a89f9702e1f7b03bb805aeefc840 /lib/puppet
parentb347cc83e24e7ef51dc340bc753b96af026050f8 (diff)
parent032f93af1d9704dc218ef411e9e81befbe1c70a3 (diff)
Merge pull request #303 from bobtfish/fix_strict_variables
Fix strict_variables = true
Diffstat (limited to 'lib/puppet')
-rw-r--r--lib/puppet/parser/functions/getvar.rb5
-rw-r--r--lib/puppet/parser/functions/has_interface_with.rb7
2 files changed, 10 insertions, 2 deletions
diff --git a/lib/puppet/parser/functions/getvar.rb b/lib/puppet/parser/functions/getvar.rb
index 1621149..fb336b6 100644
--- a/lib/puppet/parser/functions/getvar.rb
+++ b/lib/puppet/parser/functions/getvar.rb
@@ -19,7 +19,10 @@ module Puppet::Parser::Functions
raise Puppet::ParseError, ("getvar(): wrong number of arguments (#{args.length}; must be 1)")
end
- self.lookupvar("#{args[0]}")
+ begin
+ self.lookupvar("#{args[0]}")
+ rescue Puppet::ParseError # Eat the exception if strict_variables = true is set
+ end
end
diff --git a/lib/puppet/parser/functions/has_interface_with.rb b/lib/puppet/parser/functions/has_interface_with.rb
index 927b0df..10ad542 100644
--- a/lib/puppet/parser/functions/has_interface_with.rb
+++ b/lib/puppet/parser/functions/has_interface_with.rb
@@ -41,7 +41,12 @@ has_interface_with("lo") => true
result = false
interfaces.each do |iface|
- if value == lookupvar("#{kind}_#{iface}")
+ factval = nil
+ begin
+ factval = lookupvar("#{kind}_#{iface}")
+ rescue Puppet::ParseError # Eat the exception if strict_variables = true is set
+ end
+ if value == factval
result = true
break
end