6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'app/lib/actions/pulp3/orchestration/repository/multi_copy_all_units.rb', line 6
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
|