From da6e027903f7e419580473b378057e2e2b36e5a3 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Tue, 24 Aug 2021 17:00:12 -0700 Subject: More updates to logging wording Be more clean when infra phase starts and ends and what the compliance report is. Signed-off-by: Tim Smith --- lib/chef/compliance/reporter/automate.rb | 2 +- lib/chef/compliance/runner.rb | 2 +- lib/chef/formatters/doc.rb | 10 +++++----- lib/chef/formatters/minimal.rb | 6 +++--- 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. -- cgit v1.2.1