summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
authorBrice Figureau <brice-puppet@daysofwonder.com>2008-10-11 18:45:16 +0200
committerJames Turnbull <james@lovedthanlost.net>2008-10-28 11:50:10 +1100
commit9ecbd6306d227189ba161954aafc3e7f782a87b9 (patch)
tree306937bbf0ec5d77346635945de0918b3eb716d8 /lib/puppet
parent6539f55b16f44b4af0e706f696bab73b49d9d802 (diff)
downloadpuppet-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')
-rw-r--r--lib/puppet/parser/ast/hostclass.rb7
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