summaryrefslogtreecommitdiff
path: root/lib/chef/client.rb
diff options
context:
space:
mode:
authortyler-ball <tyleraball@gmail.com>2014-12-03 16:58:14 -0800
committertyler-ball <tyleraball@gmail.com>2014-12-17 18:52:22 -0800
commit92f21502937682a3db715bf7c3a3b79e1bd784bc (patch)
tree30c3b07771c738553836611c20dceec0652cd358 /lib/chef/client.rb
parentd454a7214b2738acd9a00e1f29737927a4a4d5d7 (diff)
downloadchef-92f21502937682a3db715bf7c3a3b79e1bd784bc.tar.gz
if in why_run, do not enter the audit phase - because people run why_run to see converge statistics
Diffstat (limited to 'lib/chef/client.rb')
-rw-r--r--lib/chef/client.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/chef/client.rb b/lib/chef/client.rb
index 5d46794745..634773cf80 100644
--- a/lib/chef/client.rb
+++ b/lib/chef/client.rb
@@ -358,7 +358,9 @@ class Chef
Chef::Log.info("Starting audit phase")
auditor = Chef::Audit::Runner.new(run_context)
auditor.run
- raise Chef::Exceptions::AuditsFailed if auditor.failed_examples?
+ if auditor.failed?
+ raise Chef::Exceptions::AuditsFailed.new(auditor.num_failed, auditor.num_total)
+ end
@events.audit_phase_complete
rescue Exception => e
Chef::Log.error("Audit phase failed with error message: #{e.message}")
@@ -446,7 +448,10 @@ class Chef
converge_error = converge_and_save(run_context)
end
- if Chef::Config[:audit_mode] != :disabled
+ if Chef::Config[:why_run] == true
+ # why_run should probably be renamed to why_converge
+ Chef::Log.debug("Not running audits in 'why_run' mode - this mode is used to see potential converge changes")
+ elsif Chef::Config[:audit_mode] != :disabled
audit_error = run_audits(run_context)
end