summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorNick Lewis <nick@puppetlabs.com>2011-04-08 12:17:10 -0700
committerNick Lewis <nick@puppetlabs.com>2011-04-08 12:17:10 -0700
commit9490cc9ecba28360c58173ec2eeb0dd1d3198960 (patch)
tree521ad3db4cdfd81b1f19a9e4b48f6260bf5f2168 /lib
parente17cc651a9625576aa79af428bbaec702e216ac8 (diff)
downloadpuppet-9490cc9ecba28360c58173ec2eeb0dd1d3198960.tar.gz
puppet-9490cc9ecba28360c58173ec2eeb0dd1d3198960.tar.xz
puppet-9490cc9ecba28360c58173ec2eeb0dd1d3198960.zip
(#7026) Remove whits from reports when finalizing
Resource statuses and metrics for Whits were being added to reports. Since they are transient internal data, they shouldn't be included in the report. This change adds a Puppet::Transaction::Report#prune_internal_data method, called by Puppet::Transaction::Report#finalize_report, providing a central place for this sort of pruning in the future. Paired-With: Max Martin
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/transaction/report.rb6
1 files changed, 6 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