summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser/scope.rb
diff options
context:
space:
mode:
authorJacob Helwig <jacob@puppetlabs.com>2011-04-15 09:52:56 -0700
committerJacob Helwig <jacob@puppetlabs.com>2011-04-19 11:03:40 -0700
commit656eff821bec534a23e3e81e86ddbe3fc28f10ed (patch)
treec38ace649b9488a40d46dc3db07b9bc9eb790ab8 /lib/puppet/parser/scope.rb
parentbee1ef73e5c83541edcf1249f062ba832618da48 (diff)
downloadpuppet-656eff821bec534a23e3e81e86ddbe3fc28f10ed.tar.gz
puppet-656eff821bec534a23e3e81e86ddbe3fc28f10ed.tar.xz
puppet-656eff821bec534a23e3e81e86ddbe3fc28f10ed.zip
(#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 <jesse@puppetlabs.com>
Diffstat (limited to 'lib/puppet/parser/scope.rb')
-rw-r--r--lib/puppet/parser/scope.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/puppet/parser/scope.rb b/lib/puppet/parser/scope.rb
index 24f1d01f7..c369f129a 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
# Are we the top scope?
@@ -513,6 +513,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