katello 3.14.1 → 3.15.0.rc1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of katello might be problematic. Click here for more details.

Files changed (167) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +1 -1
  3. data/app/controllers/katello/api/v2/products_bulk_actions_controller.rb +3 -3
  4. data/app/controllers/katello/api/v2/repositories_controller.rb +1 -1
  5. data/app/helpers/katello/hosts_and_hostgroups_helper.rb +1 -1
  6. data/app/lib/actions/katello/content_view/publish.rb +2 -0
  7. data/app/lib/actions/katello/content_view_version/incremental_update.rb +1 -0
  8. data/app/lib/actions/katello/host/reassign.rb +1 -2
  9. data/app/lib/actions/katello/host/update_content_view.rb +1 -1
  10. data/app/lib/actions/katello/host/update_release_version.rb +1 -1
  11. data/app/lib/actions/katello/organization/manifest_refresh.rb +1 -1
  12. data/app/lib/actions/katello/product/update_http_proxy.rb +1 -1
  13. data/app/lib/actions/katello/repository/clone_contents.rb +1 -1
  14. data/app/lib/actions/katello/repository/clone_to_environment.rb +2 -1
  15. data/app/lib/actions/katello/repository/create.rb +1 -1
  16. data/app/lib/actions/katello/repository/metadata_generate.rb +2 -8
  17. data/app/lib/actions/katello/repository/refresh_repository.rb +5 -1
  18. data/app/lib/actions/katello/repository/sync.rb +6 -1
  19. data/app/lib/actions/middleware/execute_if_contents_changed.rb +1 -1
  20. data/app/lib/actions/pulp/orchestration/repository/refresh_if_needed.rb +1 -1
  21. data/app/lib/actions/pulp/repository/clear.rb +1 -1
  22. data/app/lib/actions/pulp/repository/remove_units.rb +1 -1
  23. data/app/lib/actions/pulp3/abstract_async_task.rb +1 -2
  24. data/app/lib/actions/pulp3/capsule_content/generate_metadata.rb +1 -1
  25. data/app/lib/actions/pulp3/capsule_content/refresh_distribution.rb +2 -2
  26. data/app/lib/actions/pulp3/capsule_content/sync.rb +1 -1
  27. data/app/lib/actions/pulp3/content_migration.rb +17 -0
  28. data/app/lib/actions/pulp3/import_migration.rb +14 -0
  29. data/app/lib/actions/pulp3/orchestration/orphan_cleanup/remove_orphans.rb +4 -1
  30. data/app/lib/actions/pulp3/orchestration/repository/copy_all_units.rb +3 -3
  31. data/app/lib/actions/pulp3/orchestration/repository/create.rb +3 -1
  32. data/app/lib/actions/pulp3/orchestration/repository/generate_metadata.rb +0 -2
  33. data/app/lib/actions/pulp3/orchestration/repository/import_upload.rb +1 -1
  34. data/app/lib/actions/pulp3/orchestration/repository/refresh_if_needed.rb +18 -0
  35. data/app/lib/actions/pulp3/orchestration/repository/refresh_repos.rb +1 -1
  36. data/app/lib/actions/pulp3/orchestration/repository/remove_units.rb +1 -1
  37. data/app/lib/actions/pulp3/orchestration/repository/sync.rb +1 -1
  38. data/app/lib/actions/pulp3/orchestration/repository/upload_content.rb +1 -1
  39. data/app/lib/actions/pulp3/orphan_cleanup/delete_orphan_distributions.rb +16 -0
  40. data/app/lib/actions/pulp3/orphan_cleanup/delete_orphan_remotes.rb +16 -0
  41. data/app/lib/actions/pulp3/orphan_cleanup/delete_orphan_repository_versions.rb +1 -6
  42. data/app/lib/actions/pulp3/orphan_cleanup/remove_orphans.rb +15 -0
  43. data/app/lib/actions/pulp3/orphan_cleanup/remove_unneeded_repos.rb +2 -2
  44. data/app/lib/actions/pulp3/repository/create.rb +1 -1
  45. data/app/lib/actions/pulp3/repository/create_publication.rb +1 -1
  46. data/app/lib/actions/pulp3/repository/presenters/content_unit_presenter.rb +1 -0
  47. data/app/lib/actions/pulp3/repository/refresh_distribution.rb +4 -2
  48. data/app/lib/actions/pulp3/repository/save_version.rb +12 -8
  49. data/app/lib/actions/pulp3/repository/upload_file.rb +2 -2
  50. data/app/lib/katello/api/v2/rendering.rb +1 -0
  51. data/app/lib/katello/concerns/base_template_scope_extensions.rb +5 -1
  52. data/app/lib/katello/http_resource.rb +4 -1
  53. data/app/lib/katello/resources/registry.rb +9 -2
  54. data/app/models/katello/concerns/content_facet_host_extensions.rb +1 -0
  55. data/app/models/katello/concerns/organization_extensions.rb +4 -4
  56. data/app/models/katello/concerns/smart_proxy_extensions.rb +33 -7
  57. data/app/models/katello/concerns/subscription_facet_host_extensions.rb +34 -12
  58. data/app/models/katello/content_view_docker_filter.rb +1 -1
  59. data/app/models/katello/content_view_version.rb +20 -47
  60. data/app/models/katello/glue/candlepin/owner.rb +4 -0
  61. data/app/models/katello/glue/candlepin/product.rb +12 -6
  62. data/app/models/katello/glue/pulp/repos.rb +6 -3
  63. data/app/models/katello/host/subscription_facet.rb +4 -5
  64. data/app/models/katello/ping.rb +3 -4
  65. data/app/models/katello/pool.rb +1 -1
  66. data/app/models/katello/pulp3/distribution_reference.rb +1 -1
  67. data/app/models/katello/repository.rb +14 -0
  68. data/app/models/katello/root_repository.rb +0 -2
  69. data/app/models/katello/subscription_status.rb +7 -0
  70. data/app/models/setting/content.rb +10 -3
  71. data/app/services/katello/candlepin/consumer.rb +1 -0
  72. data/app/services/katello/pulp/repository.rb +1 -1
  73. data/app/services/katello/pulp/repository/deb.rb +2 -0
  74. data/app/services/katello/pulp/repository/docker.rb +2 -0
  75. data/app/services/katello/pulp/repository/file.rb +2 -0
  76. data/app/services/katello/pulp/repository/yum.rb +9 -5
  77. data/app/services/katello/pulp3/ansible_collection.rb +1 -1
  78. data/app/services/katello/pulp3/api/ansible_collection.rb +46 -0
  79. data/app/services/katello/pulp3/api/core.rb +159 -0
  80. data/app/services/katello/pulp3/api/docker.rb +62 -0
  81. data/app/services/katello/pulp3/api/file.rb +54 -0
  82. data/app/services/katello/pulp3/api/yum.rb +54 -0
  83. data/app/services/katello/pulp3/distribution.rb +17 -0
  84. data/app/services/katello/pulp3/docker_blob.rb +1 -1
  85. data/app/services/katello/pulp3/docker_manifest.rb +1 -1
  86. data/app/services/katello/pulp3/docker_manifest_list.rb +1 -1
  87. data/app/services/katello/pulp3/docker_tag.rb +1 -1
  88. data/app/services/katello/pulp3/erratum.rb +109 -0
  89. data/app/services/katello/pulp3/file_unit.rb +1 -1
  90. data/app/services/katello/pulp3/migration.rb +71 -0
  91. data/app/services/katello/pulp3/migration_plan.rb +27 -0
  92. data/app/services/katello/pulp3/module_stream.rb +47 -0
  93. data/app/services/katello/pulp3/package_group.rb +66 -0
  94. data/app/services/katello/pulp3/pulp_content_unit.rb +9 -1
  95. data/app/services/katello/pulp3/repository.rb +118 -348
  96. data/app/services/katello/pulp3/repository/ansible_collection.rb +1 -29
  97. data/app/services/katello/pulp3/repository/docker.rb +23 -43
  98. data/app/services/katello/pulp3/repository/file.rb +1 -37
  99. data/app/services/katello/pulp3/repository/yum.rb +36 -37
  100. data/app/services/katello/pulp3/repository_mirror.rb +171 -0
  101. data/app/services/katello/pulp3/rpm.rb +143 -0
  102. data/app/services/katello/pulp3/smart_proxy_mirror_repository.rb +92 -0
  103. data/app/services/katello/pulp3/smart_proxy_repository.rb +38 -9
  104. data/app/services/katello/pulp3/srpm.rb +74 -0
  105. data/app/services/katello/pulp3/yum_metadata_file.rb +20 -0
  106. data/app/services/katello/registration_manager.rb +12 -11
  107. data/app/services/katello/repository_type.rb +11 -3
  108. data/app/services/katello/repository_type_manager.rb +11 -0
  109. data/app/views/dashboard/_subscription_widget.html.erb +6 -1
  110. data/app/views/katello/api/v2/content_view_versions/base.json.rabl +4 -11
  111. data/app/views/katello/api/v2/docker_manifest_lists/show.json.rabl +2 -1
  112. data/app/views/katello/api/v2/docker_manifests/show.json.rabl +2 -1
  113. data/app/views/katello/api/v2/package_groups/show.json.rabl +1 -1
  114. data/app/views/katello/api/v2/packages/show.json.rabl +2 -1
  115. data/app/views/katello/api/v2/repositories/base.json.rabl +2 -0
  116. data/app/views/katello/api/v2/repositories/show.json.rabl +2 -1
  117. data/app/views/katello/api/v2/smart_proxies/pulp_info.json.rabl +2 -0
  118. data/app/views/katello/api/v2/subscription_facet/show.json.rabl +1 -1
  119. data/app/views/smart_proxies/plugins/_pulp3.html.erb +19 -0
  120. data/app/views/smart_proxies/pulp_status.html.erb +10 -0
  121. data/db/migrate/20190930192813_add_pulp3_hrefs_to_content_types.rb +10 -0
  122. data/db/migrate/20191204020703_migrate_distribution_reference_to_use_repo_id.rb +22 -0
  123. data/db/migrate/20191204214919_add_content_view_version_counts.rb +7 -0
  124. data/db/migrate/20191213161248_add_dmi_uuid_to_katello_subscription_facets.rb +6 -0
  125. data/db/migrate/20200109162354_drop_host_update_lock_setting.rb +5 -0
  126. data/db/seeds.d/104-proxy.rb +1 -1
  127. data/db/seeds.d/111-upgrade_tasks.rb +3 -1
  128. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-subscriptions-modal.controller.js +3 -2
  129. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-subscriptions-modal.html +8 -3
  130. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-info.html +2 -2
  131. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/components/views/content-view-composite-available-content-views.html +1 -1
  132. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/components/views/content-view-composite-content-views-list.html +1 -1
  133. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/bulk/views/products-bulk-http-proxy-modal.html +3 -3
  134. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +2 -2
  135. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/views/new-repository.html +2 -2
  136. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/views/product-repositories.html +4 -1
  137. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/views/products.html +1 -1
  138. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/content-access-mode-banner.html +1 -1
  139. data/lib/katello/engine.rb +25 -25
  140. data/lib/katello/plugin.rb +1 -1
  141. data/lib/katello/repository_types/ansible_collection.rb +1 -0
  142. data/lib/katello/repository_types/docker.rb +2 -1
  143. data/lib/katello/repository_types/file.rb +1 -1
  144. data/lib/katello/repository_types/yum.rb +29 -7
  145. data/lib/katello/tasks/pulp3_content_switchover.rake +21 -0
  146. data/lib/katello/tasks/pulp3_migration.rake +21 -0
  147. data/lib/katello/tasks/reset.rake +43 -16
  148. data/lib/katello/tasks/update_content_default_http_proxy.rake +3 -3
  149. data/lib/katello/tasks/upgrades/3.15/reindex_rpm_modular.rake +23 -0
  150. data/lib/katello/tasks/upgrades/3.15/set_sub_facet_dmi_uuid.rake +16 -0
  151. data/lib/katello/version.rb +1 -1
  152. data/package.json +9 -10
  153. data/webpack/components/WithOrganization/__snapshots__/withOrganization.test.js.snap +0 -63
  154. data/webpack/redux/actions/RedHatRepositories/helpers.js +5 -5
  155. data/webpack/redux/reducers/RedHatRepositories/repositorySetRepositories.js +17 -2
  156. data/webpack/scenes/RedHatRepositories/components/RepositorySet.js +1 -0
  157. data/webpack/scenes/RedHatRepositories/components/RepositorySetRepositories.js +1 -1
  158. data/webpack/scenes/RedHatRepositories/components/RepositorySetRepository/RepositorySetRepository.js +2 -3
  159. data/webpack/scenes/RedHatRepositories/components/__tests__/RepositorySetRepositories.test.js +44 -28
  160. data/webpack/scenes/RedHatRepositories/components/__tests__/__snapshots__/RepositorySetRepositories.test.js.snap +77 -45
  161. data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/__snapshots__/UpstreamSubscriptionsPage.test.js.snap +2 -6
  162. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/__snapshots__/SubscriptionTypeFormatter.test.js.snap +0 -1
  163. data/webpack/test_setup.js +3 -1
  164. metadata +62 -24
  165. data/app/lib/actions/katello/host/update.rb +0 -84
  166. data/app/lib/actions/pulp3/repository/create_version.rb +0 -19
  167. data/app/views/katello/api/v2/smart_proxies/download_policy.json.rabl +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 40ea2dd0117ec5d25205f3868df5ebcb700767dcc7a6eda96f6aa2c30c0c7da3
