Merge pull request #479 from mklette/master
catch and rescue from looking up non-existent facts
This commit is contained in:
commit
b2aed66226
1 changed files with 5 additions and 2 deletions
|
@ -38,9 +38,12 @@ has_interface_with("lo") => true
|
||||||
# Bug with 3.7.1 - 3.7.3 when using future parser throws :undefined_variable
|
# Bug with 3.7.1 - 3.7.3 when using future parser throws :undefined_variable
|
||||||
# https://tickets.puppetlabs.com/browse/PUP-3597
|
# https://tickets.puppetlabs.com/browse/PUP-3597
|
||||||
factval = nil
|
factval = nil
|
||||||
|
begin
|
||||||
catch :undefined_variable do
|
catch :undefined_variable do
|
||||||
factval = lookupvar(kind)
|
factval = lookupvar(kind)
|
||||||
end
|
end
|
||||||
|
rescue Puppet::ParseError # Eat the exception if strict_variables = true is set
|
||||||
|
end
|
||||||
if factval == value
|
if factval == value
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue