summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser/templatewrapper.rb
diff options
context:
space:
mode:
authorLuke Kanies <luke@puppetlabs.com>2011-07-15 11:54:33 -0700
committerLuke Kanies <luke@puppetlabs.com>2011-07-15 11:54:33 -0700
commitd69bf48ecae71ff01679bb38cdeebc8f4a8b8b15 (patch)
tree6f6b25251f0a581c878b833a90e5b3bab0ac5d11 /lib/puppet/parser/templatewrapper.rb
parent4ad404ee7e7244d94ff4d87effc1a041d65b3f73 (diff)
parentbdc0f8716ae8ccb2b2657dfab591afe9589d8902 (diff)
downloadpuppet-d69bf48ecae71ff01679bb38cdeebc8f4a8b8b15.tar.gz
puppet-d69bf48ecae71ff01679bb38cdeebc8f4a8b8b15.tar.xz
puppet-d69bf48ecae71ff01679bb38cdeebc8f4a8b8b15.zip
Merge branch 'refactor/master/8232-array_indexers_on_scope'
Diffstat (limited to 'lib/puppet/parser/templatewrapper.rb')
-rw-r--r--lib/puppet/parser/templatewrapper.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/puppet/parser/templatewrapper.rb b/lib/puppet/parser/templatewrapper.rb
index 27d75bf92..9336e704d 100644
--- a/lib/puppet/parser/templatewrapper.rb
+++ b/lib/puppet/parser/templatewrapper.rb
@@ -25,7 +25,7 @@ class Puppet::Parser::TemplateWrapper
# Should return true if a variable is defined, false if it is not
def has_variable?(name)
- scope.lookupvar(name.to_s, :file => file, :line => script_line) != :undefined
+ scope.include?(name.to_s)
end
# Allow templates to access the defined classes
@@ -56,9 +56,8 @@ class Puppet::Parser::TemplateWrapper
# the missing_method definition here until we declare the syntax finally
# dead.
def method_missing(name, *args)
- value = scope.lookupvar(name.to_s,:file => file,:line => script_line)
- if value != :undefined
- return value
+ if scope.include?(name.to_s)
+ return scope[name.to_s, {:file => file,:line => script_line}]
else
# Just throw an error immediately, instead of searching for
# other missingmethod things or whatever.