4
- data.tar.gz: 2084af6536db98b8525ec9c790bd00b8c3186897a469716d4bf2b52b36057ae0
3
+ metadata.gz: d92a04a363f6fc1fce64ebcba555c088bbd768040ee7232d4ca97b4c0c8a3350
4
+ data.tar.gz: 14cb0e3c209c8ed06805a471036c56005c1a4628948a488d7ca5c9db123d1af1
5
5
  SHA512:
6
- metadata.gz: 38b703df376f2b4dadbbbfc64aac8a399de28e4cb39762bffd6c3d126dc110f89e7b1bb6ea9d925e31b8ee33ea72386ba3db2e47ce18e5830b764eb663d49d46
7
- data.tar.gz: 38234d68e96fd389181b11533e1705b3558b0fa4bd198a37da14ddea4074511d06e5698d6f9bd6611065500d49a4bfcd3bb411fbc33e7c4c6cb7e2a25c85ad44
6
+ metadata.gz: 14306c7cccfcdb9d741fc7cf24c2333d4a4442d85a4542594da4fa476814db26e905bcc7721fa6984366a337c8dc4b13b6baa0c1558d86af8f3528dcdc6a6f25
7
+ data.tar.gz: 8266f86d199feb3d0884424e8aa55e033787d6580e6a3562daf87242d19f893e1b98d7108fff97893d0e44dcdee3ae4ec13789540e209b73f70a44e6740b7be6
@@ -252,7 +252,7 @@ module Katello
252
252
  #api :PUT, "/consumers/:id", N_("Update consumer information")
