summaryrefslogtreecommitdiff
path: root/lib/chef/data_collector
diff options
context:
space:
mode:
authorAdam Leff <adam@leff.co>2016-06-07 15:39:06 -0400
committerAdam Leff <adam@leff.co>2016-06-07 15:39:06 -0400
commitc4cf0bbf1836fb70b0dc3aaf2f5df0399f5633ee (patch)
treeee4f8e435ed1985c7d0bd289ede6d23a23723cfb /lib/chef/data_collector
parentea15504eb0e8797a435eb8c823e31bdb996a4305 (diff)
downloadchef-c4cf0bbf1836fb70b0dc3aaf2f5df0399f5633ee.tar.gz
Bug fix: updated_resource_count should only include updated resources
After adding up-to-date and skipped resources to the DataCollector resource list, the logic that computed the number of resources updated needed to change accordingly. This change fixes that bug and also eliminates an unnecessary counter that tracks the total number of resources.
Diffstat (limited to 'lib/chef/data_collector')
-rw-r--r--lib/chef/data_collector/messages.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/chef/data_collector/messages.rb b/lib/chef/data_collector/messages.rb
index b6114a8bec..e23262c9e4 100644
--- a/lib/chef/data_collector/messages.rb
+++ b/lib/chef/data_collector/messages.rb
@@ -70,15 +70,15 @@ class Chef
"message_type" => "run_converge",
"node_name" => run_status.node.name,
"organization_name" => organization,
- "resources" => reporter_data[:updated_resources].map(&:for_json),
+ "resources" => reporter_data[:completed_resources].map(&:for_json),
"run_id" => run_status.run_id,
"run_list" => run_status.node.run_list.for_json,
"start_time" => run_status.start_time.utc.iso8601,
"end_time" => run_status.end_time.utc.iso8601,
"source" => collector_source,
"status" => reporter_data[:status],
- "total_resource_count" => reporter_data[:total_resource_count],
- "updated_resource_count" => reporter_data[:updated_resources].count,
+ "total_resource_count" => reporter_data[:completed_resources].count,
+ "updated_resource_count" => reporter_data[:completed_resources].select { |r| r.status == "updated" }.count,
}
message["error"] = {