Skip to content

Instantly share code, notes, and snippets.

@jturel
Created March 9, 2021 16:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jturel/2941122e4025cefe3b5aeac1b6ec9cc9 to your computer and use it in GitHub Desktop.
Save jturel/2941122e4025cefe3b5aeac1b6ec9cc9 to your computer and use it in GitHub Desktop.
diff --git a/lib/katello/tasks/pulp3_migration.rake b/lib/katello/tasks/pulp3_migration.rake
index 2106b38..d5645b9 100644
--- a/lib/katello/tasks/pulp3_migration.rake
+++ b/lib/katello/tasks/pulp3_migration.rake
@@ -1,6 +1,9 @@
namespace :katello do
desc "Runs a Pulp 2 to 3 Content Migration for supported types. May be run multiple times. Use wait=false to immediately return with a task url."
- task :pulp3_migration => ["dynflow:client", "check_ping"] do
+ task :pulp3_migration => ["dynflow:client"] do
+ Thread.current[:check_ping_services] = [:candlepin, :foreman_tasks, :pulp3, :pulp, :pulp_auth]
+ Rake.application.invoke_task('katello:check_ping')
+
puts "Starting task."
SmartProxy.pulp_primary.refresh
diff --git a/lib/katello/tasks/reimport.rake b/lib/katello/tasks/reimport.rake
index 556d6bf..78af7d5 100644
--- a/lib/katello/tasks/reimport.rake
+++ b/lib/katello/tasks/reimport.rake
@@ -4,7 +4,11 @@ namespace :katello do
desc "Runs a katello ping and prints out the statuses of each service"
task :check_ping => [:environment, "dynflow:client"] do
::User.current = ::User.anonymous_admin
- ping_results = Katello::Ping.ping
+ ping_results = if Thread.current[:check_ping_services]
+ Katello::Ping.ping(services: Thread.current[:check_ping_services])
+ else
+ Katello::Ping.ping
+ end
if ping_results[:status] != "ok"
pp ping_results
fail("Not all the services have been started. Check the status report above and try again.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment