summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser/compiler.rb
diff options
context:
space:
mode:
authorLuke Kanies <luke@puppetlabs.com>2010-05-19 09:32:44 -0700
committertest branch <puppet-dev@googlegroups.com>2010-02-17 06:50:53 -0800
commite9627a060619eaf0f8eeb012979dddb047c6648e (patch)
tree697304e0850d89aad99fca266e7dcd809775992d /lib/puppet/parser/compiler.rb
parent61a719f41c5448ca9ab7bdbd6a05f6c97ee80b7f (diff)
downloadpuppet-e9627a060619eaf0f8eeb012979dddb047c6648e.tar.gz
puppet-e9627a060619eaf0f8eeb012979dddb047c6648e.tar.xz
puppet-e9627a060619eaf0f8eeb012979dddb047c6648e.zip
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 <luke@puppetlabs.com>
Diffstat (limited to 'lib/puppet/parser/compiler.rb')
-rw-r--r--lib/puppet/parser/compiler.rb8
1 files changed, 5 insertions, 3 deletions
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