Merge pull request #303 from bobtfish/fix_strict_variables

Fix strict_variables = true
This commit is contained in:
Hunter Haugen 2014-09-24 15:47:13 -07:00
commit 0cd08b377b
2 changed files with 10 additions and 2 deletions

View file

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

View file

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