Class: Chef::Compliance::Reporter::AuditEnforcer

Inherits:
Object
  • Object
show all
Defined in:
lib/chef/compliance/reporter/compliance_enforcer.rb

Defined Under Namespace

Classes: ControlFailure

Instance Method Summary collapse

Instance Method Details

#send_report(report) ⇒ Object


7
8
9
10
11
12
13
14
15
16
# File 'lib/chef/compliance/reporter/compliance_enforcer.rb', line 7

def send_report(report)
  report.fetch(:profiles, []).each do |profile|
    profile.fetch(:controls, []).each do |control|
      control.fetch(:results, []).each do |result|
        raise ControlFailure, "Audit #{control[:id]} has failed. Aborting #{ChefUtils::Dist::Infra::CLIENT} run." if result[:status] == "failed"
      end
    end
  end
  true
end

#validate_config!Object


18
19
20
# File 'lib/chef/compliance/reporter/compliance_enforcer.rb', line 18

def validate_config!
  true
end