From 772232776ed10465708d1ddab7c7238a199f6199 Mon Sep 17 00:00:00 2001 From: tyler-ball Date: Fri, 31 Oct 2014 15:05:10 -0700 Subject: Adding audit mode JSON formatter First pass at DSL additions Renaming DSL methods to match the spec Creating our own example group class to simplify adding examples to the spec runner Adding logic for exceptions from converge phase not interfering with audit phase and vice-versa Adding error handling so saving node doesn't prevent us from running audit mode - decouples converge phase and audit phase more Updating for github comments Add setup phase to audit-mode. Refactor runner into own class. Fix typo tie things together Adding first round of formatter integration - STDOUT doc formatter Preparing for demo - using rspec documentation formatter for output instead of the proxy Add serverspec types and matchers. add rspec/its Add gems as core dependencies Updating with changes from demo Updating with @mcquin and @lamont comments Getting rid of unused method Wiring audit event proxy to send events correctly to the audit_reporter removing old pry debugging statement Removing unecessary todo Sending to correct server URL Fixing TODOs Adding uncaught error information --- lib/chef/client.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'lib/chef/client.rb') diff --git a/lib/chef/client.rb b/lib/chef/client.rb index b27a2b693d..16315b8e08 100644 --- a/lib/chef/client.rb +++ b/lib/chef/client.rb @@ -330,7 +330,6 @@ 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 @@ -355,12 +354,10 @@ 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 @@ -441,8 +438,8 @@ class Chef run_context = setup_run_context - converge_error = converge_and_save(run_context) unless (Chef::Config[:audit_mode] == true) - audit_error = run_audits(run_context) unless (Chef::Config[:audit_mode] == false) + converge_error = converge_and_save(run_context) + audit_error = run_audits(run_context) if converge_error || audit_error e = Chef::Exceptions::RunFailedWrappingError.new(converge_error, audit_error) -- cgit v1.2.1