summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2021-04-23 08:40:05 -0700
committerGitHub <noreply@github.com>2021-04-23 08:40:05 -0700
commit5fcbb91715f8ee998f96edc6818b38b739fc020a (patch)
tree118f9b7f9a12165efd8b2013c0f4ece476e7811c
parent22dc63b40744e879edf13ef40cf6362f57e7a158 (diff)
parentd45e26c4212b04e1ca05f9d766f00305616ce3cb (diff)
downloadchef-5fcbb91715f8ee998f96edc6818b38b739fc020a.tar.gz
Merge pull request #11442 from chef/mp/show-json-file-report-path
Make json-file compliance report path visible
-rw-r--r--lib/chef/compliance/reporter/json_file.rb3
-rw-r--r--lib/chef/compliance/runner.rb1
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/chef/compliance/reporter/json_file.rb b/lib/chef/compliance/reporter/json_file.rb
index ecd2e77b55..69091e3c7b 100644
--- a/lib/chef/compliance/reporter/json_file.rb
+++ b/lib/chef/compliance/reporter/json_file.rb
@@ -1,4 +1,5 @@
require_relative "../../json_compat"
+require_relative "../../log"
class Chef
module Compliance
@@ -9,8 +10,8 @@ class Chef
end
def send_report(report)
+ Chef::Log.info "Writing compliance report to #{@path}"
FileUtils.mkdir_p(File.dirname(@path), mode: 0700)
-
File.write(@path, Chef::JSONCompat.to_json(report))
end
diff --git a/lib/chef/compliance/runner.rb b/lib/chef/compliance/runner.rb
index 68b40ce35b..6bc134d08e 100644
--- a/lib/chef/compliance/runner.rb
+++ b/lib/chef/compliance/runner.rb
@@ -249,7 +249,6 @@ class Chef
when "json-file"
require_relative "reporter/json_file"
path = node.dig("audit", "json_file", "location")
- logger.info "Writing compliance report to #{path}"
Chef::Compliance::Reporter::JsonFile.new(file: path)
when "audit-enforcer"
require_relative "reporter/compliance_enforcer"