katello 3.17.0.rc1 → 3.17.0.rc2

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 (293) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/katello/api/registry/registry_proxies_controller.rb +5 -3
  3. data/app/controllers/katello/api/rhsm/candlepin_dynflow_proxy_controller.rb +1 -1
  4. data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +2 -2
  5. data/app/controllers/katello/api/v2/api_controller.rb +1 -1
  6. data/app/controllers/katello/api/v2/content_credentials_controller.rb +1 -1
  7. data/app/controllers/katello/api/v2/content_uploads_controller.rb +5 -5
  8. data/app/controllers/katello/api/v2/content_view_repositories_controller.rb +47 -0
  9. data/app/controllers/katello/api/v2/content_view_versions_controller.rb +50 -19
  10. data/app/controllers/katello/api/v2/gpg_keys_controller.rb +1 -1
  11. data/app/controllers/katello/api/v2/host_tracer_controller.rb +0 -5
  12. data/app/controllers/katello/api/v2/products_bulk_actions_controller.rb +15 -0
  13. data/app/controllers/katello/api/v2/repositories_controller.rb +24 -14
  14. data/app/controllers/katello/api/v2/subscriptions_controller.rb +1 -1
  15. data/app/controllers/katello/concerns/api/v2/{associations_permission_check.rb → authorization.rb} +20 -2
  16. data/app/controllers/katello/concerns/hosts_controller_extensions.rb +11 -5
  17. data/app/helpers/katello/content_view_helper.rb +1 -1
  18. data/app/lib/actions/candlepin/product/content_add.rb +1 -2
  19. data/app/lib/actions/katello/capsule_content/refresh_repos.rb +1 -1
  20. data/app/lib/actions/katello/capsule_content/sync.rb +2 -2
  21. data/app/lib/actions/katello/capsule_content/sync_capsule.rb +17 -3
  22. data/app/lib/actions/katello/content_view/capsule_sync.rb +1 -1
  23. data/app/lib/actions/katello/content_view/destroy.rb +2 -2
  24. data/app/lib/actions/katello/content_view/incremental_updates.rb +1 -1
  25. data/app/lib/actions/katello/content_view/promote_to_environment.rb +1 -0
  26. data/app/lib/actions/katello/content_view/publish.rb +12 -7
  27. data/app/lib/actions/katello/content_view_puppet_environment/clone.rb +1 -1
  28. data/app/lib/actions/katello/content_view_puppet_environment/create.rb +2 -2
  29. data/app/lib/actions/katello/content_view_version/incremental_update.rb +4 -4
  30. data/app/lib/actions/katello/organization/manifest_delete.rb +1 -0
  31. data/app/lib/actions/katello/organization/manifest_import.rb +1 -0
  32. data/app/lib/actions/katello/organization/manifest_refresh.rb +1 -0
  33. data/app/lib/actions/katello/product/content_create.rb +3 -3
  34. data/app/lib/actions/katello/product/destroy.rb +25 -4
  35. data/app/lib/actions/katello/repository/clone_contents.rb +3 -3
  36. data/app/lib/actions/katello/repository/clone_to_environment.rb +2 -2
  37. data/app/lib/actions/katello/repository/clone_to_version.rb +1 -1
  38. data/app/lib/actions/katello/repository/create.rb +1 -1
  39. data/app/lib/actions/katello/repository/destroy.rb +10 -4
  40. data/app/lib/actions/katello/repository/export.rb +3 -3
  41. data/app/lib/actions/katello/repository/finish_upload.rb +2 -2
  42. data/app/lib/actions/katello/repository/import_upload.rb +3 -3
  43. data/app/lib/actions/katello/repository/metadata_generate.rb +1 -1
  44. data/app/lib/actions/katello/repository/multi_clone_contents.rb +6 -10
  45. data/app/lib/actions/katello/repository/purge_empty_content.rb +1 -1
  46. data/app/lib/actions/katello/repository/remove_content.rb +1 -1
  47. data/app/lib/actions/katello/repository/sync.rb +35 -25
  48. data/app/lib/actions/katello/repository/update.rb +30 -19
  49. data/app/lib/actions/katello/repository/update_http_proxy_details.rb +1 -1
  50. data/app/lib/actions/katello/repository/update_metadata_sync.rb +1 -1
  51. data/app/lib/actions/katello/repository/upload_files.rb +2 -2
  52. data/app/lib/actions/katello/repository/verify_checksum.rb +28 -0
  53. data/app/lib/actions/pulp/content_view_puppet_environment/copy_contents.rb +1 -1
  54. data/app/lib/actions/pulp/orchestration/orphan_cleanup/remove_orphans.rb +1 -1
  55. data/app/lib/actions/pulp/orchestration/repository/sync.rb +2 -1
  56. data/app/lib/actions/pulp/repository/copy_all_units.rb +1 -1
  57. data/app/lib/actions/pulp/repository/copy_units.rb +1 -1
  58. data/app/lib/actions/pulp/repository/create.rb +1 -1
  59. data/app/lib/actions/pulp/repository/destroy.rb +1 -1
  60. data/app/lib/actions/pulp/repository/remove_units.rb +2 -2
  61. data/app/lib/actions/pulp/repository/sync.rb +3 -2
  62. data/app/lib/actions/pulp3/capsule_content/sync.rb +3 -1
  63. data/app/lib/actions/pulp3/content_guard/refresh_all_distributions.rb +19 -0
  64. data/app/lib/actions/pulp3/content_migration.rb +3 -3
  65. data/app/lib/actions/pulp3/content_view_version/create_exporter.rb +20 -0
  66. data/app/lib/actions/pulp3/content_view_version/destroy_exporter.rb +16 -0
  67. data/app/lib/actions/pulp3/content_view_version/export.rb +19 -0
  68. data/app/lib/actions/pulp3/import_migration.rb +3 -3
  69. data/app/lib/actions/pulp3/orchestration/content_view_version/export.rb +69 -0
  70. data/app/lib/actions/pulp3/orchestration/repository/copy_all_units.rb +1 -2
  71. data/app/lib/actions/pulp3/orchestration/repository/create.rb +1 -1
  72. data/app/lib/actions/pulp3/orchestration/repository/sync.rb +3 -1
  73. data/app/lib/actions/pulp3/orchestration/repository/trigger_update_repo_cert_guard.rb +22 -0
  74. data/app/lib/actions/pulp3/orchestration/repository/upload_content.rb +1 -1
  75. data/app/lib/actions/pulp3/repository/copy_content.rb +0 -1
  76. data/app/lib/actions/pulp3/repository/multi_copy_units.rb +2 -2
  77. data/app/lib/actions/pulp3/repository/presenters/repair_presenter.rb +85 -0
  78. data/app/lib/actions/pulp3/repository/refresh_distribution.rb +11 -5
  79. data/app/lib/actions/pulp3/repository/repair.rb +29 -0
  80. data/app/lib/actions/pulp3/repository/save_artifact.rb +1 -1
  81. data/app/lib/actions/pulp3/repository/save_distribution_references.rb +2 -2
  82. data/app/lib/actions/pulp3/repository/save_version.rb +20 -16
  83. data/app/lib/actions/pulp3/repository/save_versions.rb +1 -1
  84. data/app/lib/actions/pulp3/repository/sync.rb +1 -1
  85. data/app/lib/actions/pulp3/repository/update_cv_repository_cert_guard.rb +6 -2
  86. data/app/lib/actions/pulp3/repository/upload_file.rb +2 -2
  87. data/app/lib/katello/concerns/base_template_scope_extensions.rb +5 -3
  88. data/app/lib/katello/concerns/permission_extensions.rb +14 -0
  89. data/app/lib/katello/foreman.rb +1 -1
  90. data/app/lib/katello/resources/candlepin/product.rb +0 -11
  91. data/app/lib/katello/resources/registry.rb +3 -3
  92. data/app/models/katello/authorization/content_view_version_export_history.rb +11 -0
  93. data/app/models/katello/authorization/product.rb +4 -0
  94. data/app/models/katello/authorization/repository.rb +8 -0
  95. data/app/models/katello/concerns/content_facet_host_extensions.rb +2 -1
  96. data/app/models/katello/concerns/organization_extensions.rb +6 -1
  97. data/app/models/katello/concerns/pulp_database_unit.rb +2 -2
  98. data/app/models/katello/concerns/redhat_extensions.rb +4 -2
  99. data/app/models/katello/concerns/smart_proxy_extensions.rb +33 -16
  100. data/app/models/katello/concerns/subscription_facet_host_extensions.rb +1 -1
  101. data/app/models/katello/content_view.rb +1 -1
  102. data/app/models/katello/content_view_package_filter.rb +1 -1
  103. data/app/models/katello/content_view_puppet_environment.rb +1 -1
  104. data/app/models/katello/content_view_version.rb +3 -1
  105. data/app/models/katello/content_view_version_export_history.rb +22 -0
  106. data/app/models/katello/docker_meta_tag.rb +1 -1
  107. data/app/models/katello/errata_status.rb +21 -12
  108. data/app/models/katello/erratum.rb +1 -1
  109. data/app/models/katello/glue/candlepin/owner.rb +4 -2
  110. data/app/models/katello/glue/pulp/repo.rb +3 -1
  111. data/app/models/katello/host/content_facet.rb +8 -0
  112. data/app/models/katello/kt_environment.rb +1 -1
  113. data/app/models/katello/package_group.rb +1 -1
  114. data/app/models/katello/ping.rb +8 -3
  115. data/app/models/katello/pulp3/content_guard.rb +1 -1
  116. data/app/models/katello/purpose_status.rb +2 -2
  117. data/app/models/katello/repository.rb +23 -15
  118. data/app/models/katello/rhsm_fact_parser.rb +1 -1
  119. data/app/models/katello/root_repository.rb +2 -15
  120. data/app/models/katello/sync_plan.rb +8 -0
  121. data/app/models/setting/content.rb +3 -1
  122. data/app/services/cert/certs.rb +10 -2
  123. data/app/services/katello/candlepin/event_handler.rb +1 -0
  124. data/app/services/katello/host_status_manager.rb +7 -0
  125. data/app/services/katello/pulp/content.rb +1 -1
  126. data/app/services/katello/pulp/repository.rb +7 -7
  127. data/app/services/katello/pulp/repository/deb.rb +2 -2
  128. data/app/services/katello/pulp/repository/docker.rb +5 -5
  129. data/app/services/katello/pulp/repository/file.rb +2 -2
  130. data/app/services/katello/pulp/repository/ostree.rb +2 -2
  131. data/app/services/katello/pulp/repository/puppet.rb +2 -2
  132. data/app/services/katello/pulp/repository/yum.rb +5 -6
  133. data/app/services/katello/pulp/smart_proxy_repository.rb +1 -1
  134. data/app/services/katello/pulp3/ansible_collection.rb +2 -2
  135. data/app/services/katello/pulp3/api/core.rb +16 -0
  136. data/app/services/katello/pulp3/content.rb +3 -3
  137. data/app/services/katello/pulp3/content_view_version/export.rb +71 -0
  138. data/app/services/katello/pulp3/distribution.rb +2 -2
  139. data/app/services/katello/pulp3/docker_blob.rb +2 -2
  140. data/app/services/katello/pulp3/docker_manifest.rb +2 -2
  141. data/app/services/katello/pulp3/docker_manifest_list.rb +2 -2
  142. data/app/services/katello/pulp3/docker_tag.rb +2 -2
  143. data/app/services/katello/pulp3/erratum.rb +2 -2
  144. data/app/services/katello/pulp3/file_unit.rb +2 -2
  145. data/app/services/katello/pulp3/migration.rb +139 -34
  146. data/app/services/katello/pulp3/migration_plan.rb +50 -14
  147. data/app/services/katello/pulp3/migration_switchover.rb +41 -9
  148. data/app/services/katello/pulp3/module_stream.rb +2 -2
  149. data/app/services/katello/pulp3/package_group.rb +2 -2
  150. data/app/services/katello/pulp3/repository.rb +9 -9
  151. data/app/services/katello/pulp3/repository/docker.rb +18 -10
  152. data/app/services/katello/pulp3/repository/yum.rb +25 -13
  153. data/app/services/katello/pulp3/repository_mirror.rb +2 -1
  154. data/app/services/katello/pulp3/rpm.rb +2 -2
  155. data/app/services/katello/pulp3/smart_proxy_mirror_repository.rb +2 -2
  156. data/app/services/katello/pulp3/smart_proxy_repository.rb +1 -1
  157. data/app/services/katello/pulp3/srpm.rb +2 -2
  158. data/app/services/katello/pulp3/task_group.rb +1 -1
  159. data/app/services/katello/pulp3/yum_metadata_file.rb +2 -2
  160. data/app/services/katello/registration_manager.rb +9 -3
  161. data/app/services/katello/repository_type.rb +1 -1
  162. data/app/services/katello/smart_proxy_helper.rb +14 -17
  163. data/app/views/foreman/job_templates/install_errata_-_katello_ansible_default.erb +10 -2
  164. data/app/views/katello/api/v2/content_view_repositories/show_all.json.rabl +8 -0
  165. data/app/views/katello/api/v2/content_view_version_export_histories/index.json.rabl +7 -0
  166. data/app/views/katello/api/v2/content_view_version_export_histories/show.json.rabl +13 -0
  167. data/app/views/katello/api/v2/package_groups/show.json.rabl +1 -1
  168. data/app/views/katello/api/v2/packages/show.json.rabl +1 -1
  169. data/app/views/katello/api/v2/repositories/base.json.rabl +2 -1
  170. data/app/views/katello/api/v2/srpms/show.json.rabl +1 -1
  171. data/app/views/katello/api/v2/sync_plans/show.json.rabl +2 -1
  172. data/config/routes/api/rhsm.rb +1 -0
  173. data/config/routes/api/v2.rb +8 -1
  174. data/db/migrate/20200818040551_add_content_view_version_export_history.rb +13 -0
  175. data/db/migrate/20200818192230_update_system_purpose_status.rb +12 -0
  176. data/db/migrate/20200820145217_add_download_concurrency_to_katello_root_repositories.rb +5 -0
  177. data/db/migrate/20200910140340_remove_distribution_uuid.rb +5 -0
  178. data/db/migrate/20200914200906_remove_auto_enabled.rb +5 -0
  179. data/engines/bastion/app/assets/javascripts/bastion/bastion.js +1 -0
  180. data/engines/bastion/app/assets/javascripts/bastion/routing.module.js +1 -1
  181. data/engines/bastion/vendor/assets/javascripts/bastion/angular-ui-router/stateEvents.js +300 -0
  182. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/activation-keys.controller.js +1 -1
  183. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-add-subscriptions.controller.js +1 -1
  184. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-associations.controller.js +1 -1
  185. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-subscriptions.controller.js +1 -1
  186. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-products.controller.js +1 -1
  187. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-repositories.controller.js +1 -1
  188. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-errata-modal.controller.js +1 -1
  189. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-host-collections-modal.controller.js +1 -1
  190. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-module-streams-modal.controller.js +1 -1
  191. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-repository-sets-modal.controller.js +1 -1
  192. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-subscriptions-modal.controller.js +1 -1
  193. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-traces-modal.controller.js +1 -1
  194. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts-helper.service.js +1 -1
  195. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts.controller.js +1 -1
  196. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-debs-installed.controller.js +1 -1
  197. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-errata.controller.js +1 -1
  198. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-module-streams.controller.js +1 -1
  199. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-packages-applicable.controller.js +1 -1
  200. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-packages-installed.controller.js +1 -1
  201. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-traces.controller.js +1 -1
  202. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-add-host-collections.controller.js +1 -1
  203. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-add-subscriptions.controller.js +1 -1
  204. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-details-info.controller.js +4 -2
  205. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-host-collections.controller.js +1 -1
  206. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-subscriptions.controller.js +1 -1
  207. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-info.html +2 -2
  208. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/content-views.controller.js +1 -1
  209. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/components/content-view-composite-available-content-views.controller.js +1 -1
  210. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/components/content-view-composite-content-views-list.controller.js +1 -1
  211. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-available-docker-repositories.controller.js +1 -1
  212. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-available-ostree-repositories.controller.js +1 -1
  213. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-docker-repositories-list.controller.js +1 -1
  214. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-ostree-repositories-list.controller.js +1 -1
  215. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-versions.controller.js +1 -1
  216. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/available-errata-filter.controller.js +1 -1
  217. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/available-package-group-filter.controller.js +1 -1
  218. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/puppet-modules/content-view-puppet-module-names.controller.js +1 -1
  219. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/puppet-modules/content-view-puppet-module-versions.controller.js +1 -1
  220. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/puppet-modules/content-view-puppet-modules.controller.js +1 -1
  221. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/content-view-version-content.controller.js +1 -1
  222. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/debs/debs.controller.js +1 -1
  223. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/debs/details/deb-content-views.controller.js +1 -1
  224. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/debs/details/deb-repositories.controller.js +1 -1
  225. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/environment-content.controller.js +1 -1
  226. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/erratum-repositories.controller.js +1 -1
  227. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/files/details/file-content-views.controller.js +1 -1
  228. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/files/details/file-repositories.controller.js +1 -1
  229. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/files/files.controller.js +1 -1
  230. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/host-collections.controller.js +1 -1
  231. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/de.po +57 -12
  232. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/es.po +45 -8
  233. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/fr.po +42 -5
  234. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/it.po +36 -0
  235. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ja.po +36 -0
  236. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ko.po +36 -0
  237. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/pt_BR.po +45 -8
  238. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ru.po +36 -0
  239. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/zh_CN.po +36 -0
  240. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/zh_TW.po +36 -0
  241. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/translations.js +4 -4
  242. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/fenced-pages.service.js +11 -2
  243. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/organization-selector.controller.js +5 -14
  244. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/details/ostree-branch-repositories.controller.js +1 -1
  245. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/package-repositories.controller.js +1 -1
  246. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/packages.controller.js +1 -1
  247. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/bulk/product-bulk-action.factory.js +1 -0
  248. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/bulk/products-bulk-sync-plan-modal.controller.js +1 -1
  249. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/product-repositories.controller.js +1 -1
  250. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-manage-content.controller.js +1 -1
  251. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details.controller.js +6 -0
  252. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-details.html +7 -1
  253. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +0 -9
  254. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/new-repository.controller.js +1 -1
  255. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/views/new-repository.html +0 -11
  256. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/repository.factory.js +1 -0
  257. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/products.controller.js +16 -1
  258. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/views/products.html +6 -0
  259. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/puppet-modules/details/puppet-module-content-views.controller.js +1 -1
  260. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/puppet-modules/details/puppet-module-repositories.controller.js +1 -1
  261. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/puppet-modules/puppet-modules.controller.js +1 -1
  262. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/details/sync-plan-details-info.controller.js +4 -3
  263. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/details/views/sync-plan-info.html +1 -1
  264. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/sync-plans.controller.js +1 -1
  265. data/lib/katello/engine.rb +2 -0
  266. data/lib/katello/permission_creator.rb +14 -9
  267. data/lib/katello/tasks/clean_published_repo_directories.rake +3 -3
  268. data/lib/katello/tasks/pulp3_content_switchover.rake +24 -6
  269. data/lib/katello/tasks/pulp3_migration.rake +4 -2
  270. data/lib/katello/tasks/pulp3_post_migration_check.rake +2 -2
  271. data/lib/katello/tasks/reimport.rake +1 -1
  272. data/lib/katello/tasks/repository.rake +15 -2
  273. data/lib/katello/tasks/unify_hosts.rake +1 -0
  274. data/lib/katello/tasks/upgrades/3.11/update_puppet_repos.rake +3 -3
  275. data/lib/katello/tasks/upgrades/3.12/remove_pulp2_notifier.rake +2 -2
  276. data/lib/katello/tasks/upgrades/3.8/clear_checksum_type.rake +2 -2
  277. data/lib/katello/version.rb +1 -1
  278. data/locale/action_names.rb +47 -47
  279. data/locale/katello.pot +160 -160
  280. data/webpack/containers/Application/config.js +4 -4
  281. data/webpack/redux/actions/RedHatRepositories/helpers.js +1 -1
  282. data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +22 -32
  283. data/webpack/scenes/Subscriptions/Manifest/__tests__/SimpleContentAccess.test.js +0 -14
  284. data/webpack/scenes/Subscriptions/Manifest/index.js +2 -5
  285. data/webpack/scenes/Subscriptions/SubscriptionReducer.js +15 -6
  286. data/webpack/scenes/Subscriptions/SubscriptionsPage.js +0 -1
  287. data/webpack/scenes/Subscriptions/SubscriptionsSelectors.js +3 -0
  288. data/webpack/scenes/Subscriptions/__tests__/SubscriptionsReducer.test.js +24 -0
  289. data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsReducer.test.js.snap +114 -26
  290. metadata +67 -33
  291. data/app/lib/actions/candlepin/product/content_update_enablement.rb +0 -18
  292. data/app/lib/actions/katello/repository/content_update.rb +0 -41
  293. data/app/lib/actions/katello/repository/update_cv_repo_cert_guard.rb +0 -17
