From 06e86e40bbb173fa24a7d1c2ecf4e54e1748de67 Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Wed, 8 Jun 2011 18:55:10 -0700 Subject: Adding default environment to Scope We were previously not defaulting to an environment, which is silly given that there's always a default. It just made setup code harder. We now default to the default environment. This makes further testing involving scopes much easier. Signed-off-by: Luke Kanies Reviewed-by: Nick Lewis --- lib/puppet/parser/scope.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'lib/puppet/parser') diff --git a/lib/puppet/parser/scope.rb b/lib/puppet/parser/scope.rb index 67dcb1cb0..711655e44 100644 --- a/lib/puppet/parser/scope.rb +++ b/lib/puppet/parser/scope.rb @@ -82,10 +82,6 @@ class Puppet::Parser::Scope compiler.catalog end - def environment - compiler.environment - end - # Proxy accessors def host @compiler.node.name @@ -130,7 +126,7 @@ class Puppet::Parser::Scope # Remove this when rebasing def environment - compiler ? compiler.environment : nil + compiler ? compiler.environment : Puppet::Node::Environment.new end def find_hostclass(name) @@ -454,6 +450,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(environment) + extend Puppet::Parser::Functions.environment_module(environment) if environment != Puppet::Node::Environment.root end end -- cgit