Skip to content

Commit

Permalink
Updating for review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
tyler-ball committed Dec 29, 2014
1 parent 43eba17 commit c1676b3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
10 changes: 6 additions & 4 deletions DOC_CHANGES.md
Expand Up @@ -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

Expand All @@ -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
`certain assumptions` section
4 changes: 1 addition & 3 deletions lib/chef/audit/audit_reporter.rb
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/chef/version.rb
Expand Up @@ -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

#
Expand Down
2 changes: 2 additions & 0 deletions spec/support/audit_helper.rb
Expand Up @@ -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
Expand Down

0 comments on commit c1676b3

Please sign in to comment.