diff options
author | Luke Kanies <luke@madstop.com> | 2007-11-12 22:08:44 -0600 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2007-11-12 22:08:44 -0600 |
commit | 72510bfaa65e97f4eaaf246ef8f1c155716967b6 (patch) | |
tree | 978aa0e92812f5854978048162c6e2ab752dad72 /lib/puppet/parser/compile.rb | |
parent | dd7caa76e160ed51c8b0e123c18f7526b575bfec (diff) | |
download | puppet-72510bfaa65e97f4eaaf246ef8f1c155716967b6.tar.gz puppet-72510bfaa65e97f4eaaf246ef8f1c155716967b6.tar.xz puppet-72510bfaa65e97f4eaaf246ef8f1c155716967b6.zip |
Fixing #800 by refactoring how configurations are retrieved
from the server. The real problem was getting all of the validation
done before any caching, which required a good bit more refactoring
than I expected.
In actuality, this commit is relatively small even though it covers
many files; most of the changes just make the code clearer or shorter.
Diffstat (limited to 'lib/puppet/parser/compile.rb')
-rw-r--r-- | lib/puppet/parser/compile.rb | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/puppet/parser/compile.rb b/lib/puppet/parser/compile.rb index 45d60a58c..7f568f1b3 100644 --- a/lib/puppet/parser/compile.rb +++ b/lib/puppet/parser/compile.rb @@ -107,7 +107,7 @@ class Puppet::Parser::Compile # Evaluate all of the classes specified by the node. def evaluate_node_classes - evaluate_classes(@node.classes, @topscope) + evaluate_classes(@node.classes, topscope) end # Evaluate each specified class in turn. If there are any classes we can't @@ -142,9 +142,7 @@ class Puppet::Parser::Compile # Return a resource by either its ref or its type and title. def findresource(string, name = nil) - if name - string = "%s[%s]" % [string.capitalize, name] - end + string = "%s[%s]" % [string.capitalize, name] if name @resource_table[string] end @@ -173,7 +171,7 @@ class Puppet::Parser::Compile # using the top scope. Adds an edge between the scope and # its parent to the graph. def newscope(parent, options = {}) - parent ||= @topscope + parent ||= topscope options[:compile] = self options[:parser] ||= self.parser scope = Puppet::Parser::Scope.new(options) @@ -419,7 +417,6 @@ class Puppet::Parser::Compile # A graph for maintaining scope relationships. @scope_graph = GRATR::Digraph.new - @scope_graph.add_vertex!(@topscope) # For maintaining the relationship between scopes and their resources. @configuration = Puppet::Node::Configuration.new(@node.name) |