Sha256: 148d2f5f657d801e5135bcfb0a445de31cfca920e14fb0eaaaeb33fd2084be40

Contents?: true

Size: 1.21 KB

Versions: 28

Compression:

Stored size: 1.21 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: true,
                        generate_metadata: true)
          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

28 entries across 28 versions & 1 rubygems

Version Path
katello-4.14.2 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.15.0 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.15.0.rc2 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.15.0.rc1 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.14.1 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.14.0 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.14.0.rc3 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.14.0.rc2 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.14.0.rc1.1 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.14.0.rc1 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.13.1 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.13.0 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.12.1 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.13.0.rc1 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.12.0 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.12.0.rc3 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.12.0.rc2 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.12.0.rc1 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.11.1 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.11.0 app/lib/actions/katello/repository/multi_clone_to_version.rb