Fix strict_variables = true
This commit is contained in:
parent
b347cc83e2
commit
032f93af1d
2 changed files with 10 additions and 2 deletions
|
@ -19,7 +19,10 @@ module Puppet::Parser::Functions
|
||||||
raise Puppet::ParseError, ("getvar(): wrong number of arguments (#{args.length}; must be 1)")
|
raise Puppet::ParseError, ("getvar(): wrong number of arguments (#{args.length}; must be 1)")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
begin
|
||||||
self.lookupvar("#{args[0]}")
|
self.lookupvar("#{args[0]}")
|
||||||
|
rescue Puppet::ParseError # Eat the exception if strict_variables = true is set
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,12 @@ has_interface_with("lo") => true
|
||||||
|
|
||||||
result = false
|
result = false
|
||||||
interfaces.each do |iface|
|
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
|
result = true
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue