From 4666bd4670515c72cd9a191338d53242a816e9ca Mon Sep 17 00:00:00 2001 From: glasschef Date: Fri, 19 Jul 2019 09:49:12 -0500 Subject: Stringify duration field for a reported resource Legacy Reporting products will only accept a stringified integer for the duration field. --- lib/chef/resource_reporter.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/chef/resource_reporter.rb b/lib/chef/resource_reporter.rb index e63459388d..bbb4fa2e83 100644 --- a/lib/chef/resource_reporter.rb +++ b/lib/chef/resource_reporter.rb @@ -35,7 +35,7 @@ class Chef as_hash["id"] = new_resource.identity.to_s as_hash["after"] = new_resource.state_for_resource_reporter as_hash["before"] = current_resource ? current_resource.state_for_resource_reporter : {} - as_hash["duration"] = ( action_record.elapsed_time * 1000 ).to_i + as_hash["duration"] = ( action_record.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? -- cgit v1.2.1