katello 4.7.3 → 4.8.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 (333) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/katello/api/registry/registry_proxies_controller.rb +6 -4
  3. data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +15 -12
  4. data/app/controllers/katello/api/v2/capsule_content_controller.rb +0 -4
  5. data/app/controllers/katello/api/v2/content_export_incrementals_controller.rb +22 -81
  6. data/app/controllers/katello/api/v2/content_exports_controller.rb +11 -80
  7. data/app/controllers/katello/api/v2/content_imports_controller.rb +1 -0
  8. data/app/controllers/katello/api/v2/exports_controller.rb +130 -0
  9. data/app/controllers/katello/api/v2/host_subscriptions_controller.rb +7 -8
  10. data/app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb +8 -4
  11. data/app/controllers/katello/api/v2/organizations_controller.rb +3 -0
  12. data/app/controllers/katello/api/v2/package_groups_controller.rb +0 -52
  13. data/app/controllers/katello/concerns/api/v2/bulk_hosts_extensions.rb +4 -6
  14. data/app/controllers/katello/concerns/api/v2/registration_controller_extensions.rb +1 -2
  15. data/app/controllers/katello/concerns/authorization/api/v2/content_views_controller.rb +4 -1
  16. data/app/controllers/katello/concerns/content_facet_hosts_controller_extensions.rb +24 -0
  17. data/app/controllers/katello/concerns/hosts_controller_extensions.rb +3 -3
  18. data/app/helpers/katello/hosts_and_hostgroups_helper.rb +55 -24
  19. data/app/helpers/katello/katello_urls_helper.rb +0 -15
  20. data/app/helpers/katello/sync_management_helper.rb +0 -4
  21. data/app/lib/actions/candlepin/owner/destroy_imports.rb +1 -1
  22. data/app/lib/actions/katello/capsule_content/sync.rb +0 -4
  23. data/app/lib/actions/katello/capsule_content/sync_capsule.rb +1 -2
  24. data/app/lib/actions/katello/content_view/publish.rb +6 -2
  25. data/app/lib/actions/katello/content_view/remove.rb +8 -2
  26. data/app/lib/actions/katello/content_view_version/destroy.rb +1 -1
  27. data/app/lib/actions/katello/environment/destroy.rb +8 -2
  28. data/app/lib/actions/katello/host/reassign.rb +4 -2
  29. data/app/lib/actions/katello/orphan_cleanup/remove_orphans.rb +0 -1
  30. data/app/lib/actions/katello/product/destroy.rb +2 -1
  31. data/app/lib/actions/katello/repository/filtered_index_content.rb +2 -10
  32. data/app/lib/actions/katello/repository/import_upload.rb +0 -1
  33. data/app/lib/actions/katello/repository/sync.rb +0 -1
  34. data/app/lib/actions/katello/repository/update.rb +5 -3
  35. data/app/lib/actions/katello/repository/upload_files.rb +0 -1
  36. data/app/lib/actions/pulp3/abstract.rb +0 -6
  37. data/app/lib/actions/pulp3/content_view/delete_repository_references.rb +1 -2
  38. data/app/lib/actions/pulp3/content_view_version/create_syncable_export_history.rb +4 -0
  39. data/app/lib/actions/pulp3/orchestration/content_view_version/export.rb +1 -0
  40. data/app/lib/actions/pulp3/orchestration/content_view_version/export_repository.rb +7 -2
  41. data/app/lib/actions/pulp3/orchestration/content_view_version/syncable_export.rb +7 -2
  42. data/app/lib/actions/pulp3/repository/refresh_distribution.rb +1 -2
  43. data/app/lib/actions/pulp3/repository/save_distribution_references.rb +2 -2
  44. data/app/lib/katello/concerns/renderer_extensions.rb +1 -1
  45. data/app/lib/katello/event_daemon/runner.rb +12 -9
  46. data/app/lib/katello/resources/candlepin/consumer.rb +6 -6
  47. data/app/lib/katello/resources/candlepin/owner.rb +1 -1
  48. data/app/lib/katello/resources/candlepin/upstream_consumer.rb +3 -4
  49. data/app/lib/katello/resources/candlepin.rb +4 -4
  50. data/app/lib/katello/util/errata.rb +12 -10
  51. data/app/lib/katello/util/search.rb +0 -1
  52. data/app/lib/katello/validators/content_view_environment_org_validator.rb +5 -2
  53. data/app/lib/katello/validators/content_view_environment_validator.rb +1 -2
  54. data/app/lib/katello/validators/generated_content_view_validator.rb +16 -0
  55. data/app/mailers/katello/errata_mailer.rb +4 -2
  56. data/app/models/katello/alternate_content_source.rb +5 -1
  57. data/app/models/katello/concerns/content_facet_host_extensions.rb +25 -14
  58. data/app/models/katello/concerns/host_managed_extensions.rb +17 -8
  59. data/app/models/katello/concerns/redhat_extensions.rb +16 -6
  60. data/app/models/katello/concerns/smart_proxy_extensions.rb +0 -12
  61. data/app/models/katello/concerns/subscription_facet_host_extensions.rb +1 -0
  62. data/app/models/katello/content_view.rb +22 -5
  63. data/app/models/katello/content_view_environment.rb +11 -2
  64. data/app/models/katello/content_view_environment_content_facet.rb +9 -0
  65. data/app/models/katello/content_view_version.rb +10 -5
  66. data/app/models/katello/erratum.rb +6 -1
  67. data/app/models/katello/glue/candlepin/pool.rb +6 -0
  68. data/app/models/katello/glue/candlepin/product.rb +7 -1
  69. data/app/models/katello/glue/candlepin/subscription.rb +5 -0
  70. data/app/models/katello/glue/provider.rb +26 -26
  71. data/app/models/katello/host/content_facet.rb +106 -18
  72. data/app/models/katello/host/info_provider.rb +25 -21
  73. data/app/models/katello/host/subscription_facet.rb +18 -14
  74. data/app/models/katello/kt_environment.rb +12 -7
  75. data/app/models/katello/package_group.rb +0 -12
  76. data/app/models/katello/pool.rb +4 -1
  77. data/app/models/katello/product.rb +11 -1
  78. data/app/models/katello/repository.rb +11 -11
  79. data/app/models/katello/root_repository.rb +5 -4
  80. data/app/models/katello/task_status.rb +0 -18
  81. data/app/services/katello/candlepin/consumer.rb +2 -2
  82. data/app/services/katello/host/package_profile_uploader.rb +1 -1
  83. data/app/services/katello/product_content_finder.rb +11 -8
  84. data/app/services/katello/pulp3/content_view_version/export.rb +8 -65
  85. data/app/services/katello/pulp3/content_view_version/export_validation_error.rb +7 -0
  86. data/app/services/katello/pulp3/content_view_version/export_validator.rb +105 -0
  87. data/app/services/katello/pulp3/content_view_version/importable_products.rb +1 -1
  88. data/app/services/katello/pulp3/content_view_version/syncable_format_export.rb +7 -1
  89. data/app/services/katello/pulp3/erratum.rb +1 -0
  90. data/app/services/katello/pulp3/module_stream.rb +26 -11
  91. data/app/services/katello/pulp3/repository/yum.rb +2 -1
  92. data/app/services/katello/pulp3/smart_proxy_mirror_repository.rb +2 -1
  93. data/app/services/katello/registration_manager.rb +46 -26
  94. data/app/services/katello/repository_type.rb +3 -9
  95. data/app/services/katello/simple_package.rb +22 -0
  96. data/app/views/foreman/smart_proxies/_content_sync.html.erb +1 -0
  97. data/app/views/foreman/smart_proxies/_reclaim_space.html.erb +1 -0
  98. data/app/views/katello/api/v2/content_facet/base.json.rabl +23 -2
  99. data/app/views/katello/api/v2/content_facet/show.json.rabl +11 -8
  100. data/app/views/katello/api/v2/content_views/base.json.rabl +1 -1
  101. data/app/views/katello/api/v2/hosts/base.json.rabl +22 -2
  102. data/app/views/overrides/activation_keys/_host_environment_select.html.erb +2 -2
  103. data/config/initializers/monkeys.rb +0 -2
  104. data/config/routes/api/registry.rb +8 -7
  105. data/config/routes/api/v2.rb +0 -2
  106. data/config/routes.rb +3 -0
  107. data/db/migrate/20200429153103_installed_package_bad_nvrea.rb +1 -1
  108. data/db/migrate/20220228173251_remove_drpm_from_ignorable_content.rb +7 -3
  109. data/db/migrate/20220419193414_content_settings_to_dsl_category.rb +1 -1
  110. data/db/migrate/20220929204746_add_content_view_environment_content_facet.rb +52 -0
  111. data/db/migrate/20221123212341_remove_pulp_docker_registry_port_setting.rb +5 -0
  112. data/db/seeds.d/111-upgrade_tasks.rb +2 -1
  113. data/engines/bastion/app/assets/stylesheets/bastion/bastion.scss +4 -0
  114. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-details.controller.js +2 -4
  115. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-errata-modal.controller.js +0 -1
  116. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-details.controller.js +2 -4
  117. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts.html +2 -1
  118. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/apply-errata.controller.js +11 -3
  119. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/views/host-collection-hosts-list.html +1 -1
  120. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/bastion_katello.pot +8 -4
  121. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/de.po +5485 -0
  122. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/es.po +5397 -0
  123. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/fr.po +5658 -0
  124. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ja.po +5284 -0
  125. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ka.po +5231 -0
  126. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ko.po +5275 -0
  127. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/pt_BR.po +5389 -0
  128. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/zh_CN.po +5212 -0
  129. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/zh_TW.po +5145 -0
  130. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/translations.js +9 -0
  131. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/content-access-mode-banner.html +2 -2
  132. data/lib/katello/engine.rb +2 -1
  133. data/lib/katello/permission_creator.rb +2 -4
  134. data/lib/katello/permissions/registry_permissions.rb +5 -5
  135. data/lib/katello/plugin.rb +22 -14
  136. data/lib/katello/repository_types/README.md +136 -19
  137. data/lib/katello/repository_types/deb.rb +0 -1
  138. data/lib/katello/repository_types/docker.rb +0 -1
  139. data/lib/katello/repository_types/file.rb +0 -1
  140. data/lib/katello/repository_types/yum.rb +0 -4
  141. data/lib/katello/tasks/clean_candlepin_orphaned_products.rake +38 -0
  142. data/lib/katello/tasks/clean_orphaned_facets.rb +20 -0
  143. data/lib/katello/tasks/reimport.rake +1 -2
  144. data/lib/katello/tasks/repository.rake +1 -22
  145. data/lib/katello/tasks/reset.rake +1 -0
  146. data/lib/katello/tasks/upgrades/4.8/fix_incorrect_providers.rake +29 -0
  147. data/lib/katello/version.rb +1 -1
  148. data/lib/katello.rb +0 -5
  149. data/locale/bn/katello.po +69 -27
  150. data/locale/cs/katello.po +69 -27
  151. data/locale/de/katello.po +78 -36
  152. data/locale/en/katello.po +69 -27
  153. data/locale/es/katello.po +70 -28
  154. data/locale/fr/katello.po +73 -31
  155. data/locale/gu/katello.po +69 -27
  156. data/locale/hi/katello.po +69 -27
  157. data/locale/it/katello.po +69 -27
  158. data/locale/ja/katello.po +73 -31
  159. data/locale/ka/katello.po +73 -31
  160. data/locale/katello.pot +335 -262
  161. data/locale/kn/katello.po +69 -27
  162. data/locale/ko/katello.po +69 -27
  163. data/locale/mr/katello.po +69 -27
  164. data/locale/or/katello.po +69 -27
  165. data/locale/pa/katello.po +69 -27
  166. data/locale/pt/katello.po +69 -27
  167. data/locale/pt_BR/katello.po +70 -28
  168. data/locale/ru/katello.po +70 -28
  169. data/locale/ta/katello.po +69 -27
  170. data/locale/te/katello.po +69 -27
  171. data/locale/zh_CN/katello.po +73 -31
  172. data/locale/zh_TW/katello.po +70 -28
  173. data/webpack/components/Content/ContentPage.js +51 -35
  174. data/webpack/components/Content/__tests__/ContentPage.test.js +2 -4
  175. data/webpack/components/Content/__tests__/__snapshots__/ContentPage.test.js.snap +22 -3
  176. data/webpack/components/Table/EmptyStateMessage.js +14 -11
  177. data/webpack/components/Table/MainTable.js +36 -15
  178. data/webpack/components/Table/TableWrapper.js +25 -25
  179. data/webpack/components/Table/__test__/emptyStateMessage.test.js +51 -0
  180. data/webpack/components/extensions/HostDetails/Cards/ErrataOverviewCard.js +5 -4
  181. data/webpack/components/extensions/HostDetails/Cards/HostCollectionsCard/HostCollectionsModal.js +1 -1
  182. data/webpack/components/extensions/HostDetails/Cards/HostCollectionsCard/__tests__/hostCollectionsModal.test.js +1 -17
  183. data/webpack/components/extensions/HostDetails/Tabs/ErrataTab/ErrataTab.js +18 -9
  184. data/webpack/components/extensions/HostDetails/Tabs/ModuleStreamsTab/ModuleStreamsTab.js +1 -2
  185. data/webpack/components/extensions/HostDetails/Tabs/PackagesTab/PackageInstallModal.js +1 -2
  186. data/webpack/components/extensions/HostDetails/Tabs/PackagesTab/PackagesTab.js +1 -2
  187. data/webpack/components/extensions/HostDetails/Tabs/RepositorySetsTab/RepositorySetsTab.js +47 -27
  188. data/webpack/components/extensions/HostDetails/Tabs/TracesTab/TracesTab.js +1 -2
  189. data/webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js +2 -21
  190. data/webpack/components/extensions/HostDetails/Tabs/__tests__/moduleStreamsTab.test.js +1 -28
  191. data/webpack/components/extensions/HostDetails/Tabs/__tests__/packageInstallModal.test.js +1 -10
  192. data/webpack/components/extensions/HostDetails/Tabs/__tests__/packagesTab.test.js +1 -18
  193. data/webpack/components/extensions/HostDetails/Tabs/__tests__/repositorySetsTab.test.js +1 -17
  194. data/webpack/components/extensions/HostDetails/Tabs/__tests__/tracesTab.test.js +1 -15
  195. data/webpack/global_test_setup.js +1 -1
  196. data/webpack/scenes/AlternateContentSources/Create/ACSCreateWizard.js +12 -10
  197. data/webpack/scenes/AlternateContentSources/Create/Steps/ACSCredentials.js +6 -0
  198. data/webpack/scenes/AlternateContentSources/Create/Steps/ACSSmartProxies.js +1 -0
  199. data/webpack/scenes/AlternateContentSources/Create/Steps/AcsUrlPaths.js +3 -10
  200. data/webpack/scenes/AlternateContentSources/Create/Steps/NameACS.js +1 -0
  201. data/webpack/scenes/AlternateContentSources/Create/__tests__/acsCreate.test.js +3 -3
  202. data/webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditDetails.js +1 -0
  203. data/webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditURLPaths.js +12 -4
  204. data/webpack/scenes/AlternateContentSources/MainTable/ACSTable.js +7 -4
  205. data/webpack/scenes/AlternateContentSources/MainTable/__tests__/acsTable.test.js +4 -8
  206. data/webpack/scenes/AlternateContentSources/helpers.js +1 -1
  207. data/webpack/scenes/Content/Details/ContentRepositories.js +5 -4
  208. data/webpack/scenes/Content/Details/__tests__/contentDetail.test.js +1 -12
  209. data/webpack/scenes/Content/Table/ContentTable.js +2 -1
  210. data/webpack/scenes/Content/__tests__/contentTable.test.js +1 -14
  211. data/webpack/scenes/ContentViews/Delete/__tests__/contentViewDelete.test.js +1 -25
  212. data/webpack/scenes/ContentViews/Details/ComponentContentViews/ContentViewComponents.js +2 -1
  213. data/webpack/scenes/ContentViews/Details/ComponentContentViews/__tests__/contentViewComponents.test.js +44 -31
  214. data/webpack/scenes/ContentViews/Details/ContentViewDetails.js +2 -0
  215. data/webpack/scenes/ContentViews/Details/Filters/AffectedRepositories/AffectedRepositoryTable.js +6 -1
  216. data/webpack/scenes/ContentViews/Details/Filters/CVContainerImageFilterContent.js +2 -1
  217. data/webpack/scenes/ContentViews/Details/Filters/CVDebFilterContent.js +2 -1
  218. data/webpack/scenes/ContentViews/Details/Filters/CVErrataIDFilterContent.js +3 -1
  219. data/webpack/scenes/ContentViews/Details/Filters/CVModuleStreamFilterContent.js +3 -1
  220. data/webpack/scenes/ContentViews/Details/Filters/CVPackageGroupFilterContent.js +3 -1
  221. data/webpack/scenes/ContentViews/Details/Filters/CVRpmFilterContent.js +2 -1
  222. data/webpack/scenes/ContentViews/Details/Filters/ContentViewFilterDetailsHeader.js +2 -0
  223. data/webpack/scenes/ContentViews/Details/Filters/ContentViewFilters.js +2 -1
  224. data/webpack/scenes/ContentViews/Details/Filters/MatchContentModal/CVDebMatchContentModal.js +1 -1
  225. data/webpack/scenes/ContentViews/Details/Filters/MatchContentModal/CVRpmMatchContentModal.js +1 -1
  226. data/webpack/scenes/ContentViews/Details/Filters/MatchContentModal/__tests__/CVRpmMatchContentModal.test.js +35 -33
  227. data/webpack/scenes/ContentViews/Details/Filters/__tests__/CVContainerImageFilterContent.test.js +48 -45
  228. data/webpack/scenes/ContentViews/Details/Filters/__tests__/CVRpmFilterContent.test.js +58 -24
  229. data/webpack/scenes/ContentViews/Details/Filters/__tests__/ContentViewPackageGroupFilter.test.js +64 -0
  230. data/webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilterDetails.test.js +36 -20
  231. data/webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilters.test.js +40 -23
  232. data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvErrataIDFilter.test.js +0 -13
  233. data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvModuleStreamFilter.test.js +0 -13
  234. data/webpack/scenes/ContentViews/Details/Histories/ContentViewHistories.js +2 -1
  235. data/webpack/scenes/ContentViews/Details/Histories/__tests__/contentViewHistory.test.js +1 -10
  236. data/webpack/scenes/ContentViews/Details/Repositories/ContentViewRepositories.js +2 -1
  237. data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewAddRemove.test.js +1 -10
  238. data/webpack/scenes/ContentViews/Details/Versions/Compare/CVVersionCompareConfig.js +21 -9
  239. data/webpack/scenes/ContentViews/Details/Versions/Compare/CVVersionCompareTable.js +4 -0
  240. data/webpack/scenes/ContentViews/Details/Versions/Compare/__tests__/CVVersionCompare.test.js +1 -32
  241. data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersions.js +3 -1
  242. data/webpack/scenes/ContentViews/Details/Versions/Delete/__tests__/cvVersionRemove.test.js +1 -15
  243. data/webpack/scenes/ContentViews/Details/Versions/Delete/affectedActivationKeys.js +1 -1
  244. data/webpack/scenes/ContentViews/Details/Versions/Delete/affectedHosts.js +1 -2
  245. data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionDetailConfig.js +31 -9
  246. data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionDetailsTable.js +4 -0
  247. data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionDetails.test.js +30 -14
  248. data/webpack/scenes/ContentViews/Table/ContentViewsTable.js +1 -1
  249. data/webpack/scenes/ContentViews/__tests__/contentViewPage.test.js +55 -120
  250. data/webpack/scenes/ContentViews/components/WizardHeader.js +1 -1
  251. data/webpack/scenes/ContentViews/expansions/RelatedContentViewComponentsModal.js +1 -1
  252. data/webpack/scenes/ContentViews/expansions/__tests__/contentViewComponentsModal.test.js +8 -1
  253. data/webpack/scenes/ModuleStreams/ModuleStreamsPage.js +3 -9
  254. data/webpack/scenes/ModuleStreams/__tests__/__snapshots__/ModuleStreamPage.test.js.snap +7 -1
  255. data/webpack/scenes/RedHatRepositories/components/Search.js +22 -16
  256. data/webpack/scenes/RedHatRepositories/index.scss +20 -1
  257. data/webpack/scenes/SmartProxy/SmartProxyContentTable.js +12 -1
  258. data/webpack/scenes/Subscriptions/Manifest/CdnConfigurationTab/CdnTypeForm.js +1 -1
  259. data/webpack/scenes/Subscriptions/Manifest/CdnConfigurationTab/CustomCdnTypeForm.js +1 -1
  260. data/webpack/scenes/Subscriptions/SubscriptionsPage.js +21 -19
  261. data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsPage.test.js.snap +34 -1
  262. data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/SubscriptionsToolbar.js +20 -7
  263. data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/SubscriptionsToolbar.test.js +0 -1
  264. data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/__snapshots__/SubscriptionsToolbar.test.js.snap +65 -15
  265. metadata +47 -113
  266. data/app/lib/actions/katello/pulp_selector.rb +0 -24
  267. data/app/lib/actions/katello/repository/correct_checksum.rb +0 -24
  268. data/app/lib/actions/katello/repository/destroy_package_group.rb +0 -26
  269. data/app/lib/actions/katello/repository/upload_package_group.rb +0 -24
  270. data/app/lib/actions/pulp/abstract.rb +0 -37
  271. data/app/lib/actions/pulp/abstract_async_task.rb +0 -154
  272. data/app/lib/actions/pulp/abstract_async_task_group.rb +0 -94
  273. data/app/lib/actions/pulp/consumer/sync_capsule.rb +0 -45
  274. data/app/lib/actions/pulp/consumer/unassociate_units.rb +0 -20
  275. data/app/lib/actions/pulp/expect_one_task.rb +0 -11
  276. data/app/lib/actions/pulp/orchestration/orphan_cleanup/remove_orphans.rb +0 -16
  277. data/app/lib/actions/pulp/orchestration/repository/copy_all_units.rb +0 -19
  278. data/app/lib/actions/pulp/orchestration/repository/delete.rb +0 -15
  279. data/app/lib/actions/pulp/orchestration/repository/refresh.rb +0 -14
  280. data/app/lib/actions/pulp/orchestration/repository/refresh_if_needed.rb +0 -13
  281. data/app/lib/actions/pulp/orchestration/repository/refresh_repos.rb +0 -19
  282. data/app/lib/actions/pulp/orchestration/repository/remove_units.rb +0 -14
  283. data/app/lib/actions/pulp/orchestration/repository/smart_proxy_sync.rb +0 -34
  284. data/app/lib/actions/pulp/orchestration/repository/sync.rb +0 -18
  285. data/app/lib/actions/pulp/orchestration/repository/upload_content.rb +0 -37
  286. data/app/lib/actions/pulp/orphan_cleanup/remove_orphans.rb +0 -15
  287. data/app/lib/actions/pulp/orphan_cleanup/remove_unneeded_repos.rb +0 -16
  288. data/app/lib/actions/pulp/repository/abstract_copy_content.rb +0 -45
  289. data/app/lib/actions/pulp/repository/abstract_remove_content.rb +0 -32
  290. data/app/lib/actions/pulp/repository/clear.rb +0 -18
  291. data/app/lib/actions/pulp/repository/copy_all_units.rb +0 -30
  292. data/app/lib/actions/pulp/repository/copy_units.rb +0 -25
  293. data/app/lib/actions/pulp/repository/create.rb +0 -28
  294. data/app/lib/actions/pulp/repository/create_in_plan.rb +0 -15
  295. data/app/lib/actions/pulp/repository/create_upload_request.rb +0 -20
  296. data/app/lib/actions/pulp/repository/delete_upload_request.rb +0 -19
  297. data/app/lib/actions/pulp/repository/destroy.rb +0 -28
  298. data/app/lib/actions/pulp/repository/distributor_publish.rb +0 -25
  299. data/app/lib/actions/pulp/repository/download.rb +0 -16
  300. data/app/lib/actions/pulp/repository/import_upload.rb +0 -19
  301. data/app/lib/actions/pulp/repository/presenters/abstract_sync_presenter.rb +0 -47
  302. data/app/lib/actions/pulp/repository/presenters/deb_presenter.rb +0 -95
  303. data/app/lib/actions/pulp/repository/presenters/docker_presenter.rb +0 -103
  304. data/app/lib/actions/pulp/repository/presenters/file_unit_presenter.rb +0 -42
  305. data/app/lib/actions/pulp/repository/presenters/yum_presenter.rb +0 -131
  306. data/app/lib/actions/pulp/repository/refresh.rb +0 -21
  307. data/app/lib/actions/pulp/repository/regenerate_applicability.rb +0 -21
  308. data/app/lib/actions/pulp/repository/remove_distribution.rb +0 -11
  309. data/app/lib/actions/pulp/repository/remove_units.rb +0 -44
  310. data/app/lib/actions/pulp/repository/sync.rb +0 -99
  311. data/app/lib/actions/pulp/repository/upload_file.rb +0 -28
  312. data/app/lib/actions/pulp/repository_group/create.rb +0 -31
  313. data/app/lib/actions/pulp/repository_group/delete.rb +0 -17
  314. data/app/lib/actions/pulp/repository_group/export.rb +0 -51
  315. data/app/lib/katello/util/package_clause_generator.rb +0 -77
  316. data/app/models/katello/glue/pulp/pulp_errors.rb +0 -9
  317. data/app/models/katello/glue/pulp/repo.rb +0 -353
  318. data/app/models/katello/pulp_sync_status.rb +0 -165
  319. data/app/models/katello/pulp_task_status.rb +0 -63
  320. data/app/services/katello/pulp/content.rb +0 -24
  321. data/app/services/katello/pulp/importer_comparison.rb +0 -28
  322. data/app/services/katello/pulp/repository/deb.rb +0 -61
  323. data/app/services/katello/pulp/repository/docker.rb +0 -82
  324. data/app/services/katello/pulp/repository/file.rb +0 -52
  325. data/app/services/katello/pulp/repository/yum.rb +0 -205
  326. data/app/services/katello/pulp/repository.rb +0 -327
  327. data/app/services/katello/pulp/server.rb +0 -35
  328. data/app/services/katello/pulp/simple_package.rb +0 -24
  329. data/app/services/katello/pulp/smart_proxy_repository.rb +0 -52
  330. data/lib/monkeys/fix_deb_optimized_sync.rb +0 -35
  331. data/lib/monkeys/fix_pulp_container_path.rb +0 -35
  332. data/locale/zanata.xml +0 -30
  333. data/webpack/scenes/ContentViews/Details/Filters/MatchContentModal/__tests__/CVRpmMatchContentSearch.fixtures.json +0 -33
