diff options
author | Luke Kanies <luke@madstop.com> | 2009-06-04 00:33:25 -0500 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2009-07-05 18:47:08 +1000 |
commit | cddc365e9bac786c7a64240073b69bc54b6d2f2e (patch) | |
tree | 3a68f908af4320e7957a2d27fd24d49565c0000f /lib/puppet/parser/compiler.rb | |
parent | fc1f8cdbee606da0d2a1a162942295d28cdcbf64 (diff) | |
download | puppet-cddc365e9bac786c7a64240073b69bc54b6d2f2e.tar.gz puppet-cddc365e9bac786c7a64240073b69bc54b6d2f2e.tar.xz puppet-cddc365e9bac786c7a64240073b69bc54b6d2f2e.zip |
Switching to LoadedCode from ASTSet
I also took the opportunity to clean up and simplify
the interface to the parts of the parser that interact
with this. Mostly it was method renames.
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib/puppet/parser/compiler.rb')
-rw-r--r-- | lib/puppet/parser/compiler.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/puppet/parser/compiler.rb b/lib/puppet/parser/compiler.rb index 968e0b979..826e85a4a 100644 --- a/lib/puppet/parser/compiler.rb +++ b/lib/puppet/parser/compiler.rb @@ -44,7 +44,7 @@ class Puppet::Parser::Compiler # Do we use nodes found in the code, vs. the external node sources? def ast_nodes? - parser.nodes.length > 0 + parser.nodes? end # Store the fact that we've evaluated a class, and store a reference to @@ -133,7 +133,7 @@ class Puppet::Parser::Compiler found = [] classes.each do |name| # If we can find the class, then make a resource that will evaluate it. - if klass = scope.findclass(name) + if klass = scope.find_hostclass(name) found << name and next if class_scope(klass) resource = klass.evaluate(scope) @@ -217,10 +217,10 @@ class Puppet::Parser::Compiler # Now see if we can find the node. astnode = nil @node.names.each do |name| - break if astnode = @parser.nodes[name.to_s.downcase] + break if astnode = @parser.node(name.to_s.downcase) end - unless (astnode ||= @parser.nodes["default"]) + unless (astnode ||= @parser.node("default")) raise Puppet::ParseError, "Could not find default node or by name with '%s'" % node.names.join(", ") end @@ -298,7 +298,7 @@ class Puppet::Parser::Compiler # Find and evaluate our main object, if possible. def evaluate_main - @main = @parser.findclass("", "") || @parser.newclass("") + @main = @parser.find_hostclass("", "") || @parser.newclass("") @topscope.source = @main @main_resource = Puppet::Parser::Resource.new(:type => "class", :title => :main, :scope => @topscope, :source => @main) @topscope.resource = @main_resource |