diff --git a/DOC_CHANGES.md b/DOC_CHANGES.md index 0c82661f34b..7429baca2ad 100644 --- a/DOC_CHANGES.md +++ b/DOC_CHANGES.md @@ -14,10 +14,12 @@ Previously, when a URI scheme contained all uppercase letters, Chef would reject There is a new command_line flag provided for `chef-client`: `--audit-mode`. This accepts 1 of 3 arguments: -* disabled (default) - Audits are disabled and the phase is skipped. This is the default while Audit mode is an +* `disabled` (default) - Audits are disabled and the phase is skipped. This is the default while Audit mode is an experimental feature. -* enabled - Audits are enabled and will be performed after the converge phase. -* audit_only - Audits are enabled and convergence is disabled. Only audits will be performed. +* `enabled` - Audits are enabled and will be performed after the converge phase. +* `audit-only` - Audits are enabled and convergence is disabled. Only audits will be performed. + +This can also be configured in your node's client.rb with the key `audit_mode` and a value of `:disabled`, `:enabled` or `:audit_only`. ### Chef Why Run Mode Ignores Audit Phase @@ -32,4 +34,4 @@ The `--audit-mode` flag should be a link to the documentation for that flag #### Editors node 2 This probably only needs to be a bullet point added to http://docs.getchef.com/nodes.html#about-why-run-mode under the -`certain assumptions` section \ No newline at end of file +`certain assumptions` section diff --git a/lib/chef/audit/audit_reporter.rb b/lib/chef/audit/audit_reporter.rb index 596b06b285d..a5dd9a6c48c 100644 --- a/lib/chef/audit/audit_reporter.rb +++ b/lib/chef/audit/audit_reporter.rb @@ -127,11 +127,9 @@ def post_auditing_data(error = nil) rest_client.post(audit_url, run_data, headers) rescue StandardError => e if e.respond_to? :response - code = e.response.code.nil? ? "Exception Code Empty" : e.response.code - # 404 error code is OK. This means the version of server we're running against doesn't support # audit reporting. Don't alarm failure in this case. - if code == "404" + if e.response.code == "404" Chef::Log.debug("Server doesn't support audit reporting. Skipping report.") return else diff --git a/lib/chef/version.rb b/lib/chef/version.rb index 30c3394c2cd..a8fc0023997 100644 --- a/lib/chef/version.rb +++ b/lib/chef/version.rb @@ -17,7 +17,7 @@ class Chef CHEF_ROOT = File.dirname(File.expand_path(File.dirname(__FILE__))) - VERSION = '12.2.0.alpha.0' + VERSION = '12.1.0.dev.0' end # diff --git a/spec/support/audit_helper.rb b/spec/support/audit_helper.rb index 70e36f1ad24..8fd3f4d7196 100644 --- a/spec/support/audit_helper.rb +++ b/spec/support/audit_helper.rb @@ -22,6 +22,8 @@ def method_missing(method, *args, &block) end end +# TODO remove this when RSPec exposes this functionality publically +# https://github.com/rspec/rspec-core/pull/1808 module Sandboxing def self.sandboxed(&block) orig_load_path = $LOAD_PATH.dup