Sha256: 739a3df3291690a0f568723c415f8856d4db68c59f2f73489ad0f6aeaa0d30df

Contents?: true

Size: 976 Bytes

Versions: 64

Compression:

Stored size: 976 Bytes

Contents

namespace :katello do
  desc "Migrate deb content attributes to Pulp3"
  task :migrate_deb_content_attributes_to_pulp3 => ["environment", "check_ping"] do
    User.current = User.anonymous_api_admin
    repos = Katello::Repository.deb_type.where(library_instance_id: nil)

    repos.find_each.with_index do |repo, index|
      puts "Processing Repository #{index + 1}/#{repos.count}: #{repo.name} (#{repo.id})"
      begin
        ForemanTasks.sync_task(::Actions::Katello::Repository::Update, repo.root,
                               download_policy: 'immediate',
                               deb_architectures: repo.root.deb_architectures&.gsub(',', ' '),
                               deb_releases: repo.root.deb_releases&.gsub(',', ' ') || 'stable',
                               deb_components: repo.root.deb_components&.gsub(',', ' '))
      rescue => e
        puts "Failed to update repository #{repo.name} (#{repo.id}): #{e.message}"
      end
    end
  end
end

Version data entries

64 entries across 64 versions & 1 rubygems

Version Path
katello-4.14.3 lib/katello/tasks/pulp2to3_migrate_deb_attributes.rake
katello-4.14.2 lib/katello/tasks/pulp2to3_migrate_deb_attributes.rake
katello-4.15.0 lib/katello/tasks/pulp2to3_migrate_deb_attributes.rake
katello-4.15.0.rc2 lib/katello/tasks/pulp2to3_migrate_deb_attributes.rake
katello-4.15.0.rc1 lib/katello/tasks/pulp2to3_migrate_deb_attributes.rake
katello-4.14.1 lib/katello/tasks/pulp2to3_migrate_deb_attributes.rake
katello-4.14.0 lib/katello/tasks/pulp2to3_migrate_deb_attributes.rake
katello-4.14.0.rc3 lib/katello/tasks/pulp2to3_migrate_deb_attributes.rake
katello-4.14.0.rc2 lib/katello/tasks/pulp2to3_migrate_deb_attributes.rake
katello-4.14.0.rc1.1 lib/katello/tasks/pulp2to3_migrate_deb_attributes.rake
katello-4.14.0.rc1 lib/katello/tasks/pulp2to3_migrate_deb_attributes.rake
katello-4.13.1 lib/katello/tasks/pulp2to3_migrate_deb_attributes.rake
katello-4.13.0 lib/katello/tasks/pulp2to3_migrate_deb_attributes.rake
katello-4.12.1 lib/katello/tasks/pulp2to3_migrate_deb_attributes.rake
katello-4.13.0.rc1 lib/katello/tasks/pulp2to3_migrate_deb_attributes.rake
katello-4.12.0 lib/katello/tasks/pulp2to3_migrate_deb_attributes.rake
katello-4.12.0.rc3 lib/katello/tasks/pulp2to3_migrate_deb_attributes.rake
katello-4.12.0.rc2 lib/katello/tasks/pulp2to3_migrate_deb_attributes.rake
katello-4.12.0.rc1 lib/katello/tasks/pulp2to3_migrate_deb_attributes.rake
katello-4.11.1 lib/katello/tasks/pulp2to3_migrate_deb_attributes.rake