Sha256: 3d1382d6ec35a1f3a1cb164e1535e5b010e6d074b89a6f1b47eb54aa5729c915

Contents?: true

Size: 1 KB

Versions: 49

Compression:

Stored size: 1 KB

Contents

module Actions
  module Pulp3
    module Repository
      class MultiCopyContent < Pulp3::AbstractAsyncTask
        def plan(extended_repo_map, smart_proxy, options)
          repo_id_map = {}

          extended_repo_map.each do |source_repos, dest_repo_map|
            repo_id_map[source_repos&.map(&:id)] = { :dest_repo => dest_repo_map[:dest_repo].id,
                                                     :filter_ids => dest_repo_map[:filters]&.map(&:id) }
          end

          plan_self(options.merge(:repo_id_map => repo_id_map, :smart_proxy_id => smart_proxy.id))
        end

        def invoke_external_task
          repo_id_map = {}

          input[:repo_id_map].each do |source_repo_ids, dest_repo_map|
            repo_id_map[JSON.parse(source_repo_ids)] = dest_repo_map.deep_dup
          end

          output[:pulp_tasks] = ::Katello::Repository.find(repo_id_map.values.first[:dest_repo]).backend_service(smart_proxy).copy_content_from_mapping(repo_id_map, input)
        end
      end
    end
  end
end

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
katello-4.2.2 app/lib/actions/pulp3/repository/multi_copy_content.rb
katello-4.2.1 app/lib/actions/pulp3/repository/multi_copy_content.rb
katello-4.2.0.1 app/lib/actions/pulp3/repository/multi_copy_content.rb
katello-4.1.4 app/lib/actions/pulp3/repository/multi_copy_content.rb
katello-4.0.3 app/lib/actions/pulp3/repository/multi_copy_content.rb
katello-4.2.0.1.rc3 app/lib/actions/pulp3/repository/multi_copy_content.rb
katello-3.18.5 app/lib/actions/pulp3/repository/multi_copy_content.rb
katello-4.2.0.1.rc2 app/lib/actions/pulp3/repository/multi_copy_content.rb
katello-4.2.0.rc2 app/lib/actions/pulp3/repository/multi_copy_content.rb
katello-4.1.3 app/lib/actions/pulp3/repository/multi_copy_content.rb
katello-4.2.0.rc1 app/lib/actions/pulp3/repository/multi_copy_content.rb
katello-4.0.2.1 app/lib/actions/pulp3/repository/multi_copy_content.rb
katello-4.1.2.1 app/lib/actions/pulp3/repository/multi_copy_content.rb
katello-4.0.2 app/lib/actions/pulp3/repository/multi_copy_content.rb
katello-4.1.2 app/lib/actions/pulp3/repository/multi_copy_content.rb
katello-3.18.4 app/lib/actions/pulp3/repository/multi_copy_content.rb
katello-4.1.1 app/lib/actions/pulp3/repository/multi_copy_content.rb
katello-4.1.0 app/lib/actions/pulp3/repository/multi_copy_content.rb
katello-4.0.1.2 app/lib/actions/pulp3/repository/multi_copy_content.rb
katello-3.18.3.1 app/lib/actions/pulp3/repository/multi_copy_content.rb