From 6c7dfa9e5178e26eee7b5ed97712490eb26888a7 Mon Sep 17 00:00:00 2001 From: Eric Helgeson Date: Thu, 9 Jun 2016 17:08:41 -0500 Subject: 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 --- lib/chef/audit/audit_reporter.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/chef/audit') 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})") -- cgit v1.2.1