Update stdlib
[mirror/dsa-puppet.git] / 3rdparty / modules / stdlib / lib / puppet / parser / functions / has_interface_with.rb
index 3691524..f6cb74b 100644 (file)
@@ -19,8 +19,7 @@ has_interface_with("lo")                        => true
     EOS
   ) do |args|
 
-    raise(Puppet::ParseError, "has_interface_with(): Wrong number of arguments " +
-          "given (#{args.size} for 1 or 2)") if args.size < 1 or args.size > 2
+    raise(Puppet::ParseError, "has_interface_with(): Wrong number of arguments given (#{args.size} for 1 or 2)") if args.size < 1 or args.size > 2
 
     interfaces = lookupvar('interfaces')
 
@@ -38,8 +37,11 @@ has_interface_with("lo")                        => true
     # Bug with 3.7.1 - 3.7.3  when using future parser throws :undefined_variable
     # https://tickets.puppetlabs.com/browse/PUP-3597
     factval = nil
-    catch :undefined_variable do
-      factval = lookupvar(kind)
+    begin
+      catch :undefined_variable do
+        factval = lookupvar(kind)
+      end
+    rescue Puppet::ParseError # Eat the exception if strict_variables = true is set
     end
     if factval == value
       return true