summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2021-01-12 11:49:09 -0800
committerTim Smith <tsmith84@gmail.com>2021-01-12 11:49:09 -0800
commit4947e0d6b9f05bb0ef2f4fb3a9162892f1549f70 (patch)
treecf0bb3d489d56c7d725b530e8d3c0796589f6f5c
parent474bea9632c6863aa05bc3689f8d4d8d54e72c13 (diff)
downloadchef-fix_audit_detection.tar.gz
Fix audit cookbook detection in Compliance Phasefix_audit_detection
We have some simple logic right now to skip the Compliance Phase if the audit::default recipe is on the node. This doesn't work if the user adding the audit cookbook directly instead of the full path to the default recipe. Confirmed via Test Kitchen testing on the audit cookbook against 16.9 Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--lib/chef/compliance/runner.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/compliance/runner.rb b/lib/chef/compliance/runner.rb
index 86344367c2..87cda52992 100644
--- a/lib/chef/compliance/runner.rb
+++ b/lib/chef/compliance/runner.rb
@@ -16,7 +16,7 @@ class Chef
def_delegators :node, :logger
def enabled?
- audit_cookbook_present = recipes.include?("audit::default")
+ audit_cookbook_present = recipes.include?("audit::default") || recipes.include?("audit")
logger.info("#{self.class}##{__method__}: #{Inspec::Dist::PRODUCT_NAME} profiles? #{inspec_profiles.any?}")
logger.info("#{self.class}##{__method__}: audit cookbook? #{audit_cookbook_present}")