@@ -5,7 +5,7 @@ module Katello
5
5
  CONTENT_TYPE = "file".freeze
6
6
 
7
7
  def self.content_api
8
- PulpFileClient::ContentFilesApi.new(Katello::Pulp3::Api::File.new(SmartProxy.pulp_master!).api_client)
8
+ PulpFileClient::ContentFilesApi.new(Katello::Pulp3::Api::File.new(SmartProxy.pulp_primary!).api_client)
9
9
  end
10
10
 
11
11
  def self.create_content(options)
@@ -14,7 +14,7 @@ module Katello
14
14
  end
15
15
 
16
16
  def self.ids_for_repository(repo_id)
17
- repo = Katello::Pulp3::Repository::File.new(Katello::Repository.find(repo_id), SmartProxy.pulp_master)
17
+ repo = Katello::Pulp3::Repository::File.new(Katello::Repository.find(repo_id), SmartProxy.pulp_primary)
18
18
  repo_content_list = repo.content_list
19
19
  repo_content_list.map { |content| content.try(:pulp_href) }
20
20
  end
@@ -3,20 +3,27 @@ require 'pulp_2to3_migration_client'
3
3
  module Katello
4
4
  module Pulp3
5
5
  class Migration
6
- attr_accessor :smart_proxy
6
+ attr_accessor :smart_proxy, :reimport_all
7
7
  GET_QUERY_ID_LENGTH = 90
