diff options
| author | Luke Kanies <luke@madstop.com> | 2007-12-11 17:32:21 -0600 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2007-12-11 17:32:21 -0600 |
| commit | 690e2872864a8a46710445ab07c7d9afa33d0afc (patch) | |
| tree | db3347ad6403c124b788866946e5106bc269fb97 /spec/unit/parser | |
| parent | f1169ee7cd05003de67070f193e70255706d95cb (diff) | |
| download | puppet-690e2872864a8a46710445ab07c7d9afa33d0afc.tar.gz puppet-690e2872864a8a46710445ab07c7d9afa33d0afc.tar.xz puppet-690e2872864a8a46710445ab07c7d9afa33d0afc.zip | |
This should be the last fix for exported resources.
Hosts were keeping the export bit on all resources,
even when they'd collected another host's resources,
which caused a duplicate copy that was still exported.
Diffstat (limited to 'spec/unit/parser')
| -rwxr-xr-x | spec/unit/parser/collector.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/unit/parser/collector.rb b/spec/unit/parser/collector.rb index 450176f30..9b5eab1f4 100755 --- a/spec/unit/parser/collector.rb +++ b/spec/unit/parser/collector.rb @@ -296,6 +296,27 @@ describe Puppet::Parser::Collector, "when collecting exported resources" do @collector.evaluate.should == [resource] end + # This way one host doesn't store another host's resources as exported. + it "should mark resources collected from the database as not exported" do + stub_rails() + Puppet::Rails::Host.stubs(:find_by_name).returns(nil) + + one = stub 'one', :restype => "Mytype", :title => "one", :virtual? => true, :exported? => true + Puppet::Rails::Resource.stubs(:find).returns([one]) + + resource = mock 'resource' + one.expects(:to_resource).with(@scope).returns(resource) + resource.expects(:exported=).with(false) + resource.stubs(:virtual=) + + @compile.stubs(:resources).returns([]) + @scope.stubs(:findresource).returns(nil) + + @compile.stubs(:store_resource) + + @collector.evaluate + end + it "should fail if an equivalent resource already exists in the compile" do stub_rails() Puppet::Rails::Host.stubs(:find_by_name).returns(nil) |
