summaryrefslogtreecommitdiff
path: root/lib/chef/resource_reporter.rb
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2021-10-22 14:03:16 -0700
committerTim Smith <tsmith84@gmail.com>2021-10-27 12:38:25 -0700
commit4600606675d223f82a763ffd6f2df01e68c54f3f (patch)
tree87dbd9eb3ab566d078214f0db5326e1f22fb8cc7 /lib/chef/resource_reporter.rb
parentd61840ae9c1d0e089e927b2761242bdf219e61cc (diff)
downloadchef-reporting.tar.gz
Fix reporting/data_collector for @recipe_filesreporting
When individual recipes are invoked like 'chef-client ./whatever.rb' those files get a cookbook_name of `@recipe_files` which is a magic value that nees to be handled specially to avoid the reporting classes from blowing up. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef/resource_reporter.rb')
-rw-r--r--lib/chef/resource_reporter.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/resource_reporter.rb b/lib/chef/resource_reporter.rb
index 4051ac2f49..5fb3d4eba4 100644
--- a/lib/chef/resource_reporter.rb
+++ b/lib/chef/resource_reporter.rb
@@ -41,7 +41,7 @@ class Chef
as_hash["result"] = action_record.action.to_s
if new_resource.cookbook_name
as_hash["cookbook_name"] = new_resource.cookbook_name
- as_hash["cookbook_version"] = new_resource.cookbook_version.version
+ as_hash["cookbook_version"] = new_resource.cookbook_version&.version
end
as_hash