From b3ab0d94cb592189b3c553512dafe221775a0626 Mon Sep 17 00:00:00 2001 From: Jacob Helwig Date: Fri, 15 Apr 2011 09:52:56 -0700 Subject: (#4655) Allow stage to be set using a default class parameter For example: stage{ pre: before => Stage[main] } class someclass ($stage=pre ) { ... } class { someclass: } This transplants adding the edge from the resource to the stage from the compiler into when the resource is evaluated. This moves adding the stage edges to after when the defaults are copied into the resources, making them available. Paired-with: Jesse Wolfe --- lib/puppet/parser/scope.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/puppet/parser/scope.rb') diff --git a/lib/puppet/parser/scope.rb b/lib/puppet/parser/scope.rb index 8de9d60b1..2da54fca5 100644 --- a/lib/puppet/parser/scope.rb +++ b/lib/puppet/parser/scope.rb @@ -101,7 +101,7 @@ class Puppet::Parser::Scope # Remove this when rebasing def environment - compiler.environment + compiler ? compiler.environment : nil end def find_hostclass(name) @@ -443,6 +443,6 @@ class Puppet::Parser::Scope def extend_with_functions_module extend Puppet::Parser::Functions.environment_module(Puppet::Node::Environment.root) - extend Puppet::Parser::Functions.environment_module(compiler ? environment : nil) + extend Puppet::Parser::Functions.environment_module(environment) end end -- cgit