From 61a719f41c5448ca9ab7bdbd6a05f6c97ee80b7f Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Fri, 14 May 2010 13:30:43 -0700 Subject: Adding #2658 - Adding support for run stages This allows you to specify a run stage for either a class or a resource. By default, all classes get directly added to the 'main' stage. You can create new stages as resources: stage { [pre, post]: } To order stages, use standard relationships: stage { pre: before => Stage[main] } Or use the new relationship syntax: stage { pre: } -> Stage[main] -> stage { post: } Then use the new class parameters to specify a stage: class { foo: stage => pre } If you set a stage on an individual resource, it will fail; stages can only be set on class resources. Signed-off-by: Luke Kanies --- lib/puppet/simple_graph.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/puppet/simple_graph.rb') diff --git a/lib/puppet/simple_graph.rb b/lib/puppet/simple_graph.rb index 91603945c..cf0eff38e 100644 --- a/lib/puppet/simple_graph.rb +++ b/lib/puppet/simple_graph.rb @@ -323,7 +323,8 @@ class Puppet::SimpleGraph # graph. We could get a similar affect by only setting relationships # to container leaves, but that would result in many more # relationships. - containers = other.topsort.find_all { |v| v.is_a?(type) and vertex?(v) } + stage_class = Puppet::Type.type(:stage) + containers = other.topsort.find_all { |v| (v.is_a?(type) or v.is_a?(stage_class)) and vertex?(v) } containers.each do |container| # Get the list of children from the other graph. children = other.adjacent(container, :direction => :out) -- cgit