diff options
author | Luke Kanies <luke@madstop.com> | 2007-09-04 15:14:39 -0500 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2007-09-04 15:14:39 -0500 |
commit | 11b127bd6708a18b512ca5b3018ccff1200cc47a (patch) | |
tree | 55d6f42b78404d6e6058f5bef2e50b6bf06b7105 /lib/puppet/parser/compile.rb | |
parent | 3b2efd2a4b32478b6c6a71e1421061405a0bb11e (diff) | |
download | puppet-11b127bd6708a18b512ca5b3018ccff1200cc47a.tar.gz puppet-11b127bd6708a18b512ca5b3018ccff1200cc47a.tar.xz puppet-11b127bd6708a18b512ca5b3018ccff1200cc47a.zip |
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.
Diffstat (limited to 'lib/puppet/parser/compile.rb')
-rw-r--r-- | lib/puppet/parser/compile.rb | 14 |
1 files changed, 5 insertions, 9 deletions
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. |