From e9627a060619eaf0f8eeb012979dddb047c6648e Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Wed, 19 May 2010 09:32:44 -0700 Subject: Fixing #2658 - adding backward compatibility for 0.24 The way stages were implemented caused backward compatibility to be completely broken for 0.24.x. This commit fixes that, mostly by assuming Stage[main] will be the top node in the graph rather than Class[main]. Other stages are not supported in 0.24.x, and explicitly throw a warning (although not an error). Signed-off-by: Luke Kanies --- lib/puppet/parser/compiler.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib/puppet/parser') diff --git a/lib/puppet/parser/compiler.rb b/lib/puppet/parser/compiler.rb index 6cc71a62e..beba438a9 100644 --- a/lib/puppet/parser/compiler.rb +++ b/lib/puppet/parser/compiler.rb @@ -54,10 +54,10 @@ class Puppet::Parser::Compiler 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" @@ -305,6 +305,8 @@ class Puppet::Parser::Compiler @resources << @main_resource @catalog.add_resource(@main_resource) + set_container_resource(@topscope, @main_resource) + @main_resource.evaluate end -- cgit