diff options
author | Claire McQuin <claire@getchef.com> | 2014-11-14 12:36:54 -0800 |
---|---|---|
committer | tyler-ball <tyleraball@gmail.com> | 2014-12-17 18:52:02 -0800 |
commit | 7027bb8a8782f934a3239ee45e98fb7fc18d99bc (patch) | |
tree | e380b968dba3bccba98e947ddfa6cf121c926a2e /lib/chef/client.rb | |
parent | 772232776ed10465708d1ddab7c7238a199f6199 (diff) | |
download | chef-7027bb8a8782f934a3239ee45e98fb7fc18d99bc.tar.gz |
Add a Chef::Audit::Controls object for 'controls'
Diffstat (limited to 'lib/chef/client.rb')
-rw-r--r-- | lib/chef/client.rb | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/chef/client.rb b/lib/chef/client.rb index 16315b8e08..c7ddded1ff 100644 --- a/lib/chef/client.rb +++ b/lib/chef/client.rb @@ -330,6 +330,7 @@ class Chef runner.converge @events.converge_complete rescue Exception => e + Chef::Log.error("Converge failed with error message #{e.message}") @events.converge_failed(e) converge_exception = e end @@ -354,10 +355,12 @@ class Chef audit_exception = nil begin @events.audit_phase_start(run_status) + Chef::Log.info("Starting audit phase") auditor = Chef::Audit::Runner.new(run_context) auditor.run @events.audit_phase_complete rescue Exception => e + Chef::Log.error("Audit phase failed with error message #{e.message}") @events.audit_phase_failed(e) audit_exception = e end @@ -438,8 +441,17 @@ class Chef run_context = setup_run_context - converge_error = converge_and_save(run_context) - audit_error = run_audits(run_context) + unless Chef::Config[:audit_mode] == true + converge_error = converge_and_save(run_context) + else + Chef::Log.debug("Skipping converge. Chef is configured to run audits only.") + end + + unless Chef::Config[:audit_mode] == false + audit_error = run_audits(run_context) + else + Chef::Log.debug("Skipping audits. Chef is configured to converge the node only.") + end if converge_error || audit_error e = Chef::Exceptions::RunFailedWrappingError.new(converge_error, audit_error) |