diff options
Diffstat (limited to 'lib/puppet/parser')
| -rw-r--r-- | lib/puppet/parser/collector.rb | 8 | ||||
| -rw-r--r-- | lib/puppet/parser/compile.rb | 6 |
2 files changed, 10 insertions, 4 deletions
diff --git a/lib/puppet/parser/collector.rb b/lib/puppet/parser/collector.rb index c9d5ed5f0..d995bf7a7 100644 --- a/lib/puppet/parser/collector.rb +++ b/lib/puppet/parser/collector.rb @@ -121,6 +121,10 @@ class Puppet::Parser::Collector def initialize(scope, type, equery, vquery, form) @scope = scope + + unless scope.resource + raise "wtf?" + end @type = type @equery = equery @vquery = vquery @@ -162,7 +166,7 @@ class Puppet::Parser::Collector # XXX Because the scopes don't expect objects to return values, # we have to manually add our objects to the scope. This is # ber-lame. - scope.setresource(resource) + scope.compile.store_resource(scope, resource) rescue => detail if Puppet[:trace] puts detail.backtrace @@ -174,5 +178,3 @@ class Puppet::Parser::Collector return resource end end - -# $Id$ diff --git a/lib/puppet/parser/compile.rb b/lib/puppet/parser/compile.rb index cc9938e50..6aeebeaae 100644 --- a/lib/puppet/parser/compile.rb +++ b/lib/puppet/parser/compile.rb @@ -246,7 +246,11 @@ class Puppet::Parser::Compile raise Puppet::ParseError, "Could not find default node or by name with '%s'" % node.names.join(", ") end - astnode.safeevaluate :scope => topscope + # Create a resource to model this node, and then add it to the list + # of resources. + resource = Puppet::Parser::Resource.new(:type => "node", :title => astnode.classname, :scope => topscope, :source => topscope.source) + store_resource(topscope, resource) + @configuration.tag(astnode.classname) end # Evaluate our collections and return true if anything returned an object. |
