diff options
author | Vivek Singh <vivek.singh@msystechnologies.com> | 2019-09-18 10:24:37 +0530 |
---|---|---|
committer | Vivek Singh <vivek.singh@msystechnologies.com> | 2019-10-17 23:20:24 +0530 |
commit | 53a48e49f0a8e474a287698dc93ce9727358b467 (patch) | |
tree | 9c22769df2bc32ee4938a048dce8a3e13438f0da | |
parent | 0b3c7093d2a5b2e81aaab568bc55f122124cfb04 (diff) | |
download | chef-53a48e49f0a8e474a287698dc93ce9727358b467.tar.gz |
Access hash directly instead of Hash#fetch
- Rename "expanded_cookbooks" to "cookbooks".
Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
-rw-r--r-- | lib/chef/data_collector/run_end_message.rb | 2 | ||||
-rw-r--r-- | spec/unit/data_collector_spec.rb | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/chef/data_collector/run_end_message.rb b/lib/chef/data_collector/run_end_message.rb index 5c23224678..762058bfdb 100644 --- a/lib/chef/data_collector/run_end_message.rb +++ b/lib/chef/data_collector/run_end_message.rb @@ -57,7 +57,7 @@ class Chef "resources" => all_action_records(action_collection), "run_id" => run_status&.run_id, "run_list" => node&.run_list&.for_json || [], - "expanded_cookbooks" => node&.fetch("cookbooks", {}) || {}, + "cookbooks" => ( node && node["cookbooks"] ) || {}, "policy_name" => node&.policy_name, "policy_group" => node&.policy_group, "start_time" => run_status.start_time.utc.iso8601, diff --git a/spec/unit/data_collector_spec.rb b/spec/unit/data_collector_spec.rb index 28d677aa6a..5eeeec1498 100644 --- a/spec/unit/data_collector_spec.rb +++ b/spec/unit/data_collector_spec.rb @@ -46,7 +46,7 @@ describe Chef::DataCollector do let(:run_list) { node.run_list } - let(:expanded_cookbooks) { node.fetch("cookbooks", {}) } + let(:cookbooks) { node.fetch("cookbooks", {}) } let(:run_id) { run_status.run_id } @@ -214,7 +214,7 @@ describe Chef::DataCollector do end it "has a cookbooks" do - expect_converge_message("expanded_cookbooks" => expanded_cookbooks) + expect_converge_message("cookbooks" => cookbooks) send_run_failed_or_completed_event end |