8
8
 
9
- REPOSITORY_TYPES = [
10
- Katello::Repository::FILE_TYPE,
11
- Katello::Repository::DOCKER_TYPE
12
- ].freeze
13
-
14
9
  MUTABLE_CONTENT_TYPES = [
15
10
  Katello::DockerTag,
16
11
  Katello::Erratum
17
12
  ].freeze
18
13
 
19
- def initialize(smart_proxy, repository_types = REPOSITORY_TYPES)
14
+ UNIFIED_CONTENT_TYPES = [
15
+ Katello::Erratum
16
+ ].freeze
17
+
18
+ def self.repository_types_for_migration
19
+ #we can migrate types that pulp3 supports, but are overridden to pulp2. These are in 'migration mode'
20
+ overridden = (SETTINGS[:katello][:use_pulp_2_for_content_type] || {}).keys.select { |key| SETTINGS[:katello][:use_pulp_2_for_content_type][key] }
21
+ overridden.select { |type| SmartProxy.pulp_primary.pulp3_repository_type_support?(type.to_s, false) }.map { |t| t.to_s }
22
+ end
23
+
24
+ def initialize(smart_proxy, repository_types = Migration.repository_types_for_migration, options = {})
25
+ self.reimport_all = options.fetch(:reimport, false)
26
+
20
27
  if (repository_types - smart_proxy.supported_pulp_types[:pulp3][:overriden_to_pulp2]).any?
