lib/puppet/parser/compiler.rb
# Store a resource in our resource table.
Store a resource in our resource table.
Store a resource in our resource table .
def add_resource(scope, resource)
    @resources << resource
    @catalog.add_resource(resource)
    if not resource.class? and resource[:stage]
      raise ArgumentError, "Only classes can set 'stage'; normal resources like #{resource} cannot change run stage"
    end
    return if resource.stage?
    unless resource.class?
      return @catalog.add_edge(scope.resource, resource)
    end
  end
def add_resource ( scope , resource ) @resources << resource @catalog . add_resource ( resource ) if not resource . class? and resource [ :stage ] raise ArgumentError , "Only classes can set 'stage'; normal resources like #{resource} cannot change run stage" end return if resource . stage? unless resource . class? return @catalog . add_edge ( scope . resource , resource ) end end
Store a resource in our resource table.
Store a resource in our resource table .
# Note that this will fail if the resource is not unique. # Stages should not be inside of classes.  They are always a # top-level container, regardless of where they appear in the # manifest. # This adds a resource to the class it lexically appears in in the # manifest.
scope
<not_specific>
resource
<not_specific>