253
253
  def facts
254
254
  User.current = User.anonymous_admin
255
- async_task(::Actions::Katello::Host::Update, @host, rhsm_params)
255
+ @host.update_candlepin_associations(rhsm_params)
256
256
  update_host_registered_through(@host, request.headers)
257
257
  render :json => {:content => _("Facts successfully updated.")}, :status => :ok
258
258
  end
@@ -50,10 +50,10 @@ module Katello
50
50
  respond_for_async :resource => task
51
51
  end
52
52
 
53
- api :PUT, "/products/bulk/http_proxy", N_("Update the http proxy configuration on the repositories of one or more products.")
53
+ api :PUT, "/products/bulk/http_proxy", N_("Update the HTTP proxy configuration on the repositories of one or more products.")
54
54
  param :ids, Array, :desc => N_("List of product ids"), :required => true
55
- param :http_proxy_policy, ::Katello::RootRepository::HTTP_PROXY_POLICIES, :desc => N_("policy for http proxy for content sync")
56
- param :http_proxy_id, :number, :desc => N_("Http Proxy identifier to associated"), :required => false
55
+ param :http_proxy_policy, ::Katello::RootRepository::HTTP_PROXY_POLICIES, :desc => N_("policy for HTTP proxy for content sync")
56
+ param :http_proxy_id, :number, :desc => N_("HTTP Proxy identifier to associated"), :required => false
57
57
  def update_http_proxy
