From 9ecbd6306d227189ba161954aafc3e7f782a87b9 Mon Sep 17 00:00:00 2001 From: Brice Figureau Date: Sat, 11 Oct 2008 18:45:16 +0200 Subject: Fixed #1104 - Classes and nodes should set $name variables Signed-off-by: Brice Figureau --- lib/puppet/parser/ast/hostclass.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/puppet') 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 -- cgit