From 032f93af1d9704dc218ef411e9e81befbe1c70a3 Mon Sep 17 00:00:00 2001 From: Tomas Doran Date: Fri, 18 Jul 2014 14:36:09 -0700 Subject: Fix strict_variables = true --- lib/puppet/parser/functions/has_interface_with.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/puppet/parser/functions/has_interface_with.rb') 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 -- cgit v1.2.3