summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Schmitt <david.schmitt@puppetlabs.com>2015-06-11 18:23:29 +0100
committerDavid Schmitt <david.schmitt@puppetlabs.com>2015-06-11 18:23:29 +0100
commit8267dbc149584afa4824dde7a3b95380556e2cea (patch)
tree378e16700ef58044f1f9e503277f5e2bd3224e31
parent0191a3fb772d3caff59ad684e02e702ae8542b1e (diff)
parent212c498df32bf14879deac77b2ae7dca927a3c39 (diff)
downloadpuppet-stdlib-8267dbc149584afa4824dde7a3b95380556e2cea.tar.gz
puppet-stdlib-8267dbc149584afa4824dde7a3b95380556e2cea.tar.bz2
Merge pull request #470 from Yelp/getvar_future_parser
Also catch :undefined_variable as thrown by future parser
-rw-r--r--lib/puppet/parser/functions/getvar.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/puppet/parser/functions/getvar.rb b/lib/puppet/parser/functions/getvar.rb
index fb336b6..ae9c869 100644
--- a/lib/puppet/parser/functions/getvar.rb
+++ b/lib/puppet/parser/functions/getvar.rb
@@ -20,7 +20,9 @@ module Puppet::Parser::Functions
end
begin
- self.lookupvar("#{args[0]}")
+ catch(:undefined_variable) do
+ self.lookupvar("#{args[0]}")
+ end
rescue Puppet::ParseError # Eat the exception if strict_variables = true is set
end