Sha256: 944d6728c08bf0e928413681e49262d2f50ce64d35a9cc705770179bffde2e5c

Contents?: true

Size: 1.05 KB

Versions: 15

Compression:

Stored size: 1.05 KB

Contents

namespace :katello do
  desc "Reset the Pulp 2 -> Pulp 3 migration for content types that haven't been fully switched over"
  task :pulp3_migration_reset => ["dynflow:client", "check_ping"] do
    puts "Starting Content Migration Reset."
    SmartProxy.pulp_primary.refresh

    task = ForemanTasks.async_task(Actions::Pulp3::ContentMigrationReset, SmartProxy.pulp_primary)

    if ENV['wait'].nil? || ::Foreman::Cast.to_bool(ENV['wait'])
      until !task.pending? || task.paused?
        sleep(20)
        task = ForemanTasks::Task.find(task.id)
      end

      if task.result == 'warning' || task.result == 'pending'
        msg = _("Content Migration Reset failed, You will want to investigate: https://#{Socket.gethostname}/foreman_tasks/tasks/#{task.id}\n")
        $stderr.print(msg)
        fail ForemanTasks::TaskError, task
      else
        puts _("Content Migration Reset completed successfully")
      end
    else
      puts "Content Migration Reset started, you may monitor it at: https://#{Socket.gethostname}/foreman_tasks/tasks/#{task.id}"
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
katello-4.0.3 lib/katello/tasks/pulp3_migration_reset.rake
katello-3.18.5 lib/katello/tasks/pulp3_migration_reset.rake
katello-4.0.2.1 lib/katello/tasks/pulp3_migration_reset.rake
katello-4.0.2 lib/katello/tasks/pulp3_migration_reset.rake
katello-3.18.4 lib/katello/tasks/pulp3_migration_reset.rake
katello-4.0.1.2 lib/katello/tasks/pulp3_migration_reset.rake
katello-3.18.3.1 lib/katello/tasks/pulp3_migration_reset.rake
katello-4.0.1.1 lib/katello/tasks/pulp3_migration_reset.rake
katello-3.18.3 lib/katello/tasks/pulp3_migration_reset.rake
katello-4.0.1 lib/katello/tasks/pulp3_migration_reset.rake
katello-4.0.0 lib/katello/tasks/pulp3_migration_reset.rake
katello-4.0.0.rc3.1 lib/katello/tasks/pulp3_migration_reset.rake
katello-4.0.0.rc3 lib/katello/tasks/pulp3_migration_reset.rake
katello-3.18.2.1 lib/katello/tasks/pulp3_migration_reset.rake
katello-3.18.2 lib/katello/tasks/pulp3_migration_reset.rake