diff options
author | Thom May <thom@may.lt> | 2016-08-02 18:57:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-02 18:57:13 +0100 |
commit | 242b4761e48346fe07d11b51d77da3164e77b715 (patch) | |
tree | 16ab4941aba0b731ff347e146b12c28244f12d72 /lib | |
parent | 0eefe6c585a6efd0eaf633c720b6abce711adedf (diff) | |
parent | 6c7dfa9e5178e26eee7b5ed97712490eb26888a7 (diff) | |
download | chef-242b4761e48346fe07d11b51d77da3164e77b715.tar.gz |
Merge pull request #5016 from erichelgeson/dontErrorInZero
Don't log error for reporting audit data in when in chef-zero
Diffstat (limited to 'lib')
-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})") |