diff options
Diffstat (limited to 'lib/puppet/parser/functions/getvar.rb')
-rw-r--r-- | lib/puppet/parser/functions/getvar.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/puppet/parser/functions/getvar.rb b/lib/puppet/parser/functions/getvar.rb index ae9c869..3af8d48 100644 --- a/lib/puppet/parser/functions/getvar.rb +++ b/lib/puppet/parser/functions/getvar.rb @@ -20,9 +20,13 @@ module Puppet::Parser::Functions end begin + result = nil catch(:undefined_variable) do - self.lookupvar("#{args[0]}") + 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 |