diff options
Diffstat (limited to 'lib/puppet')
-rw-r--r-- | lib/puppet/parser/ast/component.rb | 16 | ||||
-rw-r--r-- | lib/puppet/parser/ast/objectdef.rb | 4 |
2 files changed, 5 insertions, 15 deletions
diff --git a/lib/puppet/parser/ast/component.rb b/lib/puppet/parser/ast/component.rb index 0ecdb1d02..00677e1ea 100644 --- a/lib/puppet/parser/ast/component.rb +++ b/lib/puppet/parser/ast/component.rb @@ -24,24 +24,14 @@ class Puppet::Parser::AST :name => objname, :keyword => self.keyword ) - if hash[:newcontext] + newcontext = hash[:newcontext] + + unless self.is_a? AST::HostClass and ! newcontext #scope.warning "Setting context to %s" % self.object_id scope.context = self.object_id end @scope = scope - # The type is the component or class name - #scope.type = objtype - - # The name is the name the user has chosen or that has - # been dynamically generated. This is almost never used - #scope.name = objname - - #scope.keyword = self.keyword - - #if self.is_a?(Node) - # scope.isnodescope - #end # Additionally, add a tag for whatever kind of class # we are diff --git a/lib/puppet/parser/ast/objectdef.rb b/lib/puppet/parser/ast/objectdef.rb index 0b8d50e6d..59758b982 100644 --- a/lib/puppet/parser/ast/objectdef.rb +++ b/lib/puppet/parser/ast/objectdef.rb @@ -285,7 +285,7 @@ class Puppet::Parser::AST return true unless defined? @scope and @scope # Unless we can look up the type, throw an error - unless objtype = @scope.lookuptype(objtype) + unless typeobj = @scope.lookuptype(objtype) error = Puppet::ParseError.new( "Unknown type '%s'" % objtype ) @@ -297,7 +297,7 @@ class Puppet::Parser::AST # Now that we have the type, verify all of the parameters. # Note that we're now passing an AST Class object or whatever # as the type, not a simple string. - self.paramcheck(builtin, objtype) + self.paramcheck(builtin, typeobj) end end |