Update stdlib
[mirror/dsa-puppet.git] / 3rdparty / modules / stdlib / lib / puppet / parser / functions / getvar.rb
index fb336b6..3af8d48 100644 (file)
@@ -20,7 +20,13 @@ module Puppet::Parser::Functions
     end
 
     begin
-      self.lookupvar("#{args[0]}")
+      result = nil
+      catch(:undefined_variable) do
+        result = self.lookupvar("#{args[0]}")
+      end
+
+      # avoid relying on incosistent behaviour around ruby return values from catch
+      result
     rescue Puppet::ParseError # Eat the exception if strict_variables = true is set
     end