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.

Signed-off-by: Paul Berry <[email protected]>
---
 lib/puppet/transaction/report.rb     |    4 ++++
 spec/unit/transaction/report_spec.rb |    8 ++++++++
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/lib/puppet/transaction/report.rb b/lib/puppet/transaction/report.rb
index bcdefd0..b40c856 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 1678c09..8c4ed8a 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
-- 
1.7.2

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to