Skip to content

Commit b2aed66

Browse files
committed
Merge pull request #479 from mklette/master
catch and rescue from looking up non-existent facts
2 parents f820bb1 + e96a818 commit b2aed66

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

lib/puppet/parser/functions/has_interface_with.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,11 @@ module Puppet::Parser::Functions
3838
# Bug with 3.7.1 - 3.7.3 when using future parser throws :undefined_variable
3939
# https://tickets.puppetlabs.com/browse/PUP-3597
4040
factval = nil
41-
catch :undefined_variable do
42-
factval = lookupvar(kind)
41+
begin
42+
catch :undefined_variable do
43+
factval = lookupvar(kind)
44+
end
45+
rescue Puppet::ParseError # Eat the exception if strict_variables = true is set
4346
end
4447
if factval == value
4548
return true

0 commit comments

Comments
 (0)