Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop Candlepin database validation #747

Merged
merged 1 commit into from
Jul 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions definitions/checks/candlepin/validate_db.rb

This file was deleted.

22 changes: 0 additions & 22 deletions definitions/features/candlepin_database.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,12 @@ def configuration
@configuration || load_configuration
end

def validate_available_in_cpdb?
check_option_using_cpdb_help('validate')
end

def check_option_using_cpdb_help(option_name, parent_cmd = '')
parent_cmd = '/usr/share/candlepin/cpdb' if parent_cmd.empty?
help_cmd = "#{parent_cmd} --help | grep -c '\\-\\-#{option_name}'"
execute?(help_cmd)
end

def execute_cpdb_validate_cmd
main_cmd = cpdb_validate_cmd
return [true, nil] if main_cmd.empty?
main_cmd += format_shell_args(
'-u' => configuration['username'], '-p' => configuration[%(password)]
)
main_cmd += format_shell_args(extend_with_db_options)
execute_with_status(main_cmd, :hidden_patterns => [configuration['password']])
end

def env_content_ids_with_null_content
sql = <<-SQL
SELECT ec.id
Expand Down Expand Up @@ -87,12 +73,4 @@ def fetch_extra_param(url, key_name)
output = /#{key_name}=([^&]*)?/.match(query_string)
output[1] if output
end

def cpdb_validate_cmd
return '' unless check_option_using_cpdb_help('validate')
cmd = '/usr/share/candlepin/cpdb --validate'
return cmd unless check_option_using_cpdb_help('verbose', cmd)
cmd += ' --verbose'
cmd
end
end
Loading