summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2007-09-07 12:10:59 -0500
committerLuke Kanies <luke@madstop.com>2007-09-07 12:10:59 -0500
commit9af79f117221d93f0d13a2c5ea3e886c6a9d939e (patch)
tree1470b73877b2d46c16f0e6ff4b15d4088b6a636f /lib/puppet
parent50874b2f1801b6ad2884803e98bbd220ef4af1bd (diff)
downloadpuppet-9af79f117221d93f0d13a2c5ea3e886c6a9d939e.tar.gz
puppet-9af79f117221d93f0d13a2c5ea3e886c6a9d939e.tar.xz
puppet-9af79f117221d93f0d13a2c5ea3e886c6a9d939e.zip
Fixing some failed tests. Mostly cleanup. Next is to make all of the user tests pass again, dammit.
Diffstat (limited to 'lib/puppet')
-rw-r--r--lib/puppet/parser/collector.rb8
-rw-r--r--lib/puppet/parser/compile.rb6
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.