21
28
  fail ::Katello::Errors::Pulp3MigrationError, _("Pulp 3 migration cannot run. Types %s have already been migrated.") %
22
29
  (repository_types - smart_proxy.supported_pulp_types[:pulp3][:overriden_to_pulp2]).join(', ')
@@ -47,7 +54,12 @@ module Katello
47
54
  end
48
55
 
49
56
  def create_and_run_migrations
50
- create_migrations.map { |href| start_migration(href) }
57
+ migs = create_migrations
58
+ migs.map { |href| start_migration(href) }
59
+ end
60
+
61
+ def self.ignorable_content_types
62
+ [YumMetadataFile]
51
63
  end
52
64
 
53
65
  def content_types_for_migration
@@ -55,35 +67,79 @@ module Katello
55
67
  Katello::RepositoryTypeManager.repository_types[repository_type_label].content_types_to_index
56
68
  end
57
69
 
58
- content_types.flatten
70
+ content_types.flatten - Migration.ignorable_content_types
59
71
  end
60
72
 
61
73
  def import_pulp3_content
62
- @repository_types.each do |repository_type_label|
63
- Katello::RepositoryTypeManager.repository_types[repository_type_label].content_types_to_index.each do |content_type|
64
- import_content_type(content_type)
74
+ Katello::Logging.time("CONTENT_MIGRATION - Total Import Process") do
75
+ @repository_types.each do |repository_type_label|
76
+ Katello::Logging.time("CONTENT_MIGRATION - Importing Repository", data: {type: repository_type_label}) do
77
+ import_repositories(repository_type_label)
78
+ end
79
+
80
+ Katello::RepositoryTypeManager.repository_types[repository_type_label].content_types_to_index.each do |content_type|
81
+ Katello::Logging.time("CONTENT_MIGRATION - Importing Content", data: {type: content_type}) do
82
+ import_content_type(content_type)
83
+ end
84
+ end
65
85
  end
