summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Berry <paul@puppetlabs.com>2010-12-29 12:15:26 -0800
committerPaul Berry <paul@puppetlabs.com>2010-12-30 11:49:42 -0800
commitd1bcdec38e5493e1e44192eaf07da2e88b8eb850 (patch)
treecf6ef2b32019a0355600c1af1ece5967f2d55c99
parent1550bbb218719590431575cb4c200e620680a79d (diff)
downloadpuppet-d1bcdec38e5493e1e44192eaf07da2e88b8eb850.tar.gz
puppet-d1bcdec38e5493e1e44192eaf07da2e88b8eb850.tar.xz
puppet-d1bcdec38e5493e1e44192eaf07da2e88b8eb850.zip
(#5715) Removed Puppet::Transaction::Report#external_times from YAML output.
This attribute was never intended to be serialized to YAML; it exists merely as temporary storage for metrics that have not yet been placed in the report's metrics attribute.
-rw-r--r--lib/puppet/transaction/report.rb4
-rwxr-xr-xspec/unit/transaction/report_spec.rb8
2 files changed, 12 insertions, 0 deletions
diff --git a/lib/puppet/transaction/report.rb b/lib/puppet/transaction/report.rb
index bcdefd08d..b40c856ac 100644
--- a/lib/puppet/transaction/report.rb
+++ b/lib/puppet/transaction/report.rb
@@ -101,6 +101,10 @@ class Puppet::Transaction::Report
status
end
+ def to_yaml_properties
+ (instance_variables - ["@external_times"]).sort
+ end
+
private
def calculate_change_metrics
diff --git a/spec/unit/transaction/report_spec.rb b/spec/unit/transaction/report_spec.rb
index 1678c0940..8c4ed8afe 100755
--- a/spec/unit/transaction/report_spec.rb
+++ b/spec/unit/transaction/report_spec.rb
@@ -254,4 +254,12 @@ describe Puppet::Transaction::Report do
end
end
end
+
+ describe "when outputting yaml" do
+ it "should not include @external_times" do
+ report = Puppet::Transaction::Report.new('apply')
+ report.add_times('config_retrieval', 1.0)
+ report.to_yaml_properties.should_not include('@external_times')
+ end
+ end
end