summaryrefslogtreecommitdiff
path: root/lib/chef/resource_reporter.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/resource_reporter.rb')
-rw-r--r--lib/chef/resource_reporter.rb11
1 files changed, 2 insertions, 9 deletions
diff --git a/lib/chef/resource_reporter.rb b/lib/chef/resource_reporter.rb
index 1816fc857d..96cc01d814 100644
--- a/lib/chef/resource_reporter.rb
+++ b/lib/chef/resource_reporter.rb
@@ -62,8 +62,8 @@ class Chef
as_hash["type"] = new_resource.class.dsl_name
as_hash["name"] = new_resource.name.to_s
as_hash["id"] = new_resource.identity.to_s
- as_hash["after"] = state(new_resource)
- as_hash["before"] = current_resource ? state(current_resource) : {}
+ as_hash["after"] = new_resource.state_for_resource_reporter
+ as_hash["before"] = current_resource ? current_resource.state_for_resource_reporter : {}
as_hash["duration"] = (elapsed_time * 1000).to_i.to_s
as_hash["delta"] = new_resource.diff if new_resource.respond_to?("diff")
as_hash["delta"] = "" if as_hash["delta"].nil?
@@ -89,13 +89,6 @@ class Chef
def success?
!self.exception
end
-
- def state(r)
- r.class.state_attrs.inject({}) do |state_attrs, attr_name|
- state_attrs[attr_name] = r.send(attr_name)
- state_attrs
- end
- end
end # End class ResouceReport
attr_reader :updated_resources