66
- import_repositories(repository_type_label)
67
86
  end
68
87
  end
69
88
 
89
+ def migration_plan
90
+ Katello::Pulp3::MigrationPlan.new(@repository_types).generate.as_json
91
+ end
92
+
70
93
  def create_migrations
71
- plan = Katello::Pulp3::MigrationPlan.new(@repository_types)
72
- Rails.logger.info(plan)
73
- [migration_plan_api.create(plan: plan.generate.as_json).pulp_href]
94
+ plan = migration_plan
95
+ Rails.logger.info("Migration Plan: #{plan}")
96
+
97
+ if plan['plugins'].empty?
98
+ Rails.logger.error("No Repositories to migrate")
99
+ []
100
+ else
101
+ [migration_plan_api.create(plan: plan).pulp_href]
102
+ end
74
103
  end
75
104
 
76
105
  def start_migration(plan_href)
77
- migration_plan_api.run(plan_href, dry_run: false)
106
+ migration_plan_api.run(plan_href, dry_run: false, validate: true)
78
107
  end
79
108
 
80
109
  def import_repositories(repository_type_label)
81
110
  imported = Katello::Pulp3::Api::Core.fetch_from_list { |opts| pulp2_repositories_api.list(opts) }
82
111
  imported = imported.select { |migrated| !migrated.not_in_plan }
