summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser/templatewrapper.rb
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-10-21 19:28:21 +0200
committerLuke Kanies <luke@madstop.com>2008-10-21 19:28:21 +0200
commitb7d72360f66e36d897cfd4436236a3607a6de5b7 (patch)
treef0e7be01442451f10574e9499268c2012be81988 /lib/puppet/parser/templatewrapper.rb
parentfe789798cc0ccdc54b3a28d48bf206c9fc187085 (diff)
parent6d05cbc1e1a22d4316e18fb22d5cff9c7a42d3cf (diff)
downloadpuppet-b7d72360f66e36d897cfd4436236a3607a6de5b7.tar.gz
puppet-b7d72360f66e36d897cfd4436236a3607a6de5b7.tar.xz
puppet-b7d72360f66e36d897cfd4436236a3607a6de5b7.zip
Merge branch '0.24.x' of git://github.com/jamtur01/puppet into 0.24.x
Diffstat (limited to 'lib/puppet/parser/templatewrapper.rb')
-rw-r--r--lib/puppet/parser/templatewrapper.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/puppet/parser/templatewrapper.rb b/lib/puppet/parser/templatewrapper.rb
index fc716b0fd..00f364088 100644
--- a/lib/puppet/parser/templatewrapper.rb
+++ b/lib/puppet/parser/templatewrapper.rb
@@ -42,8 +42,13 @@ class Puppet::Parser::TemplateWrapper
return scope.catalog.classes
end
- # Allow templates to access the defined tags
+ # Allow templates to access the tags defined in the current scope
def tags
+ return scope.tags
+ end
+
+ # Allow templates to access the all the defined tags
+ def all_tags
return scope.catalog.tags
end
@@ -78,7 +83,8 @@ class Puppet::Parser::TemplateWrapper
# to the regular methods.
benchmark(:debug, "Bound template variables for #{file}") do
scope.to_hash.each { |name, value|
- instance_variable_set("@#{name}", value)
+ realname = name.gsub(/[^\w]/, "_")
+ instance_variable_set("@#{realname}", value)
}
end