58
58
  task = async_task(::Actions::Katello::Product::UpdateHttpProxy,
59
59
  @products.editable,
@@ -55,7 +55,7 @@ module Katello
55
55
  param :ignore_global_proxy, :bool, :desc => N_("if true, will ignore the globally configured proxy when syncing"), :deprecated => true
56
56
  param :ignorable_content, Array, :desc => N_("List of content units to ignore while syncing a yum repository. Must be subset of %s") % RootRepository::IGNORABLE_CONTENT_UNIT_TYPES.join(",")
57
57
  param :ansible_collection_requirements, String, :desc => N_("Contents of requirement yaml file to sync from URL")
58
- param :http_proxy_policy, ::Katello::RootRepository::HTTP_PROXY_POLICIES, :desc => N_("policies for http proxy for content sync")
58
+ param :http_proxy_policy, ::Katello::RootRepository::HTTP_PROXY_POLICIES, :desc => N_("policies for HTTP proxy for content sync")
59
59
  param :http_proxy_id, :number, :desc => N_("ID of a HTTP Proxy")
60
60
  end
61
61
 
@@ -10,7 +10,7 @@ module Katello
10
10
 
11
11
  def blank_or_inherit_with_id(f, attr)
12
12
  return true unless f.object.respond_to?(:parent_id) && f.object.parent_id
13
- inherited_value = f.object.send(attr).try(:id) || ''
13
+ inherited_value = f.object.send(attr).try(:id) || ''
14
14
  %(<option data-id="#{inherited_value}" value="">#{blank_or_inherit_f(f, attr)}</option>)
15
15
  end
16
16
 
@@ -92,6 +92,8 @@ module Actions
92
92
  end
93
93
 
94
94
  def finalize
95
+ version = ::Katello::ContentViewVersion.find(input[:content_view_version_id])
96
+ version.update_content_counts!
95
97
  # update errata applicability counts for all hosts in the CV & Library
96
98
  ::Katello::Host::ContentFacet.where(:content_view_id => input[:content_view_id],
97
99
  :lifecycle_environment_id => input[:environment_id]).each do |facet|
@@ -167,6 +167,7 @@ module Actions
167
167
 
168
168
  def finalize
169
169
  version = ::Katello::ContentViewVersion.find(input[:new_content_view_version_id])
170
+ version.update_content_counts!
170
171
  generate_description(version, output[:added_units]) if version.description.blank?
171
172
 
172
173
  history = ::Katello::ContentViewHistory.find(input[:history_id])
@@ -5,8 +5,7 @@ module Actions
5
5
  def plan(host, content_view_id, environment_id)
6
6
  host.content_facet.content_view = ::Katello::ContentView.find(content_view_id)
7
7
  host.content_facet.lifecycle_environment = ::Katello::KTEnvironment.find(environment_id)
8
-
9
- plan_action(::Actions::Katello::Host::Update, host)
8
+ host.update_candlepin_associations
10
9
  end
11
10
  end
12
11
  end
@@ -6,7 +6,7 @@ module Actions
6
6
  if host.content_facet
7
7
  host.content_facet.content_view = ::Katello::ContentView.find(content_view_id)
8
8
  host.content_facet.lifecycle_environment = ::Katello::KTEnvironment.find(lifecycle_environment_id)
9
- plan_action(Actions::Katello::Host::Update, host)
9
+ host.update_candlepin_associations
10
10
  plan_self(:hostname => host.name)
11
11
  else
12
12
  fail _("Host %s has not been registered with subscription-manager.") % host.name
@@ -10,7 +10,7 @@ module Actions
10
10
  else
11
11
  host.subscription_facet.release_version = release_version
12
12
  end
13
- plan_action(Actions::Katello::Host::Update, host)
13
+ host.update_candlepin_associations
14
14
  else
15
15
  fail _("Host %s has not been registered with subscription-manager.") % host.name
16
16
  end
@@ -10,7 +10,7 @@ module Actions
10
10
  action_subject organization
11
11
  manifest_update = organization.products.redhat.any?
12
12
  path = "/tmp/#{rand}.zip"
13
- details = organization.owner_details
13
+ details = organization.owner_details
14
14
  upstream = details['upstreamConsumer'].blank? ? {} : details['upstreamConsumer']
15
15
 
16
16
  sequence do
@@ -4,7 +4,7 @@ module Actions
4
4
  class UpdateHttpProxy < Actions::EntryAction
5
5
  def plan(products, http_proxy_policy, http_proxy)
6
6
  products.each do |product|
7
- roots = product.repositories.map(&:root)
7
+ roots = product.root_repositories
8
8
  next if roots.empty?
9
9
  plan_action(::Actions::BulkAction,
10
10
  ::Actions::Katello::Repository::Update,
@@ -40,7 +40,7 @@ module Actions
40
40
  end
41
41
 
42
42
  check_matching_content = ::Katello::RepositoryTypeManager.find(new_repository.content_type).metadata_publish_matching_check
43
- if new_repository.environment && source_repositories.count == 1 && check_matching_content
43
+ if new_repository.environment && source_repositories.count == 1 && check_matching_content && !SmartProxy.pulp_master.pulp3_support?(new_repository)
44
44
  match_check_output = plan_action(Katello::Repository::CheckMatchingContent,
45
45
  :source_repo_id => source_repositories.first.id,
46
46
  :target_repo_id => new_repository.id).output
@@ -13,7 +13,8 @@ module Actions
13
13
  plan_action(Repository::Create, clone, true, false)
14
14
  else
15
15
  #only clear if it should be empty, but its not
16
- plan_optional_pulp_action([Actions::Pulp::Repository::Clear], clone, SmartProxy.pulp_master) if (!clone.yum? || !clone.empty_in_pulp?)
16
+ plan_optional_pulp_action([Actions::Pulp::Repository::Clear], clone, SmartProxy.pulp_master)
17
+ # Do we need to refresh distributors here?
17
18
  plan_optional_pulp_action([Actions::Pulp::Orchestration::Repository::RefreshIfNeeded], clone, SmartProxy.pulp_master)
18
19
  end
19
20
 
@@ -48,7 +48,7 @@ module Actions
48
48
  ::User.current = ::User.anonymous_api_admin
49
49
  unless input[:clone]
50
50
  repository = ::Katello::Repository.find(input[:repository_id])
51
- ForemanTasks.async_task(Katello::Repository::MetadataGenerate, repository, repository_creation: true)
51
+ ForemanTasks.async_task(Katello::Repository::MetadataGenerate, repository)
52
52
  end
53
53
  ensure
54
54
  ::User.current = nil
@@ -7,23 +7,17 @@ module Actions
7
7
  def plan(repository, options = {})
8
8
  dependency = options.fetch(:dependency, nil)
9
9
  force = options.fetch(:force, false)
10
- repository_creation = options.fetch(:repository_creation, false)
11
10
  source_repository = options.fetch(:source_repository, nil)
12
11
  source_repository ||= repository.target_repository if repository.link?
13
12
  smart_proxy = options.fetch(:smart_proxy, SmartProxy.pulp_master)
14
- if repository_creation
15
- matching_content = false
16
- else
17
- matching_content = options.fetch(:matching_content, false)
18
- end
13
+ matching_content = options.fetch(:matching_content, false)
19
14
 
20
15
  plan_pulp_action([Pulp::Repository::DistributorPublish, Pulp3::Orchestration::Repository::GenerateMetadata],
21
16
  repository, smart_proxy,
22
17
  :force => force,
23
18
  :source_repository => source_repository,
24
19
  :matching_content => matching_content,
25
- :dependency => dependency,
26
- :repository_creation => repository_creation)
20
+ :dependency => dependency)
27
21
  end
28
22
  end
29
23
  end
@@ -2,10 +2,14 @@ module Actions
2
2
  module Katello
3
3
  module Repository
4
4
  class RefreshRepository < Actions::Base
5
+ include Actions::Katello::PulpSelector
6
+
5
7
  def plan(repo, options = {})
6
8
  User.as_anonymous_admin do
7
9
  repo = ::Katello::Repository.find(repo.id)
8
- plan_action(Pulp::Repository::Refresh, repo, :capsule_id => SmartProxy.default_capsule!.id, :dependency => options[:dependency])
10
+ plan_pulp_action([Actions::Pulp3::Orchestration::Repository::RefreshIfNeeded,
11
+ Actions::Pulp::Orchestration::Repository::RefreshIfNeeded],
12
+ repo, SmartProxy.default_capsule!, :dependency => options[:dependency])
9
13
  plan_self(:name => repo.name, :dependency => options[:dependency])
10
14
  end
11
15
  end
@@ -24,7 +24,8 @@ module Actions
24
24
  incremental = options.fetch(:incremental, false)
25
25
  validate_contents = options.fetch(:validate_contents, false)
26
26
  skip_metadata_check = options.fetch(:skip_metadata_check, false) || validate_contents
27
- generate_applicability = repo.yum?
27
+ # TODO: Remove the check for Pulp 3 once Pulp 3 errata is working fully
28
+ generate_applicability = repo.yum? && !SmartProxy.pulp_master.pulp3_support?(repo)
28
29
 
29
30
  pulp_sync_options = {}
30
31
  pulp_sync_options[:download_policy] = ::Runcible::Models::YumImporter::DOWNLOAD_ON_DEMAND if validate_contents
@@ -69,6 +70,10 @@ module Actions
69
70
  rescue ::Katello::Errors::CapsuleCannotBeReached # skip any capsules that cannot be connected to
70
71
  end
71
72
 
73
+ def finalize
74
+ ::Katello::Repository.find(input[:id])&.audit_sync
75
+ end
76
+
72
77
  def humanized_name
73
78
  if input && input[:validate_contents]
74
79
  _("Synchronize: Validate Content")
@@ -12,7 +12,7 @@ module Actions
12
12
  private
13
13
 
14
14
  def execute?
15
- if action.input.keys.include?('contents_changed') && !action.input['contents_changed']
15
+ if action.input.keys.include?('contents_changed') && action.input['contents_changed'] == false
16
16
  self.action.output[:post_sync_skipped] = true
17
17
  false
18
18
  else
@@ -3,7 +3,7 @@ module Actions
3
3
  module Orchestration
4
4
  module Repository
5
5
  class RefreshIfNeeded < Pulp::Abstract
6
- def plan(repository, smart_proxy)
6
+ def plan(repository, smart_proxy, _options = {})
7
7
  plan_action(Actions::Pulp::Repository::Refresh, repository, smart_proxy_id: smart_proxy.id)
8
8
  end
9
9
  end
@@ -3,7 +3,7 @@ module Actions
3
3
  module Repository
4
4
  class Clear < Actions::Pulp::AbstractAsyncTask
5
5
  def plan(repo, smart_proxy)
6
- plan_self(:repo_id => repo.id, :smart_proxy_id => smart_proxy.id)
6
+ plan_self(:repo_id => repo.id, :smart_proxy_id => smart_proxy.id) unless (repo.yum? || repo.empty_in_pulp?)
7
7
  end
8
8
 
9
9
  def invoke_external_task
@@ -22,7 +22,7 @@ module Actions
22
22
  content_type = ::Katello::RepositoryTypeManager.find_content_type(input[:content_unit_type].downcase)
23
23
  if input[:contents]
24
24
  units = content_type.model_class.where(:id => input[:contents])
25
- unit_pulp_ids = units.sort.map(&:pulp_id)
25
+ unit_pulp_ids = units.map(&:pulp_id).sort
26
26
  end
27
27
  tasks << ::SmartProxy.pulp_master.content_service(content_type).remove(repo, unit_pulp_ids)
28
28
  else
@@ -121,8 +121,7 @@ module Actions
121
121
  end
122
122
 
123
123
  def tasks_api
124
- api_client = PulpcoreClient::ApiClient.new(smart_proxy.pulp3_configuration(PulpcoreClient::Configuration))
125
- PulpcoreClient::TasksApi.new(api_client)
124
+ ::Katello::Pulp3::Api::Core.new(smart_proxy).tasks_api
126
125
  end
127
126
 
128
127
  def poll_external_task
@@ -24,7 +24,7 @@ module Actions
24
24
  def invoke_external_task
25
25
  repository = ::Katello::Repository.find(input[:repository_id])
26
26
  smart_proxy = ::SmartProxy.unscoped.find(input[:smart_proxy_id])
27
- output[:response] = repository.backend_service(smart_proxy).create_mirror_publication
27
+ output[:response] = repository.backend_service(smart_proxy).with_mirror_adapter.create_publication
28
28
  end
29
29
  end
30
30
  end
@@ -17,11 +17,11 @@ module Actions
17
17
  tasks = options[:tasks]
18
18
  repo = ::Katello::Repository.find(input[:repository_id])
19
19
  if options[:use_repository_version]
20
- output[:response] = repo.backend_service(smart_proxy).refresh_mirror_distributions(:use_repository_version => true)
20
+ output[:response] = repo.backend_service(smart_proxy).with_mirror_adapter.refresh_distributions(:use_repository_version => true)
21
21
  elsif tasks && tasks[:pulp_tasks] && tasks[:pulp_tasks].first
22
22
  publication_href = tasks[:pulp_tasks].first[:created_resources].first
23
23
  if publication_href
24
- output[:response] = repo.backend_service(smart_proxy).refresh_mirror_distributions(:publication => publication_href)
24
+ output[:response] = repo.backend_service(smart_proxy).with_mirror_adapter.refresh_distributions(:publication => publication_href)
25
25
  end
26
26
  end
27
27
  end
@@ -11,7 +11,7 @@ module Actions
11
11
 
12
12
  def invoke_external_task
13
13
  repo = ::Katello::Repository.find(input[:repository_id])
14
- output[:pulp_tasks] = repo.backend_service(::SmartProxy.unscoped.find(input[:smart_proxy_id])).sync_mirror
14
+ output[:pulp_tasks] = repo.backend_service(smart_proxy).with_mirror_adapter.sync
15
15
  end
16
16
 
17
17
  def rescue_strategy_for_self
@@ -0,0 +1,17 @@
1
+ module Actions
2
+ module Pulp3
3
+ class ContentMigration < Pulp3::AbstractAsyncTask
4
+ def plan(repository_type_labels, smart_proxy = SmartProxy.pulp_master)
5
+ sequence do
6
+ plan_self(repository_type_labels: repository_type_labels, smart_proxy_id: smart_proxy.id)
7
+ plan_action(Actions::Pulp3::ImportMigration, repository_type_labels)
8
+ end
9
+ end
10
+
11
+ def invoke_external_task
12
+ migration_service = ::Katello::Pulp3::Migration.new(smart_proxy, input[:repository_type_labels])
13
+ migration_service.create_and_run_migration
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,14 @@
1
+ module Actions
2
+ module Pulp3
3
+ class ImportMigration < Pulp3::Abstract
4
+ def plan(repository_type_labels)
5
+ plan_self(repository_type_labels: repository_type_labels)
6
+ end
7
+
8
+ def run
9
+ migration_service = ::Katello::Pulp3::Migration.new(SmartProxy.pulp_master, input[:repository_type_labels])
10
+ migration_service.import_pulp3_content
11
+ end
12
+ end
13
+ end
14
+ end
@@ -6,10 +6,13 @@ module Actions
6
6
  def plan(proxy)
7
7
  if proxy.pulp3_enabled?
8
8
  sequence do
9
+ plan_action(Actions::Pulp3::OrphanCleanup::DeleteOrphanRepositoryVersions, proxy)
10
+ plan_action(Actions::Pulp3::OrphanCleanup::RemoveOrphans, proxy)
9
11
  if proxy.pulp_mirror?
10
12
  plan_action(Actions::Pulp3::OrphanCleanup::RemoveUnneededRepos, proxy)
13
+ plan_action(Actions::Pulp3::OrphanCleanup::DeleteOrphanDistributions, proxy)
14
+ plan_action(Actions::Pulp3::OrphanCleanup::DeleteOrphanRemotes, proxy)
11
15
  end
12
- plan_action(Actions::Pulp3::OrphanCleanup::DeleteOrphanRepositoryVersions, proxy)
13
16
  end
14
17
  end
15
18
  end
@@ -18,11 +18,11 @@ module Actions
18
18
  filter_ids: filter_ids, solve_dependencies: solve_dependencies,
19
19
  rpm_filenames: rpm_filenames)
20
20
 
21
- plan_action(Actions::Pulp3::Repository::SaveVersion, target_repo, copy_action.output[:pulp_tasks])
21
+ plan_action(Actions::Pulp3::Repository::SaveVersion, target_repo, tasks: copy_action.output[:pulp_tasks])
22
22
  else
23
23
  #if we are not filtering, copy the version to the cv repository, and the units for each additional repo
24
24
  action = plan_action(Actions::Pulp3::Repository::CopyVersion, source_repositories.first, smart_proxy, target_repo)
25
- plan_action(Actions::Pulp3::Repository::SaveVersion, target_repo, action.output[:pulp_tasks])
25
+ plan_action(Actions::Pulp3::Repository::SaveVersion, target_repo, tasks: action.output[:pulp_tasks])
26
26
  copy_actions = []
27
27
  #since we're creating a new version from the first repo, start copying at the 2nd
28
28
  source_repositories[1..-1].each do |source_repo|
@@ -32,7 +32,7 @@ module Actions
32
32
  rpm_filenames: rpm_filenames)