112
+ katello_repos = Katello::Repository.with_type(repository_type_label)
113
+
114
+ if repository_type_label == 'yum'
115
+ import_yum_repos(imported, katello_repos)
116
+ else
117
+ katello_repos.each do |repo|
118
+ found = imported.find { |migrated_repo| migrated_repo.pulp2_repo_id == repo.pulp_id }
119
+ import_repo(repo, found) if found
120
+ end
121
+ end
122
+ end
83
123
 
84
- Katello::Repository.with_type(repository_type_label).each do |repo|
85
- found = imported.find { |migrated_repo| migrated_repo.pulp2_repo_id == repo.pulp_id }
86
- import_repo(repo, found) if found
124
+ def import_yum_repos(migrated_repo_items, repos)
125
+ repos.each do |yum_repo|
126
+ to_find = nil
127
+ if yum_repo.content_view.composite?
128
+ if yum_repo.link?
129
+ to_find = yum_repo.target_repository
130
+ else
131
+ to_find = yum_repo
132
+ end
133
+ elsif yum_repo.environment_id.nil? || yum_repo.in_default_view? #non-composite archive repo or default content view repo
134
+ to_find = yum_repo
135
+ else #non-composite env-repo
136
+ to_find = yum_repo.archived_instance
137
+ end
138
+
139
+ if to_find
140
+ found = migrated_repo_items.find { |migrated_repo| migrated_repo.pulp2_repo_id == to_find.pulp_id }
141
+ import_repo(yum_repo, found)
142
+ end
87
143
  end
88
144
  end
89
145
 
@@ -92,7 +148,7 @@ module Katello
92
148
  end
93
149
 
94
150
  def import_repo(katello_repo, migrated_repo)
95
- pulp3_api = api_for_repository(katello_repo).new(SmartProxy.pulp_master)
151
+ pulp3_api = api_for_repository(katello_repo).new(SmartProxy.pulp_primary)
96
152
  katello_repo.remote_href = migrated_repo.pulp3_remote_href
97
153
  katello_repo.publication_href = migrated_repo.pulp3_publication_href
98
154
  katello_repo.version_href = migrated_repo.pulp3_repository_version
@@ -105,9 +161,7 @@ module Katello
105
161
  end
106
162
 
107
163
  repo_ref = Katello::Pulp3::RepositoryReference.find_or_initialize_by(:root_repository_id => katello_repo.root_id, :content_view_id => katello_repo.content_view.id)
108
- repo_ref.repository_href = migrated_repo.pulp3_repository_href
109
- repo_ref.save!
110
-
164
+ repo_ref.update!(repository_href: migrated_repo.pulp3_repository_href) if repo_ref.repository_href != migrated_repo.pulp3_repository_href
111
165
  process_distributions(pulp3_api, migrated_repo.pulp3_distribution_hrefs)
112
166
  end
113
167
 
@@ -125,18 +179,69 @@ module Katello
125
179
  end
126
180
  end
127
181
 
128
- def import_content_type(content_type)
129
- unmigrated_units = content_type.model_class
130
- #mutable content types have to be completely re-indexed every time
131
- unless MUTABLE_CONTENT_TYPES.include?(content_type.model_class)
132
- unmigrated_units = unmigrated_units.where(:migrated_pulp3_href => nil)
182
+ def generate_repo_version_map
183
+ map = {}
184
+ Katello::Repository.select(:id, :version_href).each do |repo|
185
+ map[repo.version_href] ||= []
186
+ map[repo.version_href] << repo.id
187
+ end
188
+ map
189
+ end
190
+
191
+ def operate_on_errata
192
+ offset = 0
193
+ limit = 300
194
+ response = pulp2_content_api.list(pulp2_content_type_id: 'erratum', offset: offset, limit: limit)
195
+ total_count = response.count
196
+ yield(response.results)
197
+ until (offset + limit > total_count)
198
+ offset += limit
199
+ response = pulp2_content_api.list(pulp2_content_type_id: 'erratum', offset: offset, limit: limit)
200
+ yield(response.results)
201
+ end
202
+ end
203
+
204
+ def import_errata
205
+ to_import = {}
206
+
207
+ repo_version_map = generate_repo_version_map
208
+
209
+ operate_on_errata do |migrated_list|
210
+ katello_errata = Katello::Erratum.where(:pulp_id => migrated_list.map(&:pulp2_id).uniq)
211
+ migrated_list.each do |migrated_unit|
212
+ pulp3_href = migrated_unit.pulp3_content
213
+ errata_id = katello_errata.find { |erratum| erratum.pulp_id == migrated_unit.pulp2_id }&.id
214
+ next if errata_id.nil?
215
+ repo_ids = repo_version_map[migrated_unit.pulp3_repository_version]
216
+ #currently pulp can have duplicates, so de-duplicate with a hash
217
+ repo_ids&.each do |repo_id|
218
+ #currently pulp can have duplicates, so de-duplicate with a hash
219
+ to_import[[errata_id, repo_id]] ||= {erratum_id: errata_id, erratum_pulp3_href: pulp3_href, repository_id: repo_id}
220
+ end
221
+ end
133
222
  end
134
- unmigrated_units.select(:id, :pulp_id).find_in_batches(batch_size: GET_QUERY_ID_LENGTH) do |needing_hrefs|
135
- migrated_units = pulp2_content_api.list(pulp2_id__in: needing_hrefs.map { |unit| unit.pulp_id }.join(','))
136
- migrated_units.results.each do |migrated_unit|
137
- matching_record = needing_hrefs.find { |db_unit| db_unit.pulp_id == migrated_unit.pulp2_id }
138
223
 
