]> gitweb.fluxo.info Git - puppet-stdlib.git/commitdiff
Fix strict_variables = true
authorTomas Doran <tdoran@yelp.com>
Fri, 18 Jul 2014 21:36:09 +0000 (14:36 -0700)
committerTomas Doran <tdoran@yelp.com>
Mon, 22 Sep 2014 21:43:27 +0000 (14:43 -0700)
lib/puppet/parser/functions/getvar.rb
lib/puppet/parser/functions/has_interface_with.rb

index 162114995b3f6645b7ec884d434d86e260f9828c..fb336b6aca070932b015d96fbb97abdea61a6607 100644 (file)
@@ -19,7 +19,10 @@ module Puppet::Parser::Functions
       raise Puppet::ParseError, ("getvar(): wrong number of arguments (#{args.length}; must be 1)")
     end
 
-    self.lookupvar("#{args[0]}")
+    begin
+      self.lookupvar("#{args[0]}")
+    rescue Puppet::ParseError # Eat the exception if strict_variables = true is set
+    end
 
   end
 
index 927b0dfebc49633615e970fb7652a50653753fd0..10ad5427ce8b19115655c771eec88f0983da9dd8 100644 (file)
@@ -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