Sha256: d1956ebbadf80a3e129fda5079eaff6e93fe8cbcab63a7e8a254bf527720066b

Contents?: true

Size: 1021 Bytes

Versions: 83

Compression:

Stored size: 1021 Bytes

Contents

module Actions
  module Pulp
    module Repository
      class CopyUnits < Pulp::AbstractAsyncTask
        def plan(source_repo, target_repo, units, options = {})
          if units.any?
            plan_self(source_repo_id: source_repo.id,
                      target_repo_id: target_repo.id,
                      class_name: units.first.class.name,
                      unit_ids: units.pluck(:id),
                      incremental_update: options[:incremental_update])
          end
        end

        def invoke_external_task
          source_repo = ::Katello::Repository.find(input[:source_repo_id])
          target_repo = ::Katello::Repository.find(input[:target_repo_id])
          units = input[:class_name].constantize.where(:id => input[:unit_ids])
          source_repo.backend_service(SmartProxy.pulp_primary).copy_units(target_repo, units,
                                                                          incremental_update: input[:incremental_update])
        end
      end
    end
  end
end

Version data entries

83 entries across 83 versions & 1 rubygems

Version Path
katello-4.7.6 app/lib/actions/pulp/repository/copy_units.rb
katello-4.7.5 app/lib/actions/pulp/repository/copy_units.rb
katello-4.7.4 app/lib/actions/pulp/repository/copy_units.rb
katello-4.7.3 app/lib/actions/pulp/repository/copy_units.rb
katello-4.7.2 app/lib/actions/pulp/repository/copy_units.rb
katello-4.7.1 app/lib/actions/pulp/repository/copy_units.rb
katello-4.6.2.1 app/lib/actions/pulp/repository/copy_units.rb
katello-4.6.2 app/lib/actions/pulp/repository/copy_units.rb
katello-4.7.0 app/lib/actions/pulp/repository/copy_units.rb
katello-4.6.1 app/lib/actions/pulp/repository/copy_units.rb
katello-4.7.0.rc2 app/lib/actions/pulp/repository/copy_units.rb
katello-4.7.0.rc1 app/lib/actions/pulp/repository/copy_units.rb
katello-4.4.2.2 app/lib/actions/pulp/repository/copy_units.rb
katello-4.4.2.1 app/lib/actions/pulp/repository/copy_units.rb
katello-4.4.2 app/lib/actions/pulp/repository/copy_units.rb
katello-4.5.1 app/lib/actions/pulp/repository/copy_units.rb
katello-4.6.0 app/lib/actions/pulp/repository/copy_units.rb
katello-4.6.0.rc2 app/lib/actions/pulp/repository/copy_units.rb
katello-4.6.0.rc1 app/lib/actions/pulp/repository/copy_units.rb
katello-4.5.0 app/lib/actions/pulp/repository/copy_units.rb