summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser
diff options
context:
space:
mode:
authorJesse Wolfe <jes5199@gmail.com>2010-08-27 12:49:54 -0700
committerJesse Wolfe <jes5199@gmail.com>2010-08-27 12:50:26 -0700
commit21afb51a1b84116b2a906a6959ae588f45135104 (patch)
tree48fa0438d0a50202194956344d0cf1f10b17b818 /lib/puppet/parser
parent1f3070c4bc77b38e3dd6170cf6a58bee7ec337ac (diff)
parent8be1929043f4560bb17a4b06293b3f9a4efcfdbf (diff)
downloadpuppet-21afb51a1b84116b2a906a6959ae588f45135104.tar.gz
puppet-21afb51a1b84116b2a906a6959ae588f45135104.tar.xz
puppet-21afb51a1b84116b2a906a6959ae588f45135104.zip
Merge commit '2.6.1rc3'
This synchronizes the 2.7 master branch with 2.6.1RC3 The 2.7 next branch has now diverged from master for the first time, as if contains code that has not reached "release quality" status.
Diffstat (limited to 'lib/puppet/parser')
-rw-r--r--lib/puppet/parser/compiler.rb19
1 files changed, 6 insertions, 13 deletions
diff --git a/lib/puppet/parser/compiler.rb b/lib/puppet/parser/compiler.rb
index 98cad952c..7504b276b 100644
--- a/lib/puppet/parser/compiler.rb
+++ b/lib/puppet/parser/compiler.rb
@@ -56,13 +56,10 @@ class Puppet::Parser::Compiler
# Note that this will fail if the resource is not unique.
@catalog.add_resource(resource)
- set_container_resource(scope, resource)
- end
- # Add our container edge. If we're a class, then we get treated specially - we can
- # control the stage that the class is applied in. Otherwise, we just
- # get added to our parent container.
- def set_container_resource(scope, resource)
+ # Add our container edge. If we're a class, then we get treated specially - we can
+ # control the stage that the class is applied in. Otherwise, we just
+ # get added to our parent container.
return if resource.type.to_s.downcase == "stage"
if resource.type.to_s.downcase != "class"
@@ -70,15 +67,14 @@ class Puppet::Parser::Compiler
return @catalog.add_edge(scope.resource, resource)
end
- unless stage = @catalog.resource(:stage, resource[:stage] || :main)
+ unless stage = @catalog.resource(:stage, resource[:stage] || (scope && scope.resource && scope.resource[:stage]) || :main)
raise ArgumentError, "Could not find stage #{resource[:stage] || :main} specified by #{resource}"
end
+ resource[:stage] ||= stage.title
@catalog.add_edge(stage, resource)
end
- private :set_container_resource
-
# Do we use nodes found in the code, vs. the external node sources?
def ast_nodes?
known_resource_types.nodes?
@@ -289,10 +285,7 @@ class Puppet::Parser::Compiler
@main_resource = Puppet::Parser::Resource.new("class", :main, :scope => @topscope, :source => @main)
@topscope.resource = @main_resource
- @resources << @main_resource
- @catalog.add_resource(@main_resource)
-
- set_container_resource(@topscope, @main_resource)
+ add_resource(@topscope, @main_resource)
@main_resource.evaluate
end