summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2021-08-24 17:00:12 -0700
committerTim Smith <tsmith84@gmail.com>2021-08-24 17:00:12 -0700
commitda6e027903f7e419580473b378057e2e2b36e5a3 (patch)
treef5aecc2d236eea714931963fa8e439972520cb43 /lib
parentab3db93121ee85f8d91ae2f687668064eb8f5a11 (diff)
downloadchef-da6e027903f7e419580473b378057e2e2b36e5a3.tar.gz
More updates to logging wordingmore_logging
Be more clean when infra phase starts and ends and what the compliance report is. Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/compliance/reporter/automate.rb2
-rw-r--r--lib/chef/compliance/runner.rb2
-rw-r--r--lib/chef/formatters/doc.rb10
-rw-r--r--lib/chef/formatters/minimal.rb6
4 files changed, 10 insertions, 10 deletions
diff --git a/lib/chef/compliance/reporter/automate.rb b/lib/chef/compliance/reporter/automate.rb
index c40631771d..4b4eb3c6e4 100644
--- a/lib/chef/compliance/reporter/automate.rb
+++ b/lib/chef/compliance/reporter/automate.rb
@@ -76,7 +76,7 @@ class Chef
begin
Chef::Log.info "Report to #{ChefUtils::Dist::Automate::PRODUCT}: #{@url}"
- Chef::Log.debug "Compliance Report: #{json_report}"
+ Chef::Log.debug "Compliance Phase report: #{json_report}"
http_client.post(nil, json_report, headers)
true
rescue => e
diff --git a/lib/chef/compliance/runner.rb b/lib/chef/compliance/runner.rb
index 14e776a6b7..b71f200941 100644
--- a/lib/chef/compliance/runner.rb
+++ b/lib/chef/compliance/runner.rb
@@ -180,7 +180,7 @@ class Chef
logger.info "Running profiles from: #{profiles.inspect}"
runner.run
runner.report.tap do |r|
- logger.debug "Compliance Report #{r}"
+ logger.debug "Compliance Phase report #{r}"
end
rescue Inspec::FetcherFailure => e
failed_report("Cannot fetch all profiles: #{profiles}. Please make sure you're authenticated and the server is reachable. #{e.message}")
diff --git a/lib/chef/formatters/doc.rb b/lib/chef/formatters/doc.rb
index c573bb0570..1b752a2924 100644
--- a/lib/chef/formatters/doc.rb
+++ b/lib/chef/formatters/doc.rb
@@ -44,7 +44,7 @@ class Chef
puts_line "#{ChefUtils::Dist::Infra::PRODUCT}, version #{version}"
puts_line "Patents: #{ChefUtils::Dist::Org::PATENTS}"
puts_line "OpenSSL FIPS 140 mode enabled" if Chef::Config[:fips]
- puts_line "Starting Infra Phase"
+ puts_line "Infra Phase starting"
puts_line "Targeting node: #{Chef::Config.target_mode.host}" if Chef::Config.target_mode?
end
@@ -80,18 +80,18 @@ class Chef
puts_line ""
end
if Chef::Config[:why_run]
- puts_line "#{ChefUtils::Dist::Infra::PRODUCT} finished, #{@updated_resources}/#{total_resources} resources would have been updated"
+ puts_line "Infra Phase complete, #{@updated_resources}/#{total_resources} resources would have been updated"
else
- puts_line "#{ChefUtils::Dist::Infra::PRODUCT} finished, #{@updated_resources}/#{total_resources} resources updated in #{pretty_elapsed_time}"
+ puts_line "Infra Phase complete, #{@updated_resources}/#{total_resources} resources updated in #{pretty_elapsed_time}"
end
end
def run_failed(exception)
@end_time = Time.now
if Chef::Config[:why_run]
- puts_line "#{ChefUtils::Dist::Infra::PRODUCT} failed. #{@updated_resources} resources would have been updated"
+ puts_line "Infra Phase failed. #{@updated_resources} resources would have been updated"
else
- puts_line "#{ChefUtils::Dist::Infra::PRODUCT} failed. #{@updated_resources} resources updated in #{pretty_elapsed_time}"
+ puts_line "Infra Phase failed. #{@updated_resources} resources updated in #{pretty_elapsed_time}"
end
end
diff --git a/lib/chef/formatters/minimal.rb b/lib/chef/formatters/minimal.rb
index b2d0d7f264..c4f506531e 100644
--- a/lib/chef/formatters/minimal.rb
+++ b/lib/chef/formatters/minimal.rb
@@ -31,18 +31,18 @@ class Chef
puts_line "#{ChefUtils::Dist::Infra::PRODUCT}, version #{version}"
puts_line "Patents: #{ChefUtils::Dist::Org::PATENTS}"
puts_line "OpenSSL FIPS 140 mode enabled" if Chef::Config[:fips]
- puts_line "Starting Infra Phase"
+ puts_line "Infra Phase starting"
puts_line "Targeting node: #{Chef::Config.target_mode.host}" if Chef::Config.target_mode?
end
# Called at the end of the Chef run.
def run_completed(node)
- puts "#{ChefUtils::Dist::Infra::PRODUCT} finished, #{@updated_resources.size} resources updated"
+ puts "Infra phase complete, #{@updated_resources.size} resources updated"
end
# called at the end of a failed run
def run_failed(exception)
- puts "#{ChefUtils::Dist::Infra::PRODUCT} failed. #{@updated_resources.size} resources updated"
+ puts "Infra phase failed. #{@updated_resources.size} resources updated"
end
# Called right after ohai runs.