Sha256: a1baad521e48963606fb307ad2249f5b2485a1e60a5feec69cfb9fb1ef92b5db

Contents?: true

Size: 1.17 KB

Versions: 14

Compression:

Stored size: 1.17 KB

Contents

module Actions
  module Katello
    module CapsuleContent
      class CreateRepos < ::Actions::EntryAction
        def plan(smart_proxy, environment = nil, content_view = nil, repository = nil)
          smart_proxy_service = ::Katello::Pulp::SmartProxyRepository.new(smart_proxy)
          fail _("Action not allowed for the default capsule.") if smart_proxy_service.default_capsule?

          repos_to_create(smart_proxy_service, environment, content_view, repository).each do |repo|
            plan_action(Pulp::Repository::Create, repo, smart_proxy)
          end
        end

        def repos_to_create(smart_proxy_service, environment, content_view, repository)
          repos = []
          current_repos_on_capsule = smart_proxy_service.current_repositories(environment, content_view)
          if repository
            unless current_repos_on_capsule.include?(repository)
              repos << repository
            end
          else
            list_of_repos_to_sync = smart_proxy_service.repos_available_to_capsule(environment, content_view)
            repos = list_of_repos_to_sync - current_repos_on_capsule
          end
          repos
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
katello-3.13.4 app/lib/actions/katello/capsule_content/create_repos.rb
katello-3.13.3 app/lib/actions/katello/capsule_content/create_repos.rb
katello-3.13.2 app/lib/actions/katello/capsule_content/create_repos.rb
katello-3.13.1 app/lib/actions/katello/capsule_content/create_repos.rb
katello-3.13.0 app/lib/actions/katello/capsule_content/create_repos.rb
katello-3.13.0.rc2.1 app/lib/actions/katello/capsule_content/create_repos.rb
katello-3.13.0.rc2 app/lib/actions/katello/capsule_content/create_repos.rb
katello-3.12.3 app/lib/actions/katello/capsule_content/create_repos.rb
katello-3.12.2 app/lib/actions/katello/capsule_content/create_repos.rb
katello-3.13.0.rc1 app/lib/actions/katello/capsule_content/create_repos.rb
katello-3.12.1 app/lib/actions/katello/capsule_content/create_repos.rb
katello-3.12.0 app/lib/actions/katello/capsule_content/create_repos.rb
katello-3.12.0.rc2 app/lib/actions/katello/capsule_content/create_repos.rb
katello-3.12.0.rc1 app/lib/actions/katello/capsule_content/create_repos.rb