diff options
Diffstat (limited to 'lib/puppet/parser')
-rw-r--r-- | lib/puppet/parser/ast/collection.rb | 2 | ||||
-rw-r--r-- | lib/puppet/parser/collector.rb | 6 | ||||
-rw-r--r-- | lib/puppet/parser/compile.rb (renamed from lib/puppet/parser/configuration.rb) | 10 | ||||
-rw-r--r-- | lib/puppet/parser/functions.rb | 6 | ||||
-rw-r--r-- | lib/puppet/parser/interpreter.rb | 2 | ||||
-rw-r--r-- | lib/puppet/parser/resource.rb | 4 | ||||
-rw-r--r-- | lib/puppet/parser/scope.rb | 22 | ||||
-rw-r--r-- | lib/puppet/parser/templatewrapper.rb | 2 |
8 files changed, 27 insertions, 27 deletions
diff --git a/lib/puppet/parser/ast/collection.rb b/lib/puppet/parser/ast/collection.rb index 7daf031cf..a7564f0c9 100644 --- a/lib/puppet/parser/ast/collection.rb +++ b/lib/puppet/parser/ast/collection.rb @@ -20,7 +20,7 @@ class Collection < AST::Branch newcoll = Puppet::Parser::Collector.new(scope, @type, str, code, self.form) - scope.configuration.add_collection(newcoll) + scope.compile.add_collection(newcoll) newcoll end diff --git a/lib/puppet/parser/collector.rb b/lib/puppet/parser/collector.rb index 0846c40ab..c9d5ed5f0 100644 --- a/lib/puppet/parser/collector.rb +++ b/lib/puppet/parser/collector.rb @@ -81,20 +81,20 @@ class Puppet::Parser::Collector # If there are no more resources to find, delete this from the list # of collections. if @resources.empty? - @scope.configuration.delete_collection(self) + @scope.compile.delete_collection(self) end return result end - # Collect just virtual objects, from our local configuration. + # Collect just virtual objects, from our local compile. def collect_virtual(exported = false) if exported method = :exported? else method = :virtual? end - scope.configuration.resources.find_all do |resource| + scope.compile.resources.find_all do |resource| resource.type == @type and resource.send(method) and match?(resource) end end diff --git a/lib/puppet/parser/configuration.rb b/lib/puppet/parser/compile.rb index a56bfa080..6cfe66fce 100644 --- a/lib/puppet/parser/configuration.rb +++ b/lib/puppet/parser/compile.rb @@ -10,7 +10,7 @@ require 'puppet/util/errors' # Maintain a graph of scopes, along with a bunch of data # about the individual configuration we're compiling. -class Puppet::Parser::Configuration +class Puppet::Parser::Compile include Puppet::Util include Puppet::Util::Errors attr_reader :topscope, :parser, :node, :facts, :collections @@ -155,7 +155,7 @@ class Puppet::Parser::Configuration begin send(param.to_s + "=", value) rescue NoMethodError - raise ArgumentError, "Configuration objects do not accept %s" % param + raise ArgumentError, "Compile objects do not accept %s" % param end end @@ -169,7 +169,7 @@ class Puppet::Parser::Configuration # its parent to the graph. def newscope(parent, options = {}) parent ||= @topscope - options[:configuration] = self + options[:compile] = self options[:parser] ||= self.parser scope = Puppet::Parser::Scope.new(options) @scope_graph.add_edge!(parent, scope) @@ -282,7 +282,7 @@ class Puppet::Parser::Configuration end # Iterate over collections and resources until we're sure that the whole - # configuration is evaluated. This is necessary because both collections + # compile is evaluated. This is necessary because both collections # and defined resources can generate new resources, which themselves could # be defined resources. def evaluate_generators @@ -449,7 +449,7 @@ class Puppet::Parser::Configuration @tags = [] # Create our initial scope, our scope graph, and add the initial scope to the graph. - @topscope = Puppet::Parser::Scope.new(:configuration => self, :type => "main", :name => "top", :parser => self.parser) + @topscope = Puppet::Parser::Scope.new(:compile => self, :type => "main", :name => "top", :parser => self.parser) # For maintaining scope relationships. @scope_graph = GRATR::Digraph.new diff --git a/lib/puppet/parser/functions.rb b/lib/puppet/parser/functions.rb index ad58c7040..895b4f083 100644 --- a/lib/puppet/parser/functions.rb +++ b/lib/puppet/parser/functions.rb @@ -110,7 +110,7 @@ module Functions # Include the specified classes newfunction(:include, :doc => "Evaluate one or more classes.") do |vals| vals = [vals] unless vals.is_a?(Array) - klasses = configuration.evaluate_classes(vals) + klasses = compile.evaluate_classes(vals) missing = vals.find_all do |klass| ! klasses.include?(klass) @@ -145,7 +145,7 @@ module Functions tells you whether the current container is tagged with the specified tags. The tags are ANDed, so that all of the specified tags must be included for the function to return true.") do |vals| - classlist = configuration.classlist + classlist = compile.classlist retval = true vals.each do |val| @@ -235,7 +235,7 @@ module Functions vals = [vals] unless vals.is_a?(Array) coll.resources = vals - configuration.add_collection(coll) + compile.add_collection(coll) end newfunction(:search, :doc => "Add another namespace for this class to search. diff --git a/lib/puppet/parser/interpreter.rb b/lib/puppet/parser/interpreter.rb index 291f122a7..c0f9d32a7 100644 --- a/lib/puppet/parser/interpreter.rb +++ b/lib/puppet/parser/interpreter.rb @@ -3,7 +3,7 @@ require 'timeout' require 'puppet/rails' require 'puppet/util/methodhelper' require 'puppet/parser/parser' -require 'puppet/parser/configuration' +require 'puppet/parser/compile' require 'puppet/parser/scope' # The interpreter is a very simple entry-point class that diff --git a/lib/puppet/parser/resource.rb b/lib/puppet/parser/resource.rb index f946c1328..3940e5fc2 100644 --- a/lib/puppet/parser/resource.rb +++ b/lib/puppet/parser/resource.rb @@ -51,7 +51,7 @@ class Puppet::Parser::Resource def evaluate if klass = @ref.definedtype finish() - scope.configuration.delete_resource(self) + scope.compile.delete_resource(self) return klass.evaluate_resource(:scope => scope, :type => self.type, :title => self.title, @@ -317,7 +317,7 @@ class Puppet::Parser::Resource # Add any overrides for this object. def add_overrides - if overrides = scope.configuration.resource_overrides(self) + if overrides = scope.compile.resource_overrides(self) overrides.each do |over| self.merge(over) end diff --git a/lib/puppet/parser/scope.rb b/lib/puppet/parser/scope.rb index 9e6739c53..396cce888 100644 --- a/lib/puppet/parser/scope.rb +++ b/lib/puppet/parser/scope.rb @@ -17,14 +17,14 @@ class Puppet::Parser::Scope include Puppet::Util::Errors attr_accessor :parent, :level, :parser, :source attr_accessor :name, :type, :base, :keyword - attr_accessor :top, :translated, :exported, :virtual, :configuration + attr_accessor :top, :translated, :exported, :virtual, :compile # Proxy accessors def host - @configuration.node.name + @compile.node.name end def interpreter - @configuration.interpreter + @compile.interpreter end # Is the value true? This allows us to control the definition of truth @@ -56,9 +56,9 @@ class Puppet::Parser::Scope end end - # Retrieve a given class scope from the configuration. + # Retrieve a given class scope from the compile. def class_scope(klass) - configuration.class_scope(klass) + compile.class_scope(klass) end # Are we the top scope? @@ -89,7 +89,7 @@ class Puppet::Parser::Scope end def findresource(string, name = nil) - configuration.findresource(string, name) + compile.findresource(string, name) end # Initialize our new scope. Defaults to having no parent. @@ -201,7 +201,7 @@ class Puppet::Parser::Scope # Create a new scope and set these options. def newscope(options = {}) - configuration.newscope(self, options) + compile.newscope(self, options) end # Is this class for a node? This is used to make sure that @@ -216,7 +216,7 @@ class Puppet::Parser::Scope # than doing lots of queries. def parent unless defined?(@parent) - @parent = configuration.parent(self) + @parent = compile.parent(self) end @parent end @@ -245,7 +245,7 @@ class Puppet::Parser::Scope raise Puppet::DevError, "Got a %s with no fully qualified name" % klass.class end - @configuration.class_set(name, self) + @compile.class_set(name, self) else raise Puppet::DevError, "Invalid class %s" % klass.inspect end @@ -258,7 +258,7 @@ class Puppet::Parser::Scope # Add a new object to our object table and the global list, and do any necessary # checks. def setresource(resource) - @configuration.store_resource(self, resource) + @compile.store_resource(self, resource) # Mark the resource as virtual or exported, as necessary. if self.exported? @@ -274,7 +274,7 @@ class Puppet::Parser::Scope # exist, then cache the override in a global table, so it can be flushed # at the end. def setoverride(resource) - @configuration.store_override(resource) + @compile.store_override(resource) end # Set defaults for a type. The typename should already be downcased, diff --git a/lib/puppet/parser/templatewrapper.rb b/lib/puppet/parser/templatewrapper.rb index ecef60e43..f863e31aa 100644 --- a/lib/puppet/parser/templatewrapper.rb +++ b/lib/puppet/parser/templatewrapper.rb @@ -7,7 +7,7 @@ class Puppet::Parser::TemplateWrapper def initialize(scope, file) @scope = scope - @file = Puppet::Module::find_template(file, @scope.configuration.environment) + @file = Puppet::Module::find_template(file, @scope.compile.environment) unless FileTest.exists?(@file) raise Puppet::ParseError, |