diff options
author | Luke Kanies <luke@madstop.com> | 2009-12-01 16:41:38 -0800 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2009-12-09 02:13:03 +1100 |
commit | 8971d8beae2c409f9052f27c3f80ad3bdfff4de2 (patch) | |
tree | c6f7eda0523c31c2b2f3a02b3761bf43ef716ebf /lib/puppet/parser/compiler.rb | |
parent | 39d4a935d47f1d42241ce492c48818dc5b533c29 (diff) | |
download | puppet-8971d8beae2c409f9052f27c3f80ad3bdfff4de2.tar.gz puppet-8971d8beae2c409f9052f27c3f80ad3bdfff4de2.tar.xz puppet-8971d8beae2c409f9052f27c3f80ad3bdfff4de2.zip |
Fixing #2596 - Node, Class, Definition are not AST
This commit extracts these three classes into a single
ResourceType class in the Parser heirarchy, now completely
independent of the AST heirarchy.
Most of the other changes are just changing the interface
to the new class, which is greatly simplified over the previous
classes.
This opens up the possibility of drastically simplifying a lot
of this other code, too -- in particular, replacing the reference
to the parser with a reference to the (soon to be renamed)
LoadedCode class.
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib/puppet/parser/compiler.rb')
-rw-r--r-- | lib/puppet/parser/compiler.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/puppet/parser/compiler.rb b/lib/puppet/parser/compiler.rb index 77b0bb98e..6b6cd6815 100644 --- a/lib/puppet/parser/compiler.rb +++ b/lib/puppet/parser/compiler.rb @@ -71,8 +71,8 @@ class Puppet::Parser::Compiler # variables. def class_scope(klass) # They might pass in either the class or class name - if klass.respond_to?(:classname) - @class_scopes[klass.classname] + if klass.respond_to?(:name) + @class_scopes[klass.name] else @class_scopes[klass] end @@ -140,7 +140,7 @@ class Puppet::Parser::Compiler if klass = scope.find_hostclass(name) found << name and next if class_scope(klass) - resource = klass.evaluate(scope) + resource = klass.mk_plain_resource(scope) # If they've disabled lazy evaluation (which the :include function does), # then evaluate our resource immediately. @@ -230,7 +230,7 @@ class Puppet::Parser::Compiler # Create a resource to model this node, and then add it to the list # of resources. - resource = astnode.evaluate(topscope) + resource = astnode.mk_plain_resource(topscope) resource.evaluate |