From 38cafdffa7d7ab46944828d93b86aab6d6dfa078 Mon Sep 17 00:00:00 2001 From: "Eric D. Helms" Date: Tue, 12 Sep 2023 21:48:44 -0400 Subject: [PATCH] Drop checkpoint segments check --- .../foreman/check_checkpoint_segments.rb | 59 ------------------- .../scenarios/upgrade_to_capsule_6_15.rb | 1 - .../scenarios/upgrade_to_capsule_6_15_z.rb | 1 - .../scenarios/upgrade_to_satellite_6_15.rb | 1 - .../scenarios/upgrade_to_satellite_6_15_z.rb | 1 - 5 files changed, 63 deletions(-) delete mode 100644 definitions/checks/foreman/check_checkpoint_segments.rb diff --git a/definitions/checks/foreman/check_checkpoint_segments.rb b/definitions/checks/foreman/check_checkpoint_segments.rb deleted file mode 100644 index 5e732a4b9..000000000 --- a/definitions/checks/foreman/check_checkpoint_segments.rb +++ /dev/null @@ -1,59 +0,0 @@ -module Checks - module Foreman - class CheckpointSegments < ForemanMaintain::Check - metadata do - label :check_postgresql_checkpoint_segments - description 'Check if checkpoint_segments configuration exists on the system' - confine do - feature(:foreman) && feature(:installer) && - File.exist?(feature(:installer).custom_hiera_file) - end - end - - def run - failure_message = check_custom_hiera - fail! failure_message if failure_message - end - - # rubocop:disable Metrics/MethodLength - def check_custom_hiera - hiera_file = feature(:installer).custom_hiera_file - begin - config = YAML.load_file(hiera_file) - if config.is_a?(Hash) && config.key?('postgresql::server::config_entries') - if config['postgresql::server::config_entries'].nil? - return <<-MESSAGE.strip_heredoc - ERROR: 'postgresql::server::config_entries' cannot be null. - Please remove it from following file and re-run the command. - - #{hiera_file} - MESSAGE - elsif config['postgresql::server::config_entries'].key?('checkpoint_segments') - message = <<-MESSAGE.strip_heredoc - ERROR: Tuning option 'checkpoint_segments' found. - This option is no longer valid for PostgreSQL 9.5 or newer. - Please remove it from following file and re-run the command. - - #{hiera_file} - MESSAGE - if feature(:katello) - message += <<-MESSAGE.strip_heredoc - The presence of checkpoint_segments in #{hiera_file} indicates manual tuning. - Manual tuning can override values provided by the --tuning parameter. - Review #{hiera_file} for values that are already provided by the built in tuning profiles. - Built in tuning profiles also provide a supported upgrade path. - MESSAGE - end - return message - end - elsif config.is_a?(String) - fail! "Error: File #{hiera_file} is not a yaml file." - exit 1 - end - rescue Psych::SyntaxError - fail! "Found syntax error in file: #{hiera_file}" - exit 1 - end - end - # rubocop:enable Metrics/MethodLength - end - end -end diff --git a/definitions/scenarios/upgrade_to_capsule_6_15.rb b/definitions/scenarios/upgrade_to_capsule_6_15.rb index 3eeabc9e6..66bb9bd8b 100644 --- a/definitions/scenarios/upgrade_to_capsule_6_15.rb +++ b/definitions/scenarios/upgrade_to_capsule_6_15.rb @@ -27,7 +27,6 @@ class PreUpgradeCheck < Abstract def compose add_steps(find_checks(:default)) add_steps(find_checks(:pre_upgrade)) - add_step(Checks::Foreman::CheckpointSegments) add_step(Checks::Repositories::Validate.new(:version => '6.15')) end end diff --git a/definitions/scenarios/upgrade_to_capsule_6_15_z.rb b/definitions/scenarios/upgrade_to_capsule_6_15_z.rb index 98b60555d..47aa67e80 100644 --- a/definitions/scenarios/upgrade_to_capsule_6_15_z.rb +++ b/definitions/scenarios/upgrade_to_capsule_6_15_z.rb @@ -27,7 +27,6 @@ class PreUpgradeCheck < Abstract def compose add_steps(find_checks(:default)) add_steps(find_checks(:pre_upgrade)) - add_step(Checks::Foreman::CheckpointSegments) add_step(Checks::Repositories::Validate.new(:version => '6.15')) end end diff --git a/definitions/scenarios/upgrade_to_satellite_6_15.rb b/definitions/scenarios/upgrade_to_satellite_6_15.rb index ab05b5e62..513445a2d 100644 --- a/definitions/scenarios/upgrade_to_satellite_6_15.rb +++ b/definitions/scenarios/upgrade_to_satellite_6_15.rb @@ -27,7 +27,6 @@ class PreUpgradeCheck < Abstract def compose add_steps(find_checks(:default)) add_steps(find_checks(:pre_upgrade)) - add_step(Checks::Foreman::CheckpointSegments) add_step(Checks::Repositories::Validate.new(:version => '6.15')) end end diff --git a/definitions/scenarios/upgrade_to_satellite_6_15_z.rb b/definitions/scenarios/upgrade_to_satellite_6_15_z.rb index 4f6cbc8b8..bf4fcbb96 100644 --- a/definitions/scenarios/upgrade_to_satellite_6_15_z.rb +++ b/definitions/scenarios/upgrade_to_satellite_6_15_z.rb @@ -27,7 +27,6 @@ class PreUpgradeCheck < Abstract def compose add_steps(find_checks(:default)) add_steps(find_checks(:pre_upgrade)) - add_step(Checks::Foreman::CheckpointSegments) add_step(Checks::Repositories::Validate.new(:version => '6.15')) end end