@@ -33,6 +33,7 @@ module Katello
33
33
 
34
34
  validates_lengths_from_database :except => [:label]
35
35
  validates :provider_id, :presence => true
36
+ validate :ensure_provider_type_matches_id
36
37
  validates_with Validators::KatelloNameFormatValidator, :attributes => :name
37
38
  validates_with Validators::KatelloLabelFormatValidator, :attributes => :label
38
39
  validates_with Validators::ProductUniqueAttributeValidator, :attributes => :name
@@ -236,7 +237,7 @@ module Katello
236
237
  end
237
238
 
238
239
  def self.unused_product_id
239
- id = SecureRandom.random_number(999_999_999_999)
240
+ id = (SecureRandom.random_number * (10**12 - 10**11) + 10**11).to_i # guarantee that we get 12 digits
240
241
  if ::Katello::Product.find_by(:cp_id => id)
241
242
  unused_product_id
242
243
  else
@@ -253,5 +254,14 @@ module Katello
253
254
  class Jail < ::Safemode::Jail
254
255
  allow :name, :label
255
256
  end
257
+
258
+ private
259
+
260
+ def ensure_provider_type_matches_id
261
+ return if errors[:provider_id].any?
262
+ if provider.redhat_provider? && ::Katello::Glue::Candlepin::Product.custom_product_id?(cp_id)
263
+ errors.add(:base, _("Cannot associate a Red Hat provider with a custom product"))
264
+ end
265
+ end
256
266
  end
