diff options
author | Brice Figureau <brice-puppet@daysofwonder.com> | 2008-10-11 18:45:16 +0200 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2008-10-28 11:50:10 +1100 |
commit | 9ecbd6306d227189ba161954aafc3e7f782a87b9 (patch) | |
tree | 306937bbf0ec5d77346635945de0918b3eb716d8 /lib/puppet/parser/ast/hostclass.rb | |
parent | 6539f55b16f44b4af0e706f696bab73b49d9d802 (diff) | |
download | puppet-9ecbd6306d227189ba161954aafc3e7f782a87b9.tar.gz puppet-9ecbd6306d227189ba161954aafc3e7f782a87b9.tar.xz puppet-9ecbd6306d227189ba161954aafc3e7f782a87b9.zip |
Fixed #1104 - Classes and nodes should set $name variables
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
Diffstat (limited to 'lib/puppet/parser/ast/hostclass.rb')
-rw-r--r-- | lib/puppet/parser/ast/hostclass.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/puppet/parser/ast/hostclass.rb b/lib/puppet/parser/ast/hostclass.rb index 7f89f8151..4f5c4797c 100644 --- a/lib/puppet/parser/ast/hostclass.rb +++ b/lib/puppet/parser/ast/hostclass.rb @@ -56,7 +56,12 @@ class Puppet::Parser::AST::HostClass < Puppet::Parser::AST::Definition # Don't create a subscope for the top-level class, since it already # has its own scope. - scope = subscope(scope, resource) unless resource.title == :main + unless resource.title == :main + scope = subscope(scope, resource) + + scope.setvar("title", resource.title) + scope.setvar("name", resource.name) + end # Add the parent scope namespaces to our own. if pnames |