33
33
  end
34
34
 
35
- plan_action(Actions::Pulp3::Repository::SaveVersion, target_repo, copy_actions.last.output[:pulp_tasks])
35
+ plan_action(Actions::Pulp3::Repository::SaveVersion, target_repo, tasks: copy_actions.last.output[:pulp_tasks])
36
36
  end
37
37
  end
38
38
  else
@@ -5,7 +5,9 @@ module Actions
5
5
  class Create < Pulp3::Abstract
6
6
  def plan(repository, smart_proxy)
7
7
  sequence do
8
- plan_action(Actions::Pulp3::Repository::Create, repository, smart_proxy)
8
+ create_action = plan_action(Actions::Pulp3::Repository::Create, repository, smart_proxy)
9
+ plan_action(Actions::Pulp3::Repository::SaveVersion, repository, repository_details: create_action.output[:response])
10
+
9
11
  if repository.content_view.default? || !smart_proxy.pulp_master?
10
12
  plan_action(Actions::Pulp3::Repository::CreateRemote, repository, smart_proxy)
11
13
  end
@@ -7,8 +7,6 @@ module Actions
7
7
  options[:contents_changed] = (options && options.key?(:contents_changed)) ? options[:contents_changed] : true
8
8
  publication_content_type = !::Katello::RepositoryTypeManager.find(repository.content_type).pulp3_skip_publication