257
267
  end
@@ -12,7 +12,6 @@ module Katello
12
12
 
13
13
  include ForemanTasks::Concerns::ActionSubject
14
14
  include Glue::Candlepin::Repository
15
- include Glue::Pulp::Repo
16
15
 
17
16
  include Glue
18
17
  include Authorization::Repository
@@ -185,10 +184,13 @@ module Katello
185
184
  delegate :content_id, to: :root, allow_nil: true
186
185
  delegate :repository_type, to: :root
187
186
 
187
+ def self.exportable_types(format: ::Katello::Pulp3::ContentViewVersion::Export::IMPORTABLE)
188
+ return [YUM_TYPE, FILE_TYPE] if format == ::Katello::Pulp3::ContentViewVersion::Export::SYNCABLE
189
+ EXPORTABLE_TYPES
190
+ end
191
+
188
192
  def self.exportable(format: ::Katello::Pulp3::ContentViewVersion::Export::IMPORTABLE)
189
- types = EXPORTABLE_TYPES
190
- types = [YUM_TYPE, FILE_TYPE] if format == ::Katello::Pulp3::ContentViewVersion::Export::SYNCABLE
191
- with_type(types)
193
+ with_type(exportable_types(format: format))
192
194
  end
193
195
 
194
196
  def self.with_type(content_type)
