lib/puppet/parser/compiler.rb
# Set up all of our internal variables.
Set up all of our internal variables.
Set up all of our internal variables .
def initvars
    @exported_resources = {}
    @resource_overrides = Hash.new do |overs, ref|
      overs[ref] = []
    end
    @collections = []
    @relationships = []
    @catalog = Puppet::Resource::Catalog.new(@node.name)
    @catalog.version = known_resource_types.version
    @catalog.environment = @node.environment.to_s
    @topscope = Puppet::Parser::Scope.new(self)
    @main_stage_resource = Puppet::Parser::Resource.new("stage", :main, :scope => @topscope)
    @catalog.add_resource(@main_stage_resource)
    @resources = []
    if @node.classes.class == Hash
      @catalog.add_class(*@node.classes.keys)
    else
      @catalog.add_class(*@node.classes)
    end
  end
def initvars @exported_resources = { } @resource_overrides = Hash . new do | overs , ref | overs [ ref ] = [ ] end @collections = [ ] @relationships = [ ] @catalog = Puppet :: Resource :: Catalog . new ( @node . name ) @catalog . version = known_resource_types . version @catalog . environment = @node . environment . to_s @topscope = Puppet :: Parser :: Scope . new ( self ) @main_stage_resource = Puppet :: Parser :: Resource . new ( "stage" , :main , :scope => @topscope ) @catalog . add_resource ( @main_stage_resource ) @resources = [ ] if @node . classes . class == Hash @catalog . add_class ( * @node . classes . keys ) else @catalog . add_class ( * @node . classes ) end end
Set up all of our internal variables.
Set up all of our internal variables .
# The list of objects that will available for export. # The list of overrides.  This is used to cache overrides on objects # that don't exist yet.  We store an array of each override. # The list of collections that have been created.  This is a global list, # but they each refer back to the scope that created them. # The list of relationships to evaluate. # For maintaining the relationship between scopes and their resources. # Create our initial scope and a resource that will evaluate main. # local resource array to maintain resource ordering # Make sure any external node classes are in our class list