diff options
author | Eric Helgeson <erichelgeson@gmail.com> | 2016-06-09 17:08:41 -0500 |
---|---|---|
committer | Eric Helgeson <erichelgeson@gmail.com> | 2016-07-05 12:50:34 -0500 |
commit | 6c7dfa9e5178e26eee7b5ed97712490eb26888a7 (patch) | |
tree | afa13895a421717b36eb9d6b0d4e3001bc30c1c0 | |
parent | 5753744cda2039c081840348b1786584a6bafaf2 (diff) | |
download | chef-6c7dfa9e5178e26eee7b5ed97712490eb26888a7.tar.gz |
Don't show error message when we cant post the audit report while running in chef-zero.
Instead log location of audit report.
Fixes #4728
-rw-r--r-- | lib/chef/audit/audit_reporter.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/chef/audit/audit_reporter.rb b/lib/chef/audit/audit_reporter.rb index a40cae93dd..8546a21bb4 100644 --- a/lib/chef/audit/audit_reporter.rb +++ b/lib/chef/audit/audit_reporter.rb @@ -140,7 +140,11 @@ class Chef # Save the audit report to local disk error_file = "failed-audit-data.json" Chef::FileCache.store(error_file, Chef::JSONCompat.to_json_pretty(run_data), 0640) - Chef::Log.error("Failed to post audit report to server. Saving report to #{Chef::FileCache.load(error_file, false)}") + if Chef::Config.chef_zero.enabled + Chef::Log.debug("Saving audit report to #{Chef::FileCache.load(error_file, false)}") + else + Chef::Log.error("Failed to post audit report to server. Saving report to #{Chef::FileCache.load(error_file, false)}") + end end else Chef::Log.error("Failed to post audit report to server (#{e})") |