@@ -203,12 +205,10 @@ module Katello
203
205
  name
204
206
  end
205
207
 
206
- def backend_service(smart_proxy, force_pulp3 = false)
207
- if force_pulp3 || smart_proxy.pulp3_support?(self)
208
- @service ||= Katello::Pulp3::Repository.instance_for_type(self, smart_proxy)
209
- else
210
- @service ||= Katello::Pulp::Repository.instance_for_type(self, smart_proxy)
211
- end
208
+ def backend_service(smart_proxy)
209
+ fail('Pulp 3 not supported') unless smart_proxy.pulp3_support?(self)
210
+
211
+ @service ||= Katello::Pulp3::Repository.instance_for_type(self, smart_proxy)
212
212
  end
213
213
 
214
214
  def backend_content_service(smart_proxy)
@@ -581,7 +581,7 @@ module Katello
581
581
 
582
582
  if self.yum?
583
583
  if self.library_instance?
584
- checksum_type = root.checksum_type || pulp_scratchpad_checksum_type
584
+ checksum_type = root.checksum_type
585
585
  else
586
586
  checksum_type = self.saved_checksum_type
587
587
  end
@@ -228,7 +228,7 @@ module Katello
228
228
  elsif ignorable_content.any? { |item| !IGNORABLE_CONTENT_UNIT_TYPES.include?(item) }
