diff options
| author | Nick Lewis <nick@puppetlabs.com> | 2011-04-08 12:23:44 -0700 |
|---|---|---|
| committer | Nick Lewis <nick@puppetlabs.com> | 2011-04-08 12:23:44 -0700 |
| commit | 89327e9b956fd806418d548b25c458b9ebeac141 (patch) | |
| tree | 90a8e605006f3a47b071df6287b1b5f1684c2014 | |
| parent | 08a53bd452ca095df0d44a8d6b41e7088f6c449e (diff) | |
| parent | 9490cc9ecba28360c58173ec2eeb0dd1d3198960 (diff) | |
| download | puppet-89327e9b956fd806418d548b25c458b9ebeac141.tar.gz puppet-89327e9b956fd806418d548b25c458b9ebeac141.tar.xz puppet-89327e9b956fd806418d548b25c458b9ebeac141.zip | |
Merge branch 'ticket/next/7026' into next
| -rw-r--r-- | lib/puppet/transaction/report.rb | 6 | ||||
| -rwxr-xr-x | spec/unit/transaction/report_spec.rb | 19 |
2 files changed, 25 insertions, 0 deletions
diff --git a/lib/puppet/transaction/report.rb b/lib/puppet/transaction/report.rb index 16fee42ae..652b3874a 100644 --- a/lib/puppet/transaction/report.rb +++ b/lib/puppet/transaction/report.rb @@ -53,7 +53,13 @@ class Puppet::Transaction::Report end end + def prune_internal_data + resource_statuses.delete_if {|name,res| res.resource_type == 'Whit'} + end + def finalize_report + prune_internal_data + resource_metrics = add_metric(:resources, calculate_resource_metrics) add_metric(:time, calculate_time_metrics) change_metric = calculate_change_metric diff --git a/spec/unit/transaction/report_spec.rb b/spec/unit/transaction/report_spec.rb index a3bfe1e82..e7bfce401 100755 --- a/spec/unit/transaction/report_spec.rb +++ b/spec/unit/transaction/report_spec.rb @@ -5,6 +5,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper') require 'puppet/transaction/report' describe Puppet::Transaction::Report do + include PuppetSpec::Files before do Puppet::Util::Storage.stubs(:store) end @@ -38,6 +39,24 @@ describe Puppet::Transaction::Report do report.configuration_version.should == "some version" end + it "should not include whits" do + Puppet::FileBucket::File.indirection.stubs(:save) + + filename = tmpfile('whit_test') + file = Puppet::Type.type(:file).new(:path => filename) + + catalog = Puppet::Resource::Catalog.new + catalog.add_resource(file) + + report = Puppet::Transaction::Report.new("apply") + + catalog.apply(:report => report) + report.finalize_report + + report.resource_statuses.values.any? {|res| res.resource_type =~ /whit/i}.should be_false + report.metrics['time'].values.any? {|metric| metric.first =~ /whit/i}.should be_false + end + describe "when accepting logs" do before do @report = Puppet::Transaction::Report.new("apply") |
