Sha256: 06807d80e9c6622291bc503b61983b41b8bbea213c15db198a3bacc8b9d75849

Contents?: true

Size: 1.24 KB

Versions: 50

Compression:

Stored size: 1.24 KB

Contents

module Actions
  module Katello
    module Repository
      class MultiCloneToVersion < Actions::Base
        def plan(repository_mapping, content_view_version, options = {})
          incremental = options.fetch(:incremental, false)
          content_view = content_view_version.content_view
          extended_repo_map = extended_repo_mapping(repository_mapping, content_view, incremental)
          sequence do
            plan_action(::Actions::Katello::Repository::MultiCloneContents, extended_repo_map,
                        copy_contents: true,
                        solve_dependencies: content_view.solve_dependencies,
                        metadata_generate: !incremental)
          end
        end

        def extended_repo_mapping(repo_map, content_view, incremental)
          # Example: {[source_repos] => {dest_repo: dest_repo, filters: filters}}
          extended_repo_map = {}
          repo_map.each do |source_repos, dest_repo|
            filters = incremental ? [] : content_view.filters.applicable(source_repos.first)
            extended_repo_map[source_repos] = { :dest_repo => dest_repo,
                                                :filters => filters }
          end
          extended_repo_map
        end
      end
    end
  end
end

Version data entries

50 entries across 50 versions & 1 rubygems

Version Path
katello-4.1.4 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.0.3 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-3.18.5 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.2.0.1.rc2 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.2.0.rc2 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.1.3 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.2.0.rc1 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.0.2.1 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.1.2.1 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.0.2 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.1.2 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-3.18.4 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.1.1 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.1.0 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.0.1.2 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-3.18.3.1 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.1.0.rc2.2 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.1.0.rc2.1 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.0.1.1 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-3.18.3 app/lib/actions/katello/repository/multi_clone_to_version.rb