139
- matching_record&.update_column(:migrated_pulp3_href, migrated_unit.pulp3_content)
224
+ Katello::RepositoryErratum.import([:erratum_id, :erratum_pulp3_href, :repository_id], to_import.values, :validate => false,
225
+ on_duplicate_key_update: {conflict_target: [:erratum_id, :repository_id], columns: [:erratum_pulp3_href]})
226
+ end
227
+
228
+ def import_content_type(content_type)
229
+ if content_type.model_class == Katello::Erratum
230
+ import_errata
231
+ else
232
+ unmigrated_units = content_type.model_class
233
+
234
+ #mutable content types have to be completely re-indexed every time
235
+ if !MUTABLE_CONTENT_TYPES.include?(content_type.model_class) && !self.reimport_all
236
+ unmigrated_units = unmigrated_units.where(:migrated_pulp3_href => nil)
237
+ end
238
+
239
+ unmigrated_units.select(:id, :pulp_id).find_in_batches(batch_size: GET_QUERY_ID_LENGTH) do |needing_hrefs|
240
+ migrated_units = pulp2_content_api.list(pulp2_id__in: needing_hrefs.map { |unit| unit.pulp_id }.join(','))
241
+ migrated_units.results.each do |migrated_unit|
242
+ matching_record = needing_hrefs.find { |db_unit| db_unit.pulp_id == migrated_unit.pulp2_id }
243
+ matching_record&.update_column(:migrated_pulp3_href, migrated_unit.pulp3_content)
244
+ end
140
245
  end
141
246
  end
142
247
  end
@@ -5,19 +5,21 @@ module Katello
5
5
  @repository_types = repository_type_labels
6
6
  end
7
7
 
8
- def master_proxy
9
- SmartProxy.pulp_master!
8
+ def primary_proxy
9
+ SmartProxy.pulp_primary!
10
10
  end
11
11
 
12
12
  def generate
13
13
  plan = {}
14
- plan[:plugins] = generate_plugins
14
+ Katello::Logging.time("CONTENT_MIGRATION - Generating Migration plan") do
15
+ plan[:plugins] = generate_plugins
16
+ end
15
17
  Rails.logger.error("Migration Plan: #{plan.to_json}")
16
18
  plan
17
19
  end
18
20
 
19
21
  def generate_plugins