9
9
  sequence do
10
- plan_action(Actions::Pulp3::Repository::CreateVersion, repository, smart_proxy) if options[:repository_creation]
11
-
12
10
  if options[:source_repository] && publication_content_type
13
11
  plan_self(source_repository_id: options[:source_repository].id, target_repository_id: repository.id)
14
12
  elsif publication_content_type
@@ -15,7 +15,7 @@ module Actions
15
15
  plan_self(:skip => true)
16
16
  end
17
17
  action_output = plan_action(Pulp3::Repository::ImportUpload, content_unit_href, repository, smart_proxy).output
18
- plan_action(Pulp3::Repository::SaveVersion, repository, action_output[:pulp_tasks]).output
18
+ plan_action(Pulp3::Repository::SaveVersion, repository, tasks: action_output[:pulp_tasks]).output
19
19
  end
20
20
  end
21
21
 
@@ -0,0 +1,18 @@
1
+ module Actions
2
+ module Pulp3
3
+ module Orchestration
4
+ module Repository
5
+ class RefreshIfNeeded < Pulp3::AbstractAsyncTask
6
+ def plan(repository, smart_proxy, _options = {})
7
+ plan_self(repository_id: repository.id, smart_proxy_id: smart_proxy.id)
8
+ end
9
+
10
+ def invoke_external_task
11
+ repo = ::Katello::Repository.find(input[:repository_id])
12
+ repo.backend_service(smart_proxy).refresh_if_needed
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -11,7 +11,7 @@ module Actions
11
11
  param :repository_id
12
12
  end
13
13
  def fetch_proxy_service(smart_proxy)
14
- ::Katello::Pulp3::SmartProxyRepository.new(smart_proxy)
14
+ ::Katello::Pulp3::SmartProxyRepository.instance_for_type(smart_proxy)
15
15
  end
16
16
 
17
17
  def act_on_repo?(repo, smart_proxy)
@@ -8,7 +8,7 @@ module Actions
8
8
  def plan(repository, smart_proxy, options)
9
9
  sequence do
10
10
  action_output = plan_action(Actions::Pulp3::Repository::RemoveUnits, repository, smart_proxy, options).output
11
- plan_action(Pulp3::Repository::SaveVersion, repository, action_output[:pulp_tasks])
11
+ plan_action(Pulp3::Repository::SaveVersion, repository, tasks: action_output[:pulp_tasks])
12
12
  end
13
13
  end
14
14
  end