229
229
  errors.add(:ignorable_content, N_("Invalid value specified for ignorable content. Permissible values %s") % IGNORABLE_CONTENT_UNIT_TYPES.join(","))
230
230
  elsif self.mirroring_policy == MIRRORING_POLICY_COMPLETE
231
- errors.add(:ignorable_content, N_("Ignore SRPMs can not be set in combination with 'Complete Mirroring' mirroring policy."))
231
+ errors.add(:ignorable_content, N_("Ignore %s can not be set in combination with 'Complete Mirroring' mirroring policy.") % IGNORABLE_CONTENT_UNIT_TYPES.join(","))
232
232
  end
233
233
  end
234
234
 
@@ -417,9 +417,10 @@ module Katello
417
417
  end
418
418
 
419
419
  def http_proxy
420
- if http_proxy_policy == NO_DEFAULT_HTTP_PROXY
420
+ case http_proxy_policy
421
+ when NO_DEFAULT_HTTP_PROXY
421
422
  return nil
422
- elsif http_proxy_policy == GLOBAL_DEFAULT_HTTP_PROXY
423
+ when GLOBAL_DEFAULT_HTTP_PROXY
423
424
  return HttpProxy.default_global_content_proxy
424
425
  end
425
426
  super
@@ -427,7 +428,7 @@ module Katello
427
428
 
428
429
  def format_arches
429
430
  if content_type == ::Katello::Repository::DEB_TYPE
