Sha256: fe6206c99f6d54ef234f3069486012d0e64ccae08cc2052ba81998a5908f09f7

Contents?: true

Size: 1.49 KB

Versions: 129

Compression:

Stored size: 1.49 KB

Contents

module Actions
  module Pulp3
    module Orchestration
      module Repository
        class MultiCopyAllUnits < Pulp3::Abstract
          def plan(extended_repo_map, smart_proxy, options = {})
            solve_dependencies = options.fetch(:solve_dependencies, false)
            if extended_repo_map.values.pluck(:filters).flatten.present? ||
                extended_repo_map.keys.detect { |source_repos| source_repos.length > 1 }
              sequence do
                copy_action = plan_action(Actions::Pulp3::Repository::MultiCopyContent, extended_repo_map, smart_proxy,
                                          solve_dependencies: solve_dependencies)
                plan_action(Actions::Pulp3::Repository::SaveVersions, extended_repo_map.values.pluck(:dest_repo),
                            tasks: copy_action.output[:pulp_tasks])
              end
            else
              repo_id_map = {}
              extended_repo_map.each do |source_repos, dest_repo_map|
                repo_id_map[source_repos.first.id] = dest_repo_map[:dest_repo].id
              end
              plan_self(repo_id_map: repo_id_map)
            end
          end

          def run
            input[:repo_id_map].each do |source_repo_id, dest_repo_id|
              dest_repo = ::Katello::Repository.find(dest_repo_id)
              source_repo = ::Katello::Repository.find(source_repo_id)
              dest_repo.update!(version_href: source_repo.version_href)
            end
          end
        end
      end
    end
  end
end

Version data entries

129 entries across 129 versions & 1 rubygems

Version Path
katello-4.8.0.rc2 app/lib/actions/pulp3/orchestration/repository/multi_copy_all_units.rb
katello-4.7.4 app/lib/actions/pulp3/orchestration/repository/multi_copy_all_units.rb
katello-4.8.0.rc1 app/lib/actions/pulp3/orchestration/repository/multi_copy_all_units.rb
katello-4.7.3 app/lib/actions/pulp3/orchestration/repository/multi_copy_all_units.rb
katello-4.7.2 app/lib/actions/pulp3/orchestration/repository/multi_copy_all_units.rb
katello-4.7.1 app/lib/actions/pulp3/orchestration/repository/multi_copy_all_units.rb
katello-4.6.2.1 app/lib/actions/pulp3/orchestration/repository/multi_copy_all_units.rb
katello-4.6.2 app/lib/actions/pulp3/orchestration/repository/multi_copy_all_units.rb
katello-4.7.0 app/lib/actions/pulp3/orchestration/repository/multi_copy_all_units.rb
katello-4.6.1 app/lib/actions/pulp3/orchestration/repository/multi_copy_all_units.rb
katello-4.7.0.rc2 app/lib/actions/pulp3/orchestration/repository/multi_copy_all_units.rb
katello-4.7.0.rc1 app/lib/actions/pulp3/orchestration/repository/multi_copy_all_units.rb
katello-4.4.2.2 app/lib/actions/pulp3/orchestration/repository/multi_copy_all_units.rb
katello-4.4.2.1 app/lib/actions/pulp3/orchestration/repository/multi_copy_all_units.rb
katello-4.4.2 app/lib/actions/pulp3/orchestration/repository/multi_copy_all_units.rb
katello-4.5.1 app/lib/actions/pulp3/orchestration/repository/multi_copy_all_units.rb
katello-4.6.0 app/lib/actions/pulp3/orchestration/repository/multi_copy_all_units.rb
katello-4.6.0.rc2 app/lib/actions/pulp3/orchestration/repository/multi_copy_all_units.rb
katello-4.6.0.rc1 app/lib/actions/pulp3/orchestration/repository/multi_copy_all_units.rb
katello-4.5.0 app/lib/actions/pulp3/orchestration/repository/multi_copy_all_units.rb