From 11b127bd6708a18b512ca5b3018ccff1200cc47a Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Tue, 4 Sep 2007 15:14:39 -0500 Subject: Successfully modified all tests and code so that all language tests pass again. This is the majority of the work necessary to make the separate "configuration" object work. --- lib/puppet/parser/compile.rb | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'lib/puppet/parser/compile.rb') diff --git a/lib/puppet/parser/compile.rb b/lib/puppet/parser/compile.rb index a8e80eb9d..841e58d4d 100644 --- a/lib/puppet/parser/compile.rb +++ b/lib/puppet/parser/compile.rb @@ -14,7 +14,7 @@ require 'puppet/util/errors' class Puppet::Parser::Compile include Puppet::Util include Puppet::Util::Errors - attr_reader :topscope, :parser, :node, :facts, :collections + attr_reader :topscope, :parser, :node, :facts, :collections, :configuration attr_writer :ast_nodes @@ -121,13 +121,14 @@ class Puppet::Parser::Compile classes.each do |name| # If we can find the class, then make a resource that will evaluate it. if klass = scope.findclass(name) - # Create a resource to model this class, and then add it to the list - # of resources. unless scope.source - raise "No source for %s" % scope.to_s + raise Puppet::DevError, "No source for %s" % scope.to_s end + # Create a resource to model this class, and then add it to the list + # of resources. resource = Puppet::Parser::Resource.new(:type => "class", :title => klass.classname, :scope => scope, :source => scope.source) store_resource(scope, resource) + @configuration.tag(klass.classname) found << name else Puppet.info "Could not find class %s for %s" % [name, node.name] @@ -311,11 +312,6 @@ class Puppet::Parser::Compile @configuration.add_vertex!(@main_resource) @resource_table["Class[main]"] = @main_resource - #if klass = @parser.findclass("", "") - # # Set the source, so objects can tell where they were defined. - # topscope.source = klass - # klass.safeevaluate :scope => topscope, :nosubscope => true - #end end # Make sure the entire configuration is evaluated. -- cgit