diff options
author | Luke Kanies <luke@madstop.com> | 2008-10-22 18:30:57 -0500 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2008-10-22 18:30:57 -0500 |
commit | 801b8a643d353176675023adaa25f26d0ec67403 (patch) | |
tree | 10f93a48f33b426776797047c49db2948a0c2df9 /lib/puppet/parser/templatewrapper.rb | |
parent | 9742c26310e6b30095651cb4e224c681603af1ff (diff) | |
parent | b2c1149b5f374df77ad3e017749f22f6981a453f (diff) | |
download | puppet-801b8a643d353176675023adaa25f26d0ec67403.tar.gz puppet-801b8a643d353176675023adaa25f26d0ec67403.tar.xz puppet-801b8a643d353176675023adaa25f26d0ec67403.zip |
Merge branch '0.24.x'
Conflicts:
lib/puppet/type/user.rb
Diffstat (limited to 'lib/puppet/parser/templatewrapper.rb')
-rw-r--r-- | lib/puppet/parser/templatewrapper.rb | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/puppet/parser/templatewrapper.rb b/lib/puppet/parser/templatewrapper.rb index fc716b0fd..036f6604e 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,12 @@ 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) + if name.kind_of?(String) + realname = name.gsub(/[^\w]/, "_") + else + realname = name + end + instance_variable_set("@#{realname}", value) } end |