430
- self.deb_architectures
431
+ self.deb_architectures&.gsub(" ", ",")
431
432
  else
432
433
  self.arch == "noarch" ? nil : self.arch
433
434
  end
@@ -97,14 +97,6 @@ module Katello
97
97
  self
98
98
  end
99
99
 
100
- def merge_pulp_task!(pulp_task)
101
- PulpTaskStatus.dump_state(pulp_task, self)
102
- end
103
-
104
- def refresh_pulp
105
- PulpTaskStatus.refresh(self)
106
- end
107
-
108
100
  def human_readable_message
109
101
  task_template = TaskStatus::TYPES[self.task_type]
110
102
  return '' if task_template.nil?
@@ -276,16 +268,6 @@ module Katello
276
268
  end
277
269
  end
278
270
 
279
- def self.refresh(ids)
280
- unless ids.blank?
281
- uuids = TaskStatus.where(:id => ids).pluck(:uuid)
282
- ret = Katello.pulp_server.resources.task.poll_all(uuids)
283
- ret.each do |pulp_task|
284
- PulpTaskStatus.dump_state(pulp_task, TaskStatus.find_by(:uuid => pulp_task[:task_id]))
285
- end
286
- end
287
- end
288
-
289
271
  protected
290
272
 
291
273
  def setup_task_type
@@ -16,8 +16,8 @@ module Katello
16
16
  lazy_accessor :entitlements, :initializer => lambda { |_s| Resources::Candlepin::Consumer.entitlements(uuid) }
17
17
  lazy_accessor :consumer_attributes, :initializer => lambda { |_s| Resources::Candlepin::Consumer.get(uuid) }
18
18
  lazy_accessor :installed_products, :initializer => lambda { |_s| consumer_attributes['installedProducts'] }
