Sha256: b313ffc29c0836bb4974af06662eea802514b43cd44ac7cc0e640c3c098fa517

Contents?: true

Size: 1020 Bytes

Versions: 31

Compression:

Stored size: 1020 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_master).copy_units(target_repo, units,
                                                                          incremental_update: input[:incremental_update])
        end
      end
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
katello-3.16.2 app/lib/actions/pulp/repository/copy_units.rb
katello-3.16.1.2 app/lib/actions/pulp/repository/copy_units.rb
katello-3.16.1.1 app/lib/actions/pulp/repository/copy_units.rb
katello-3.16.1 app/lib/actions/pulp/repository/copy_units.rb
katello-3.17.0.rc1 app/lib/actions/pulp/repository/copy_units.rb
katello-3.16.0 app/lib/actions/pulp/repository/copy_units.rb
katello-3.16.0.rc5.1 app/lib/actions/pulp/repository/copy_units.rb
katello-3.16.0.rc5 app/lib/actions/pulp/repository/copy_units.rb
katello-3.16.0.rc4.1 app/lib/actions/pulp/repository/copy_units.rb
katello-3.15.3.1 app/lib/actions/pulp/repository/copy_units.rb
katello-3.15.3 app/lib/actions/pulp/repository/copy_units.rb
katello-3.16.0.rc4 app/lib/actions/pulp/repository/copy_units.rb
katello-3.16.0.rc3.1 app/lib/actions/pulp/repository/copy_units.rb
katello-3.15.2 app/lib/actions/pulp/repository/copy_units.rb
katello-3.16.0.rc3 app/lib/actions/pulp/repository/copy_units.rb
katello-3.16.0.rc2.1 app/lib/actions/pulp/repository/copy_units.rb
katello-3.16.0.rc2 app/lib/actions/pulp/repository/copy_units.rb
katello-3.15.1.1 app/lib/actions/pulp/repository/copy_units.rb
katello-3.16.0.rc1.1 app/lib/actions/pulp/repository/copy_units.rb
katello-3.15.1 app/lib/actions/pulp/repository/copy_units.rb