summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortyler-ball <tyleraball@gmail.com>2014-12-29 15:13:51 -0800
committertyler-ball <tyleraball@gmail.com>2014-12-29 15:13:51 -0800
commitc1676b32aa08b618f4c2317676f5590388b3bc53 (patch)
treed049236793b5ce8ade14f594218eac917ed31291
parent43eba1778fab8bc440f97824af7227476457a65c (diff)
downloadchef-c1676b32aa08b618f4c2317676f5590388b3bc53.tar.gz
Updating for review comments
-rw-r--r--DOC_CHANGES.md10
-rw-r--r--lib/chef/audit/audit_reporter.rb4
-rw-r--r--lib/chef/version.rb2
-rw-r--r--spec/support/audit_helper.rb2
4 files changed, 10 insertions, 8 deletions
diff --git a/DOC_CHANGES.md b/DOC_CHANGES.md
index 0c82661f34..7429baca2a 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 596b06b285..a5dd9a6c48 100644
--- a/lib/chef/audit/audit_reporter.rb
+++ b/lib/chef/audit/audit_reporter.rb
@@ -127,11 +127,9 @@ class Chef
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 30c3394c2c..a8fc002399 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 70e36f1ad2..8fd3f4d719 100644
--- a/spec/support/audit_helper.rb
+++ b/spec/support/audit_helper.rb
@@ -22,6 +22,8 @@ class NullObject
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