20
- @repository_types.map do |repository_type|
22
+ @repository_types.sort.map do |repository_type|
21
23
  {
22
24
  type: pulp2_repository_type(repository_type),
23
25
  repositories: repository_migrations(repository_type)
@@ -26,17 +28,21 @@ module Katello
26
28
  end
27
29
 
28
30
  def pulp2_repository_type(repository_type)
29
- Katello::RepositoryTypeManager.repository_types[repository_type].service_class::REPOSITORY_TYPE
31
+ if repository_type == 'yum'
32
+ return 'rpm' #migration plugin uses rpm
33
+ else
34
+ Katello::RepositoryTypeManager.repository_types[repository_type].service_class::REPOSITORY_TYPE
35
+ end
30
36
  end
31
37
 
32
38
  def repository_migrations(repo_type)
33
- roots = Katello::RootRepository.where(:content_type => repo_type)
39
+ roots = Katello::RootRepository.where(:content_type => repo_type).order(:label)
34
40
  plans = []
35
41
  roots.each do |root|
36
42
  plans << library_migration_for(root)
37
43
  plans += content_view_migrations_for(root)
38
44
  end
39
- plans
45
+ plans.compact.sort_by { |plan| plan[:name] }
40
46
  end
41
47
 
42
48
  # plugins: [
@@ -73,28 +79,58 @@ module Katello
73
79
 
74
80
  def content_view_migrations_for(root)
75
81
  plans = []
76
- ContentView.non_default.published_with_repositories(root).each do |cv|
82
+ ContentView.non_default.published_with_repositories(root).sort_by(&:label).each do |cv|
77
83
  plans << content_view_migration(cv, root)
78
84
  end
79
85
  plans
80
86
  end
81
87
 
88
+ #since we don't have an easy to look up all 'link' repos for a target, lets
89
+ # pre-generate a map of all target_repo => link_repos
90
+ # This is a fairly inefficient way to do this, but its quite a complex calculation to use AR
91
+ def target_link_map
92
+ return @target_link_map if @target_link_map
93
+
94
+ map = {}
95
+ composites_with_repo = ::Katello::ContentViewVersion.where(:content_view_id => ContentView.composite)
96
+ env_repos = Katello::Repository.yum_type.where(:content_view_version_id => composites_with_repo)
97
+ env_repos.each do |link_repo|
98
+ if link_repo.link?
99
+ target = link_repo.target_repository
100
+ map[target] ||= []
101
+ map[target] << link_repo
102
+ end
103
+ end
104
+ @target_link_map = map
105
+ end
106
+
107
+ def name_for_content_view(content_view, root_repo)
108
+ "#{content_view.label}-#{root_repo.label}"
109
+ end
110
+
82
111
  def content_view_migration(content_view, root)
83
112
  plan = {
84
- name: "#{content_view.name}-#{root.id}-#{content_view.id}",
113
+ name: name_for_content_view(content_view, root),
85
114
  repository_versions: []
86
115
  }
87
116
  library_instance = root.library_instance
88
117
  content_view.versions.with_library_repo(library_instance).uniq.each do |version|
89
- repo = version.archived_repos.find_by(:library_instance_id => library_instance.id)
90
- env_repos = version.repositories.where(:library_instance_id => library_instance.id).where.not(:environment_id => nil)
118
+ archived_repo = version.archived_repos.find_by(:library_instance_id => library_instance.id)
119
+ next if archived_repo.link?
120
+
121
+ env_repos = version.repositories.where(:library_instance_id => library_instance.id)
122
+ env_repos += target_link_map[archived_repo] if target_link_map[archived_repo]
123
+
91
124
  plan[:repository_versions] << {
92
- pulp2_repository_id: repo.pulp_id,
93
- pulp2_distributor_repository_ids: env_repos.map(&:pulp_id)
125
+ pulp2_repository_id: archived_repo.pulp_id,
126
+ pulp2_distributor_repository_ids: env_repos.map(&:pulp_id).uniq.sort
94
127
  }
95
128
  end
96
129
 
97
- plan
130
+ if plan[:repository_versions].any?
131
+ plan[:repository_versions].sort_by! { |v| v[:pulp2_repository_id] }
132
+ plan
133
+ end
98
134
  end
99
135
  end
100
136
  end
@@ -2,7 +2,7 @@ require 'pulp_2to3_migration_client'
2
2
 
3
3
  module Katello
4
4
  module Pulp3
5
- class SwitchoverError < StandardError; end
5
+ class SwitchOverError < StandardError; end
6
6
 
7
7
  class MigrationSwitchover
8
8
  def initialize(*argv)
@@ -14,11 +14,19 @@ module Katello
14
14
  end
15
15
 
16
16
  def run
17
- check_already_migrated_content
18
- cleanup_v1_docker_tags if docker_migration?
19
- migrated_content_type_check
20
- combine_duplicate_docker_tags if docker_migration?
21
- migrate_pulp3_hrefs
17
+ Katello::Logging.time("CONTENT_SWITCHOVER - Total Switchover Process") do
18
+ Katello::Logging.time("CONTENT_SWITCHOVER - check_already_migrated_content") { check_already_migrated_content }
19
+ Katello::Logging.time("CONTENT_SWITCHOVER - cleanup_v1_docker_tags") { cleanup_v1_docker_tags } if docker_migration?
20
+ Katello::Logging.time("CONTENT_SWITCHOVER - migrated_content_type_check") { migrated_content_type_check }
21
+ Katello::Logging.time("CONTENT_SWITCHOVER - combine_duplicate_content_types") { combine_duplicate_content_types }
22
+ Katello::Logging.time("CONTENT_SWITCHOVER - combine_duplicate_docker_tags") { combine_duplicate_docker_tags } if docker_migration?
23
+ Katello::Logging.time("CONTENT_SWITCHOVER - migrate_pulp3_hrefs") { migrate_pulp3_hrefs }
24
+ end
25
+ end
26
+
27
+ def deduplicated_content_types
28
+ #even though YumMetatadataFile is de-depulicated, we're not indexing it in pulp3
29
+ [Katello::PackageGroup]
22
30
  end
23
31
 
24
32
  def docker_migration?
@@ -34,7 +42,7 @@ module Katello
34
42
  end
35
43
 
36
44
  def check_already_migrated_content
37
- content_types.each do |content_type|
45
+ (content_types - Migration.ignorable_content_types).each do |content_type|
38
46
  if content_type.model_class.where("pulp_id=migrated_pulp3_href").any?
39
47
  Rails.logger.error("Content Switchover: #{content_type.label} seems to have already migrated content, switchover may fail. Did you already perform the switchover?")
40
48
  end
@@ -60,6 +68,22 @@ module Katello
60
68
  Katello::DockerMetaTag.cleanup_tags
61
69
  end
62
70
 
71
+ def combine_duplicate_content_types
72
+ deduplicated_content_types.each do |content_class|
73
+ to_delete = []
74
+ content_class.having("count(migrated_pulp3_href) > 1").group(:migrated_pulp3_href).pluck(:migrated_pulp3_href).each do |duplicate_href|
75
+ units = content_class.where(:migrated_pulp3_href => duplicate_href).to_a
76
+ main_unit = units.pop
77
+ content_class.repository_association_class.where(content_class.unit_id_field => units.map(&:id)).update_all(content_class.unit_id_field => main_unit.id)
78
+ to_delete += units.map(&:id)
79
+ end
80
+
81
+ to_delete.each_slice(10_000) do |group|
82
+ content_class.where(:id => group).delete_all
83
+ end
84
+ end
85
+ end
86
+
63
87
  def combine_duplicate_docker_tags
64
88
  to_delete = []
65
89
  Katello::DockerTag.having("count(migrated_pulp3_href) > 1").group(:migrated_pulp3_href).pluck(:migrated_pulp3_href).each do |duplicate_href|
@@ -84,11 +108,19 @@ module Katello
84
108
 
85
109
  def migrated_content_type_check
86
110
  content_types.each do |content_type|
87
- if content_type.model_class.where(migrated_pulp3_href: nil).any?
88
- fail SwitchoverError, "ERROR: at least one #{content_type.model_class.table_name} record has migrated_pulp3_href NULL value\n"
111
+ if content_type.model_class == Katello::Erratum
112
+ migrated_errata_check
113
+ elsif content_type.model_class.where(migrated_pulp3_href: nil).any?
114
+ fail SwitchOverError, "ERROR: at least one #{content_type.model_class.table_name} record has migrated_pulp3_href NULL value\n"
89
115
  end
90
116
  end
91
117
  end
118
+
119
+ def migrated_errata_check
120
+ if Katello::RepositoryErratum.where(:erratum_pulp3_href => nil).any?
121
+ fail SwitchOverError, "ERROR: at least one Erratum record has migrated_pulp3_href NULL value\n"
122
+ end
123
+ end
92
124
  end
93
125
  end
94
126
  end