19
- lazy_accessor :available_pools, :initializer => lambda { |_s| Resources::Candlepin::Consumer.available_pools(owner_label, uuid, false) }
20
- lazy_accessor :all_available_pools, :initializer => lambda { |_s| Resources::Candlepin::Consumer.available_pools(owner_label, uuid, true) }
19
+ lazy_accessor :available_pools, :initializer => lambda { |_s| Resources::Candlepin::Consumer.available_pools(owner_label, uuid, listall: false) }
20
+ lazy_accessor :all_available_pools, :initializer => lambda { |_s| Resources::Candlepin::Consumer.available_pools(owner_label, uuid, listall: true) }
21
21
  lazy_accessor :content_overrides, :initializer => (lambda do |_s|
22
22
  Resources::Candlepin::Consumer.content_overrides(uuid).map do |override|
23
23
  ::Katello::ContentOverride.from_entitlement_hash(override)
@@ -29,7 +29,7 @@ module Katello
29
29
  Rails.logger.warn("Host with ID %s has no content facet; continuing" % host_id)
30
30
  else
31
31
  begin
32
- simple_packages = profile.map { |item| ::Katello::Pulp::SimplePackage.new(item) }
32
+ simple_packages = profile.map { |item| ::Katello::SimplePackage.new(item) }
33
33
  host.import_package_profile(simple_packages)
34
34
  rescue ActiveRecord::InvalidForeignKey # this happens if the host gets deleted in between the "find_by" and "import_package_profile"
35
35
  Rails.logger.warn("Host installed package list with ID %s was not able to be written to the DB (host likely is deleted); continuing" % host_id)
@@ -2,9 +2,8 @@ module Katello
2
2
  class ProductContentFinder
3
3
  attr_accessor :match_environment, :match_subscription, :consumable
4
4
 
5
- #consumable must implement:
6
- # content_view
7
- # lifecycle_environment
5
+ # consumable must implement:
6
+ # content_view_environments
8
7
  # organization
9
8
  # products
10
9
  def initialize(params = {})
@@ -16,16 +15,20 @@ module Katello
16
15
 
17
16
  def product_content
18
17
  if match_environment
19
- environment = consumable.lifecycle_environment
20
- view = consumable.content_view
21
- return ProductContent.none unless environment && view
22
- version = ContentViewVersion.in_environment(environment).where(:content_view_id => view).first
18
+ if consumable.is_a?(::Katello::ActivationKey) # TODO: remove this when AKs are refactored for multi CV
19
+ environment = consumable.lifecycle_environment
20
+ view = consumable.content_view
21
+ return ProductContent.none unless environment && view
22
+ versions = ContentViewVersion.in_environment(environment).where(:content_view_id => view).first
23
+ else # consumable is a SubscriptionFacet
24
+ versions = consumable.content_view_environments.select(:content_view_version_id).map(&:content_view_version_id)
25
+ end
23
26
  end
24
27
 
25
28
  considered_products = match_subscription ? consumable.products : consumable.organization.products.enabled.uniq
26
29
 
27
30
  roots = Katello::RootRepository.where(:product_id => considered_products).subscribable
28
- roots = roots.in_content_view_version(version) if version
31
+ roots = roots.in_content_view_version(versions) if versions.present?
29
32
 
30
33
  consumable.organization.enabled_product_content_for(roots)
31
34
  end
@@ -51,6 +51,10 @@ module Katello
51
51
  end
52
52
  end
53
53
 
54
+ def incremental?
55
+ from_content_view_version.present?
56
+ end
57
+
54
58
  def generate_exporter_path
55
59
  return base_path if base_path
56
60
  export_path = "#{content_view_version.content_view.label}/#{content_view_version.version}/"
@@ -114,72 +118,11 @@ module Katello
114
118
  api.exporter_api.delete(exporter_href)
115
119
  end
116
120
 
117
- def validate_chunk_size(size)
118
- return if size.blank?
119
-
120
- unless size.is_a?(Numeric) && size > 0 && size < 1e6
121
- fail _("Specify an export chunk size less than 1_000_000 GB")
122
- end
123
- end
124
-
125
121
  def validate!(fail_on_missing_content: true, validate_incremental: true, chunk_size: nil)
126
- validate_repositories_immediate! if fail_on_missing_content
127
- validate_incremental_export! if validate_incremental && !from_content_view_version.blank?
128
- validate_chunk_size(chunk_size)
129
- validate_export_types! if fail_on_missing_content
130
- end
131
-
132
- def validate_export_types!
133
- repos = repositories(fetch_all: true).where.not(id: ::Katello::Repository.exportable(format: format))
134
- if repos.any?
135
- fail _("NOTE: Unable to fully export Content View Version '%{content_view} %{current}'"\
136
- " it contains repositories with un-exportable content types. \n %{repos}" %
137
- { content_view: content_view_version.content_view.name,
138
- current: content_view_version.version,
139
- repos: self.class.generate_product_repo_strings(repositories: repos)})
140
-
141
- end
142
- end
143
-
144
- def validate_repositories_immediate!
145
- non_immediate_repos = repositories(fetch_all: true).yum_type.non_immediate
146
- if non_immediate_repos.any?
147
- fail _("NOTE: Unable to fully export Content View Version '%{content_view} %{current}'"\
148
- " it contains repositories without the 'immediate' download policy."\
149
- " Update the download policy and sync affected repositories. Once synced republish the content view"\
150
- " and export the generated version. \n %{repos}" %
151
- { content_view: content_view_version.content_view.name,
152
- current: content_view_version.version,
153
- repos: self.class.generate_product_repo_strings(repositories: non_immediate_repos)})
154
- end
155
- end
156
-
157
- def validate_incremental_export!
158
- from_exporter = Export.new(smart_proxy: smart_proxy, content_view_version: from_content_view_version)
159
-
160
- from_exporter_repos = generate_repo_mapping(from_exporter.repositories(fetch_all: true))
161
- to_exporter_repos = generate_repo_mapping(repositories(fetch_all: true))
162
-
163
- invalid_repos_exist = (from_exporter_repos.keys & to_exporter_repos.keys).any? do |repo_id|
164
- from_exporter_repos[repo_id] != to_exporter_repos[repo_id]
165
- end
166
-
167
- if invalid_repos_exist
168
- fail _("The exported Content View Version '%{content_view} %{current}' cannot be incrementally updated from version '%{from}'."\
169
- " Please do a full export." % { content_view: content_view_version.content_view.name,
170
- current: content_view_version.version,
171
- from: from_content_view_version.version})
172
- end
173
- end
174
-
175
- def generate_repo_mapping(repositories)
176
- # return a repo mapping with key being the library_instance_id and value being the repostiory_href
177
- # used by validate_incremental_export
178
- repo_map = {}
179
- repositories.each do |repo|
180
- repo_map[repo.library_instance_id] = version_href_to_repository_href(repo.version_href)
181
- end
182
- repo_map
122
+ ExportValidator.new(export_service: self,
123
+ fail_on_missing_content: fail_on_missing_content,
124
+ validate_incremental: validate_incremental,
125
+ chunk_size: chunk_size).validate!
183
126
  end
184
127
 
185
128
  def generate_metadata
@@ -0,0 +1,7 @@
1
+ module Katello
2
+ module Pulp3
3
+ module ContentViewVersion
4
+ class ExportValidationError < HttpErrors::BadRequest; end
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,105 @@
1
+ module Katello
2
+ module Pulp3
3
+ module ContentViewVersion
4
+ class ExportValidator
5
+ delegate :content_view_version, :from_content_view_version, :format, :repositories,
6
+ :smart_proxy, :version_href_to_repository_href, to: :@export_service
7
+
8
+ def initialize(export_service:, fail_on_missing_content: true, validate_incremental: true, chunk_size: nil)
9
+ @export_service = export_service
10
+ @fail_on_missing_content = fail_on_missing_content
11
+ @validate_incremental = validate_incremental
12
+ @chunk_size = chunk_size
13
+ end
14
+
15
+ def validate!
16
+ validate_repositories_immediate! if @fail_on_missing_content
17
+ validate_incremental_export! if @validate_incremental && !from_content_view_version.blank?
18
+ validate_chunk_size
19
+ validate_export_types! if @fail_on_missing_content
20
+ end
21
+
22
+ def validate_chunk_size
23
+ return if @chunk_size.blank?
24
+
25
+ unless @chunk_size.is_a?(Numeric) && @chunk_size > 0 && @chunk_size < 1e6
26
+ fail ExportValidationError, _("Specify an export chunk size less than 1_000_000 GB")
27
+ end
28
+ end
29
+
30
+ def validate_export_types!
31
+ repos = repositories(fetch_all: true).where.not(id: ::Katello::Repository.exportable(format: format))
32
+ if repos.any?
33
+ fail ExportValidationError,
34
+ _("NOTE: Unable to fully export Content View Version '%{content_view} %{current}'"\
35
+ " it contains repositories with un-exportable content types. \n %{repos}" %
36
+ { content_view: content_view_version.content_view.name,
37
+ current: content_view_version.version,
38
+ repos: Export.generate_product_repo_strings(repositories: repos)})
39
+
40
+ end
41
+ end
42
+
43
+ def validate_repositories_immediate!
44
+ non_immediate_repos = repositories(fetch_all: true).yum_type.non_immediate
45
+ if non_immediate_repos.any?
46
+ fail ExportValidationError,
47
+ _("NOTE: Unable to fully export Content View Version '%{content_view} %{current}'"\
48
+ " it contains repositories without the 'immediate' download policy."\
49
+ " Update the download policy and sync affected repositories. Once synced republish the content view"\
50
+ " and export the generated version. \n %{repos}" %
51
+ { content_view: content_view_version.content_view.name,
52
+ current: content_view_version.version,
53
+ repos: Export.generate_product_repo_strings(repositories: non_immediate_repos)})
54
+ end
55
+ end
56
+
57
+ def validate_incremental_export_point_release!
58
+ # You are trying to export between an incrementally updated content view version and regular version
59
+ if from_content_view_version.incrementally_updated? != content_view_version.incrementally_updated?
60
+ fail ExportValidationError,
61
+ _("Cannot incrementally export from a incrementally exported version and a regular version or vice-versa. "\
62
+ " The exported Content View Version '%{content_view} %{current}' "\
63
+ "cannot be incrementally exported from version '%{from}.'"\
64
+ " Please do a full export." % { content_view: content_view_version.content_view.name,
65
+ current: content_view_version.version,
66
+ from: from_content_view_version.version})
67
+ end
68
+ end
69
+
70
+ def validate_incremental_export!
71
+ validate_incremental_export_point_release!
72
+
73
+ from_exporter = Export.new(smart_proxy: smart_proxy, content_view_version: from_content_view_version)
74
+
75
+ from_exporter_repos = generate_repo_mapping(from_exporter.repositories(fetch_all: true))
76
+ to_exporter_repos = generate_repo_mapping(repositories(fetch_all: true))
77
+
78
+ invalid_repos_exist = (from_exporter_repos.keys & to_exporter_repos.keys).any? do |repo_id|
79
+ from_exporter_repos[repo_id] != to_exporter_repos[repo_id]
80
+ end
81
+
82
+ if invalid_repos_exist
83
+ fail ExportValidationError,
84
+ _("Cannot incrementally export from a filtered and a non-filtered content view version."\
85
+ " The exported content view version '%{content_view} %{current}' "\
86
+ " cannot be incrementally updated from version '%{from}.'. "\
87
+ " Please do a full export." % { content_view: content_view_version.content_view.name,
88
+ current: content_view_version.version,
89
+ from: from_content_view_version.version})
90
+ end
91
+ end
92
+
93
+ def generate_repo_mapping(repositories)
94
+ # return a repo mapping with key being the library_instance_id and value being the repostiory_href
95
+ # used by validate_incremental_export
96
+ repo_map = {}
97
+ repositories.each do |repo|
98
+ repo_map[repo.library_instance_id] = version_href_to_repository_href(repo.version_href)
99
+ end
100
+ repo_map
101
+ end
102
+ end
103
+ end
104
+ end
105
+ end
@@ -64,7 +64,7 @@ module Katello
64
64
 
65
65
  def gpg_key_id(metadata_product)
66
66
  if metadata_product.gpg_key
67
- @organization.gpg_keys.where(name: metadata_product.gpg_key.name).pluck(:id).first
67
+ @organization.gpg_keys.where(name: metadata_product.gpg_key.name).pick(:id)
68
68
  end
69
69
  end
70
70
  end
@@ -9,7 +9,13 @@ module Katello
9
9
  end
10
10
 
11
11
  def create_export(exporter_data, _options = {})
12
- [api.yum_export_api.create(exporter_data[:pulp_href], publication: repository.publication_href)]
12
+ options = { publication: repository.publication_href }
13
+ if incremental?
14
+ from_exporter = Export.new(smart_proxy: smart_proxy, content_view_version: from_content_view_version)
15
+ from_repo = from_exporter.repositories.find_by(library_instance_id: repository.library_instance)
16
+ options[:start_repository_version] = from_repo.version_href unless from_repo.blank?
17
+ end
18
+ [api.yum_export_api.create(exporter_data[:pulp_href], options)]
13
19
  end
14
20
 
15
21
  def fetch_export(exporter_href)
@@ -28,6 +28,7 @@ module Katello
28
28
  def self.generate_model_row(unit)
29
29
  keys = %w(title id severity issued_date type description reboot_suggested solution updated_date summary)
30
30
  custom_json = unit.slice(*keys)
31
+ custom_json.inject(HashWithIndifferentAccess.new({})) { |h, (k, v)| h.merge({ k => v.respond_to?(:strip) ? v.strip : v }) }
31
32
  custom_json['pulp_id'] = custom_json['id']
32
33
  custom_json["issued"] = custom_json.delete("issued_date")
33
34
  custom_json["updated"] = custom_json.delete("updated_date")
@@ -25,16 +25,25 @@ module Katello
25
25
  end
26
26
 
27
27
  def self.build_artifacts(katello_id, artifacts_json)
28
- return [] if artifacts_json.nil?
29
- artifacts = artifacts_json.map do |name|
30
- {name: name,
31
- module_stream_id: katello_id}
28
+ # TODO: Fully support artifact hashes
29
+ # => {"rpms"=>["swig"], "description"=>"Simplified Wrapper and Interface Generator (SWIG)"}
30
+ return [] if artifacts_json.empty?
31
+
32
+ if artifacts_json.is_a?(::Hash)
33
+ artifacts = artifacts_json['rpms'].map do |name|
34
+ {name: name, module_stream_id: katello_id}
35
+ end
36
+ else
37
+ # For compatibility with pulpcore 3.21 + pulp-rpm 3.18 and below.
38
+ artifacts = artifacts_json.map do |name|
39
+ {name: name, module_stream_id: katello_id}
40
+ end
32
41
  end
33
42
  add_timestamps(artifacts)
34
43
  end
35
44
 
36
45
  def self.build_profiles(katello_id, profiles_json)
37
- return [] if profiles_json.nil?
46
+ return [] if profiles_json.empty?
38
47
  profiles = profiles_json.map do |profile, _rpms|
39
48
  {
40
49
  module_stream_id: katello_id,
@@ -45,14 +54,20 @@ module Katello
45
54
  end
46
55
 
47
56
  def self.build_profile_rpms(katello_id, profiles_json)
57
+ # TODO: Fully support artifact hashes
58
+ # => {"rpms"=>["swig"], "description"=>"Simplified Wrapper and Interface Generator (SWIG)"}
48
59
  return [] if profiles_json.nil?
49
- profile_rpms = profiles_json.map do |profile, rpms|
60
+ profile_rpms = profiles_json.map do |profile, artifacts_json|
50
61
  profile_id = Katello::ModuleProfile.find_by(module_stream_id: katello_id, name: profile).id
51
- rpms.map do |rpm|
52
- {
53
- module_profile_id: profile_id,
54
- name: rpm
55
- }
62
+ if artifacts_json.is_a?(::Hash)
63
+ artifacts_json['rpms'].map do |rpm|
64
+ {name: rpm, module_profile_id: profile_id}
65
+ end
66
+ else
67
+ # For compatibility with pulpcore 3.21 + pulp-rpm 3.18 and below.
68
+ artifacts_json.map do |rpm|
69
+ {name: rpm, module_profile_id: profile_id}
70
+ end
56
71
  end
57
72
  end
58
73
  add_timestamps(profile_rpms.flatten)
@@ -440,7 +440,8 @@ module Katello
440
440
 
441
441
  errata_to_include = filter_errata_by_pulp_href(source_repository.errata, content_unit_hrefs,
442
442
  source_repository.rpms.pluck(:filename) +
443
- source_repository.srpms.pluck(:filename)) -
443
+ source_repository.srpms.pluck(:filename),
444
+ source_repository.module_streams.map(&:module_spec)) -
444
445
  all_excluded_errata
445
446
  content_unit_hrefs += errata_to_include.collect do |erratum|
446
447
  erratum.repository_errata.where(repository_id: source_repository.id).pluck(:erratum_pulp3_href)
@@ -96,7 +96,8 @@ module Katello
96
96
 
97
97
  def delete_orphan_remotes
98
98
  tasks = []
99
- repo_names = Katello::Repository.pluck(:pulp_id)
99
+ smart_proxy_helper = ::Katello::SmartProxyHelper.new(smart_proxy)
100
+ repo_names = smart_proxy_helper.combined_repos_available_to_capsule.map(&:pulp_id)
100
101
  acs_remotes = Katello::SmartProxyAlternateContentSource.pluck(:remote_href)
101
102
  pulp3_enabled_repo_types.each do |repo_type|
102
103
  api = repo_type.pulp3_api(smart_proxy)