summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThom May <thom@may.lt>2016-08-02 18:57:13 +0100
committerGitHub <noreply@github.com>2016-08-02 18:57:13 +0100
commit242b4761e48346fe07d11b51d77da3164e77b715 (patch)
tree16ab4941aba0b731ff347e146b12c28244f12d72
parent0eefe6c585a6efd0eaf633c720b6abce711adedf (diff)
parent6c7dfa9e5178e26eee7b5ed97712490eb26888a7 (diff)
downloadchef-242b4761e48346fe07d11b51d77da3164e77b715.tar.gz
Merge pull request #5016 from erichelgeson/dontErrorInZero
Don't log error for reporting audit data in when in chef-zero
-rw-r--r--lib/chef/audit/audit_reporter.rb6
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})")