Class: Actions::Katello::CapsuleContent::CreateRepos
- Inherits:
-
EntryAction
- Object
- EntryAction
- Actions::Katello::CapsuleContent::CreateRepos
- Defined in:
- app/lib/actions/katello/capsule_content/create_repos.rb
Instance Method Summary collapse
- #create_repo_in_pulp(capsule_content, repository) ⇒ Object
- #plan(capsule_content, environment = nil, content_view = nil) ⇒ Object
- #repository_relative_path(repository) ⇒ Object
Instance Method Details
#create_repo_in_pulp(capsule_content, repository) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'app/lib/actions/katello/capsule_content/create_repos.rb', line 18 def create_repo_in_pulp(capsule_content, repository) ueber_cert = ::Cert::Certs.ueber_cert(repository.organization) relative_path = repository_relative_path(repository) checksum_type = repository.yum? ? repository.checksum_type : nil plan_action(Pulp::Repository::Create, content_type: repository.content_type, pulp_id: repository.pulp_id, name: repository.name, feed: repository.docker? ? repository.docker_feed_url(true) : repository.full_path, ssl_ca_cert: ::Cert::Certs.ca_cert, ssl_client_cert: ueber_cert[:cert], ssl_client_key: ueber_cert[:key], unprotected: repository.unprotected, checksum_type: checksum_type, path: relative_path, with_importer: true, docker_upstream_name: repository.pulp_id, download_policy: repository.capsule_download_policy, capsule_id: capsule_content.capsule.id) end |
#plan(capsule_content, environment = nil, content_view = nil) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 |
# File 'app/lib/actions/katello/capsule_content/create_repos.rb', line 6 def plan(capsule_content, environment = nil, content_view = nil) fail _("Action not allowed for the default capsule.") if capsule_content.default_capsule? current_repos_on_capsule = capsule_content.current_repositories(environment, content_view) list_of_repos_to_sync = capsule_content.repos_available_to_capsule(environment, content_view) need_creation = list_of_repos_to_sync - current_repos_on_capsule need_creation.each do |repo| create_repo_in_pulp(capsule_content, repo) end end |
#repository_relative_path(repository) ⇒ Object
40 41 42 43 44 45 46 47 48 |
# File 'app/lib/actions/katello/capsule_content/create_repos.rb', line 40 def repository_relative_path(repository) if repository.is_a? ::Katello::ContentViewPuppetEnvironment repository.generate_puppet_path elsif repository.puppet? && (repository.is_a? ::Katello::Repository) nil else repository.relative_path end end |