Skip to content

Commit

Permalink
Revert "Merge branch 'pull-1339' into 3.1.x"
Browse files Browse the repository at this point in the history
This reverts commit 7bd6a90, reversing
changes made to 480379d.

This commit seems to be the cause of acceptance test failures so I'm
backing this out until we get that cleared up.
  • Loading branch information
adrienthebo authored and aboe76 committed Feb 9, 2013
1 parent 21f68f6 commit 67e13a2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 34 deletions.
5 changes: 3 additions & 2 deletions lib/puppet/node/environment.rb
Expand Up @@ -52,12 +52,11 @@ def self.current=(env)
end

def self.root
@root ||= new(:'*root*')
@root
end

def self.clear
@seen.clear
@root = nil
Thread.current[:environment] = nil
end

Expand Down Expand Up @@ -240,4 +239,6 @@ def empty_parse_result
# perform_initial_import when no file was actually loaded.
return Puppet::Parser::AST::Hostclass.new('')
end

@root = new(:'*root*')
end
32 changes: 0 additions & 32 deletions spec/unit/node/environment_spec.rb
Expand Up @@ -32,12 +32,6 @@
Puppet::Node::Environment.new("one").should equal(Puppet::Node::Environment.new("one"))
end

it "should treat environment instances as singletons only until cleared" do
before = Puppet::Node::Environment.new("one")
Puppet::Node::Environment.clear
before.should_not equal(Puppet::Node::Environment.new("one"))
end

it "should treat an environment specified as names or strings as equivalent" do
Puppet::Node::Environment.new(:one).should equal(Puppet::Node::Environment.new("one"))
end
Expand All @@ -51,32 +45,6 @@
Puppet::Node::Environment.new(one).should equal(one)
end

it "should return the *root* environment as the current env by default" do
Puppet::Node::Environment.current.name.to_s.should == '*root*'
end

it "should treat the *root* instance as a singleton only until cleared" do
before = Puppet::Node::Environment.current
Puppet::Node::Environment.clear
before.should_not equal(Puppet::Node::Environment.current)
end

it "should change the current environment" do
Puppet::Node::Environment.current.name.to_s.should == '*root*'
one = Puppet::Node::Environment.new(:one)
Puppet::Node::Environment.current = one
Puppet::Node::Environment.current.should equal(one)
end

it "should change the current environment only until cleared" do
Puppet::Node::Environment.current.name.to_s.should == '*root*'
one = Puppet::Node::Environment.new(:one)
Puppet::Node::Environment.current = one
Puppet::Node::Environment.current.should equal(one)
Puppet::Node::Environment.clear
Puppet::Node::Environment.current.name.to_s.should == '*root*'
end

describe "when managing known resource types" do
before do
@collection = Puppet::Resource::TypeCollection.new(env)
Expand Down

0 comments on commit 67e13a2

Please sign in to comment.