diff options
-rw-r--r-- | lib/chef/audit/runner.rb | 11 | ||||
-rw-r--r-- | spec/unit/audit/runner_spec.rb | 18 |
2 files changed, 1 insertions, 28 deletions
diff --git a/lib/chef/audit/runner.rb b/lib/chef/audit/runner.rb index 75a8f9a7ca..9dbf6b2a70 100644 --- a/lib/chef/audit/runner.rb +++ b/lib/chef/audit/runner.rb @@ -61,15 +61,6 @@ class Chef end def inspec_opts - waivers = Array(audit_attributes["waiver_file"]).select do |file| - if File.exist?(file) - true - else - logger.error "The specified InSpec waiver file #{file} is missing, skipping it..." - false - end - end - { backend_cache: audit_attributes["inspec_backend_cache"], inputs: audit_attributes["attributes"], @@ -79,7 +70,7 @@ class Chef reporter: ["json-automate"], reporter_backtrace_inclusion: audit_attributes["result_include_backtrace"], reporter_message_truncation: audit_attributes["result_message_limit"], - waiver_file: waivers, + waiver_file: Array(audit_attributes["waiver_file"]), } end diff --git a/spec/unit/audit/runner_spec.rb b/spec/unit/audit/runner_spec.rb index 76326dfbe0..ee2da2a812 100644 --- a/spec/unit/audit/runner_spec.rb +++ b/spec/unit/audit/runner_spec.rb @@ -55,22 +55,4 @@ describe Chef::Audit::Runner do expect(runner).not_to be_enabled end end - - describe "#inspec_opts" do - it "accepts a string as a waiver file" do - node.default["audit"][:waiver_file] = __FILE__ - - expect(logger).not_to receive(:error) - - expect(runner.inspec_opts[:waiver_file]).to eq([__FILE__]) - end - - it "filters out non-existant waiver files" do - node.default["audit"][:waiver_file] = [__FILE__, "some_other_file"] - - expect(logger).to receive(:error).with(/some_other_file is missing/) - - expect(runner.inspec_opts[:waiver_file]).to eq([__FILE__]) - end - end end |