Sha256: 8381a35d61a737b94a323f84569d5eed01f33dfa919925978b77b234a1b58a66

Contents?: true

Size: 1.22 KB

Versions: 48

Compression:

Stored size: 1.22 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,
                        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

48 entries across 48 versions & 1 rubygems

Version Path
katello-4.7.0.rc1 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.4.2.2 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.4.2.1 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.4.2 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.5.1 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.6.0 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.6.0.rc2 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.6.0.rc1 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.5.0 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.5.0.rc2 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.4.1 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.5.0.rc1 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.4.0.2 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.4.0.1 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.3.1 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.4.0 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.4.0.rc2 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.4.0.rc1 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.2.2 app/lib/actions/katello/repository/multi_clone_to_version.rb
katello-4.3.0 app/lib/actions/katello/repository/multi_clone_to_version.rb