katello 4.18.1 → 4.19.0.rc1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


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

Files changed (336) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/katello/locale/bn/katello.js +56 -107
  3. data/app/assets/javascripts/katello/locale/bn_IN/katello.js +56 -107
  4. data/app/assets/javascripts/katello/locale/ca/katello.js +56 -107
  5. data/app/assets/javascripts/katello/locale/cs/katello.js +56 -107
  6. data/app/assets/javascripts/katello/locale/cs_CZ/katello.js +57 -108
  7. data/app/assets/javascripts/katello/locale/de/katello.js +58 -109
  8. data/app/assets/javascripts/katello/locale/de_AT/katello.js +56 -107
  9. data/app/assets/javascripts/katello/locale/de_DE/katello.js +56 -107
  10. data/app/assets/javascripts/katello/locale/el/katello.js +57 -108
  11. data/app/assets/javascripts/katello/locale/en/katello.js +56 -107
  12. data/app/assets/javascripts/katello/locale/en_GB/katello.js +56 -107
  13. data/app/assets/javascripts/katello/locale/en_US/katello.js +56 -107
  14. data/app/assets/javascripts/katello/locale/es/katello.js +58 -109
  15. data/app/assets/javascripts/katello/locale/et_EE/katello.js +56 -107
  16. data/app/assets/javascripts/katello/locale/fr/katello.js +59 -110
  17. data/app/assets/javascripts/katello/locale/gl/katello.js +56 -107
  18. data/app/assets/javascripts/katello/locale/gu/katello.js +56 -107
  19. data/app/assets/javascripts/katello/locale/he_IL/katello.js +56 -107
  20. data/app/assets/javascripts/katello/locale/hi/katello.js +56 -107
  21. data/app/assets/javascripts/katello/locale/id/katello.js +56 -107
  22. data/app/assets/javascripts/katello/locale/it/katello.js +56 -107
  23. data/app/assets/javascripts/katello/locale/ja/katello.js +59 -110
  24. data/app/assets/javascripts/katello/locale/ka/katello.js +58 -109
  25. data/app/assets/javascripts/katello/locale/kn/katello.js +56 -107
  26. data/app/assets/javascripts/katello/locale/ko/katello.js +59 -110
  27. data/app/assets/javascripts/katello/locale/ml_IN/katello.js +56 -107
  28. data/app/assets/javascripts/katello/locale/mr/katello.js +56 -107
  29. data/app/assets/javascripts/katello/locale/nl_NL/katello.js +56 -107
  30. data/app/assets/javascripts/katello/locale/or/katello.js +56 -107
  31. data/app/assets/javascripts/katello/locale/pa/katello.js +56 -107
  32. data/app/assets/javascripts/katello/locale/pl/katello.js +56 -107
  33. data/app/assets/javascripts/katello/locale/pl_PL/katello.js +56 -107
  34. data/app/assets/javascripts/katello/locale/pt/katello.js +56 -107
  35. data/app/assets/javascripts/katello/locale/pt_BR/katello.js +58 -109
  36. data/app/assets/javascripts/katello/locale/ro/katello.js +56 -107
  37. data/app/assets/javascripts/katello/locale/ro_RO/katello.js +56 -107
  38. data/app/assets/javascripts/katello/locale/ru/katello.js +57 -108
  39. data/app/assets/javascripts/katello/locale/sl/katello.js +56 -107
  40. data/app/assets/javascripts/katello/locale/sv_SE/katello.js +56 -107
  41. data/app/assets/javascripts/katello/locale/ta/katello.js +56 -107
  42. data/app/assets/javascripts/katello/locale/ta_IN/katello.js +56 -107
  43. data/app/assets/javascripts/katello/locale/te/katello.js +56 -107
  44. data/app/assets/javascripts/katello/locale/tr/katello.js +56 -107
  45. data/app/assets/javascripts/katello/locale/vi/katello.js +56 -107
  46. data/app/assets/javascripts/katello/locale/vi_VN/katello.js +56 -107
  47. data/app/assets/javascripts/katello/locale/zh/katello.js +56 -107
  48. data/app/assets/javascripts/katello/locale/zh_CN/katello.js +59 -110
  49. data/app/assets/javascripts/katello/locale/zh_TW/katello.js +57 -108
  50. data/app/controllers/katello/api/registry/registry_proxies_controller.rb +41 -12
  51. data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +1 -1
  52. data/app/controllers/katello/api/v2/activation_keys_controller.rb +3 -65
  53. data/app/controllers/katello/api/v2/content_view_filter_rules_controller.rb +1 -1
  54. data/app/controllers/katello/api/v2/content_views_controller.rb +18 -3
  55. data/app/controllers/katello/api/v2/debs_controller.rb +21 -11
  56. data/app/controllers/katello/api/v2/docker_tags_controller.rb +7 -0
  57. data/app/controllers/katello/api/v2/flatpak_remote_repositories_controller.rb +21 -19
  58. data/app/controllers/katello/api/v2/host_debs_controller.rb +16 -1
  59. data/app/controllers/katello/api/v2/host_subscriptions_controller.rb +3 -60
  60. data/app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb +10 -53
  61. data/app/controllers/katello/api/v2/repositories_controller.rb +0 -1
  62. data/app/controllers/katello/concerns/organizations_controller_extensions.rb +3 -0
  63. data/app/lib/actions/candlepin/activation_key/create.rb +0 -2
  64. data/app/lib/actions/candlepin/activation_key/update.rb +0 -2
  65. data/app/lib/actions/candlepin/product/content_create.rb +3 -5
  66. data/app/lib/actions/candlepin/product/content_update.rb +2 -3
  67. data/app/lib/actions/helpers/rolling_cv_repos.rb +1 -1
  68. data/app/lib/actions/katello/activation_key/create.rb +0 -1
  69. data/app/lib/actions/katello/activation_key/update.rb +0 -2
  70. data/app/lib/actions/katello/capsule_content/sync_capsule.rb +1 -6
  71. data/app/lib/actions/katello/content_credential/update.rb +1 -1
  72. data/app/lib/actions/katello/content_view/add_rolling_repo_clone.rb +18 -24
  73. data/app/lib/actions/katello/content_view/create.rb +9 -4
  74. data/app/lib/actions/katello/content_view/refresh_rolling_repo.rb +6 -1
  75. data/app/lib/actions/katello/content_view/remove_rolling_repo_clone.rb +16 -11
  76. data/app/lib/actions/katello/content_view/update.rb +34 -7
  77. data/app/lib/actions/katello/product/content_create.rb +2 -2
  78. data/app/lib/actions/katello/product/content_destroy.rb +1 -1
  79. data/app/lib/actions/katello/repository/check_matching_content.rb +1 -1
  80. data/app/lib/actions/katello/repository/clone_contents.rb +1 -1
  81. data/app/lib/actions/katello/repository/create.rb +1 -1
  82. data/app/lib/actions/katello/repository/destroy.rb +4 -4
  83. data/app/lib/actions/katello/repository/finish_upload.rb +1 -1
  84. data/app/lib/actions/katello/repository/sync.rb +1 -1
  85. data/app/lib/actions/pulp3/orchestration/repository/copy_all_units.rb +2 -2
  86. data/app/lib/actions/pulp3/orchestration/repository/generate_metadata.rb +1 -1
  87. data/app/lib/actions/pulp3/orchestration/repository/multi_copy_all_units.rb +1 -1
  88. data/app/lib/actions/pulp3/repository/save_publication.rb +3 -1
  89. data/app/lib/actions/pulp3/repository/save_version.rb +45 -24
  90. data/app/lib/actions/pulp3/repository/save_versions.rb +2 -1
  91. data/app/lib/katello/resources/candlepin/activation_key.rb +3 -4
  92. data/app/lib/katello/resources/candlepin/upstream_job.rb +9 -1
  93. data/app/lib/katello/resources/candlepin.rb +4 -0
  94. data/app/models/katello/authorization/repository.rb +17 -4
  95. data/app/models/katello/concerns/subscription_facet_host_extensions.rb +0 -7
  96. data/app/models/katello/content_view_deb_filter.rb +10 -0
  97. data/app/models/katello/content_view_deb_filter_rule.rb +7 -0
  98. data/app/models/katello/deb.rb +10 -10
  99. data/app/models/katello/erratum.rb +1 -1
  100. data/app/models/katello/glue/provider.rb +14 -3
  101. data/app/models/katello/host/content_facet.rb +1 -1
  102. data/app/models/katello/host/subscription_facet.rb +1 -7
  103. data/app/models/katello/product_content.rb +2 -2
  104. data/app/models/katello/repository.rb +4 -23
  105. data/app/models/katello/root_repository.rb +2 -5
  106. data/app/services/katello/candlepin/event_handler.rb +0 -33
  107. data/app/services/katello/candlepin/message_handler.rb +0 -41
  108. data/app/services/katello/content_unit_indexer.rb +59 -13
  109. data/app/services/katello/product_content_finder.rb +5 -4
  110. data/app/services/katello/pulp3/alternate_content_source.rb +2 -2
  111. data/app/services/katello/pulp3/ansible_collection.rb +1 -0
  112. data/app/services/katello/pulp3/api/content_guard.rb +5 -5
  113. data/app/services/katello/pulp3/api/core.rb +10 -0
  114. data/app/services/katello/pulp3/deb.rb +1 -0
  115. data/app/services/katello/pulp3/docker_manifest.rb +1 -0
  116. data/app/services/katello/pulp3/docker_manifest_list.rb +1 -0
  117. data/app/services/katello/pulp3/docker_tag.rb +1 -0
  118. data/app/services/katello/pulp3/file_unit.rb +1 -0
  119. data/app/services/katello/pulp3/generic_content_unit.rb +1 -0
  120. data/app/services/katello/pulp3/module_stream.rb +1 -0
  121. data/app/services/katello/pulp3/package_group.rb +1 -0
  122. data/app/services/katello/pulp3/repository/apt.rb +30 -13
  123. data/app/services/katello/pulp3/repository.rb +59 -10
  124. data/app/services/katello/pulp3/rpm.rb +3 -2
  125. data/app/services/katello/pulp3/srpm.rb +3 -2
  126. data/app/services/katello/pulp3/task_group.rb +1 -1
  127. data/app/services/katello/registration_manager.rb +19 -17
  128. data/app/services/katello/repository_type_manager.rb +7 -5
  129. data/app/services/katello/smart_proxy_helper.rb +1 -6
  130. data/app/views/foreman/job_templates/upload_profile.erb +5 -0
  131. data/app/views/katello/api/v2/activation_keys/base.json.rabl +1 -1
  132. data/app/views/katello/api/v2/content_views/base.json.rabl +1 -0
  133. data/app/views/katello/api/v2/debs/thindex.json.rabl +6 -0
  134. data/app/views/katello/api/v2/docker_tags/_base.json.rabl +32 -0
  135. data/app/views/katello/api/v2/docker_tags/show.json.rabl +0 -5
  136. data/app/views/katello/api/v2/flatpak_remotes/index.json.rabl +6 -0
  137. data/app/views/katello/api/v2/host_debs/installed_debs.json.rabl +6 -0
  138. data/app/views/katello/api/v2/hosts_bulk_actions/applicable_errata.json.rabl +1 -1
  139. data/app/views/katello/api/v2/hosts_bulk_actions/applicable_erratum.json.rabl +9 -0
  140. data/app/views/katello/api/v2/hosts_bulk_actions/installable_errata.json.rabl +1 -1
  141. data/app/views/katello/api/v2/hosts_bulk_actions/{erratum.json.rabl → installable_erratum.json.rabl} +3 -3
  142. data/app/views/katello/api/v2/subscription_facet/base.json.rabl +1 -1
  143. data/config/initializers/monkeys.rb +1 -0
  144. data/config/routes/api/v2.rb +2 -2
  145. data/config/routes/overrides.rb +2 -7
  146. data/config/routes.rb +2 -0
  147. data/db/migrate/20211019192121_create_cdn_configuration.katello.rb +1 -1
  148. data/db/migrate/20250912000000_add_pulp_prn_fields.rb +73 -0
  149. data/db/migrate/20250912000001_populate_pulp_prn_fields.rb +403 -0
  150. data/db/migrate/20251009142516_remove_auto_attach_from_activation_keys.rb +5 -0
  151. data/db/migrate/20251009142517_remove_autoheal_from_subscription_facets.rb +5 -0
  152. data/db/seeds.d/111-upgrade_tasks.rb +2 -0
  153. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/el.po +2 -2
  154. data/lib/katello/permission_creator.rb +2 -2
  155. data/lib/katello/permissions/host_permissions.rb +0 -6
  156. data/lib/katello/plugin.rb +16 -8
  157. data/lib/katello/tasks/jenkins.rake +1 -1
  158. data/lib/katello/tasks/upgrades/4.19/enable_structured_apt_for_deb.rake +87 -0
  159. data/lib/katello/tasks/upgrades/4.19/populate_repository_version_prns.rake +32 -0
  160. data/lib/katello/version.rb +1 -1
  161. data/lib/monkeys/fix_rpm_repository_gpgcheck.rb +38 -0
  162. data/locale/bn/LC_MESSAGES/katello.mo +0 -0
  163. data/locale/bn/katello.po +56 -107
  164. data/locale/bn_IN/LC_MESSAGES/katello.mo +0 -0
  165. data/locale/bn_IN/katello.po +56 -107
  166. data/locale/ca/LC_MESSAGES/katello.mo +0 -0
  167. data/locale/ca/katello.po +56 -107
  168. data/locale/cs/LC_MESSAGES/katello.mo +0 -0
  169. data/locale/cs/katello.po +56 -107
  170. data/locale/cs_CZ/LC_MESSAGES/katello.mo +0 -0
  171. data/locale/cs_CZ/katello.po +57 -108
  172. data/locale/de/LC_MESSAGES/katello.mo +0 -0
  173. data/locale/de/katello.po +58 -109
  174. data/locale/de_AT/LC_MESSAGES/katello.mo +0 -0
  175. data/locale/de_AT/katello.po +56 -107
  176. data/locale/de_DE/LC_MESSAGES/katello.mo +0 -0
  177. data/locale/de_DE/katello.po +56 -107
  178. data/locale/el/LC_MESSAGES/katello.mo +0 -0
  179. data/locale/el/katello.po +58 -109
  180. data/locale/en/LC_MESSAGES/katello.mo +0 -0
  181. data/locale/en/katello.po +56 -107
  182. data/locale/en_GB/LC_MESSAGES/katello.mo +0 -0
  183. data/locale/en_GB/katello.po +56 -107
  184. data/locale/en_US/LC_MESSAGES/katello.mo +0 -0
  185. data/locale/en_US/katello.po +56 -107
  186. data/locale/es/LC_MESSAGES/katello.mo +0 -0
  187. data/locale/es/katello.po +58 -109
  188. data/locale/et_EE/LC_MESSAGES/katello.mo +0 -0
  189. data/locale/et_EE/katello.po +56 -107
  190. data/locale/fr/LC_MESSAGES/katello.mo +0 -0
  191. data/locale/fr/katello.po +59 -110
  192. data/locale/gl/LC_MESSAGES/katello.mo +0 -0
  193. data/locale/gl/katello.po +56 -107
  194. data/locale/gu/LC_MESSAGES/katello.mo +0 -0
  195. data/locale/gu/katello.po +56 -107
  196. data/locale/he_IL/LC_MESSAGES/katello.mo +0 -0
  197. data/locale/he_IL/katello.po +56 -107
  198. data/locale/hi/LC_MESSAGES/katello.mo +0 -0
  199. data/locale/hi/katello.po +56 -107
  200. data/locale/id/LC_MESSAGES/katello.mo +0 -0
  201. data/locale/id/katello.po +56 -107
  202. data/locale/it/LC_MESSAGES/katello.mo +0 -0
  203. data/locale/it/katello.po +56 -107
  204. data/locale/ja/LC_MESSAGES/katello.mo +0 -0
  205. data/locale/ja/katello.po +59 -110
  206. data/locale/ka/LC_MESSAGES/katello.mo +0 -0
  207. data/locale/ka/katello.po +58 -109
  208. data/locale/katello.pot +676 -749
  209. data/locale/kn/LC_MESSAGES/katello.mo +0 -0
  210. data/locale/kn/katello.po +56 -107
  211. data/locale/ko/LC_MESSAGES/katello.mo +0 -0
  212. data/locale/ko/katello.po +59 -110
  213. data/locale/ml_IN/LC_MESSAGES/katello.mo +0 -0
  214. data/locale/ml_IN/katello.po +56 -107
  215. data/locale/mr/LC_MESSAGES/katello.mo +0 -0
  216. data/locale/mr/katello.po +56 -107
  217. data/locale/nl_NL/LC_MESSAGES/katello.mo +0 -0
  218. data/locale/nl_NL/katello.po +56 -107
  219. data/locale/or/LC_MESSAGES/katello.mo +0 -0
  220. data/locale/or/katello.po +56 -107
  221. data/locale/pa/LC_MESSAGES/katello.mo +0 -0
  222. data/locale/pa/katello.po +56 -107
  223. data/locale/pl/LC_MESSAGES/katello.mo +0 -0
  224. data/locale/pl/katello.po +56 -107
  225. data/locale/pl_PL/LC_MESSAGES/katello.mo +0 -0
  226. data/locale/pl_PL/katello.po +56 -107
  227. data/locale/pt/LC_MESSAGES/katello.mo +0 -0
  228. data/locale/pt/katello.po +56 -107
  229. data/locale/pt_BR/LC_MESSAGES/katello.mo +0 -0
  230. data/locale/pt_BR/katello.po +58 -109
  231. data/locale/ro/LC_MESSAGES/katello.mo +0 -0
  232. data/locale/ro/katello.po +56 -107
  233. data/locale/ro_RO/LC_MESSAGES/katello.mo +0 -0
  234. data/locale/ro_RO/katello.po +56 -107
  235. data/locale/ru/LC_MESSAGES/katello.mo +0 -0
  236. data/locale/ru/katello.po +57 -108
  237. data/locale/sl/LC_MESSAGES/katello.mo +0 -0
  238. data/locale/sl/katello.po +56 -107
  239. data/locale/sv_SE/LC_MESSAGES/katello.mo +0 -0
  240. data/locale/sv_SE/katello.po +56 -107
  241. data/locale/ta/LC_MESSAGES/katello.mo +0 -0
  242. data/locale/ta/katello.po +56 -107
  243. data/locale/ta_IN/LC_MESSAGES/katello.mo +0 -0
  244. data/locale/ta_IN/katello.po +56 -107
  245. data/locale/te/LC_MESSAGES/katello.mo +0 -0
  246. data/locale/te/katello.po +56 -107
  247. data/locale/tr/LC_MESSAGES/katello.mo +0 -0
  248. data/locale/tr/katello.po +56 -107
  249. data/locale/vi/LC_MESSAGES/katello.mo +0 -0
  250. data/locale/vi/katello.po +56 -107
  251. data/locale/vi_VN/LC_MESSAGES/katello.mo +0 -0
  252. data/locale/vi_VN/katello.po +56 -107
  253. data/locale/zh/LC_MESSAGES/katello.mo +0 -0
  254. data/locale/zh/katello.po +56 -107
  255. data/locale/zh_CN/LC_MESSAGES/katello.mo +0 -0
  256. data/locale/zh_CN/katello.po +59 -110
  257. data/locale/zh_TW/LC_MESSAGES/katello.mo +0 -0
  258. data/locale/zh_TW/katello.po +57 -108
  259. data/webpack/components/Content/Details/__tests__/__snapshots__/ContentDetails.test.js.snap +2 -2
  260. data/webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/SystemPurposeEditModal.js +0 -2
  261. data/webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/__tests__/SystemPurposeEditModal.test.js +0 -2
  262. data/webpack/components/extensions/Hosts/ActionsBar/index.js +1 -0
  263. data/webpack/components/extensions/Hosts/BulkActions/BulkActionsConstants.js +7 -0
  264. data/webpack/components/extensions/Hosts/BulkActions/BulkChangeHostCollectionsModal/BulkChangeHostCollectionsModal.js +388 -0
  265. data/webpack/components/extensions/Hosts/BulkActions/BulkChangeHostCollectionsModal/__tests__/BulkChangeHostCollectionsModal.test.js +640 -0
  266. data/webpack/components/extensions/Hosts/BulkActions/BulkChangeHostCollectionsModal/actions.js +28 -0
  267. data/webpack/components/extensions/Hosts/BulkActions/BulkChangeHostCollectionsModal/index.js +71 -0
  268. data/webpack/components/extensions/Hosts/BulkActions/BulkErrataWizard/BulkErrataWizard.js +1 -1
  269. data/webpack/components/extensions/Hosts/BulkActions/BulkPackagesWizard/02_BulkPackagesTable.js +10 -3
  270. data/webpack/components/extensions/Hosts/BulkActions/BulkPackagesWizard/BulkPackagesWizard.js +51 -24
  271. data/webpack/components/extensions/Hosts/BulkActions/HostReview.js +7 -0
  272. data/webpack/containers/Application/config.js +11 -1
  273. data/webpack/global_index.js +3 -0
  274. data/webpack/scenes/{BootedContainerImages → ContainerImages/Booted}/BootedContainerImagesConstants.js +1 -1
  275. data/webpack/scenes/{BootedContainerImages → ContainerImages/Booted}/BootedContainerImagesPage.js +7 -43
  276. data/webpack/scenes/{BootedContainerImages → ContainerImages/Booted}/__tests__/bootedContainerImagesPage.test.js +1 -1
  277. data/webpack/scenes/ContainerImages/ContainerImagesPage.js +86 -0
  278. data/webpack/scenes/ContainerImages/LabelsAnnotationsModal.js +105 -0
  279. data/webpack/scenes/ContainerImages/Synced/Details/ManifestDetails.js +218 -0
  280. data/webpack/scenes/ContainerImages/Synced/Details/ManifestDetailsActions.js +15 -0
  281. data/webpack/scenes/ContainerImages/Synced/Details/ManifestDetailsSelectors.js +16 -0
  282. data/webpack/scenes/ContainerImages/Synced/Details/__tests__/ManifestDetails.test.js +395 -0
  283. data/webpack/scenes/ContainerImages/Synced/Details/__tests__/manifestDetails.fixtures.json +43 -0
  284. data/webpack/scenes/ContainerImages/Synced/Details/__tests__/manifestList.fixtures.json +58 -0
  285. data/webpack/scenes/ContainerImages/Synced/Details/index.js +4 -0
  286. data/webpack/scenes/ContainerImages/Synced/SyncedContainerImagesPage.js +359 -0
  287. data/webpack/scenes/ContainerImages/Synced/SyncedContainerImagesPage.scss +21 -0
  288. data/webpack/scenes/ContainerImages/Synced/__tests__/LabelsAnnotationsModal.test.js +69 -0
  289. data/webpack/scenes/ContainerImages/Synced/__tests__/SyncedContainerImagesPage.test.js +335 -0
  290. data/webpack/scenes/ContainerImages/Synced/__tests__/syncedContainerImages.fixtures.json +105 -0
  291. data/webpack/scenes/ContainerImages/TableEmptyState.js +67 -0
  292. data/webpack/scenes/ContainerImages/containerImagesHelpers.js +48 -0
  293. data/webpack/scenes/ContainerImages/index.js +4 -0
  294. data/webpack/scenes/ContentViews/Create/CreateContentViewForm.js +29 -3
  295. data/webpack/scenes/ContentViews/Create/__tests__/contentViewCreateResult.fixtures.json +1 -0
  296. data/webpack/scenes/ContentViews/Create/__tests__/createContentView.test.js +45 -1
  297. data/webpack/scenes/ContentViews/Delete/__tests__/affectedHosts.fixtures.json +0 -1
  298. data/webpack/scenes/ContentViews/Details/ContentViewInfo.js +59 -1
  299. data/webpack/scenes/ContentViews/Details/Filters/CVDebFilterContent.js +1 -0
  300. data/webpack/scenes/ContentViews/Details/Filters/Rules/DebPackage/AddEditDebPackageRuleModal.js +164 -24
  301. data/webpack/scenes/ContentViews/Details/Filters/__tests__/CVDebFilterContent.test.js +268 -0
  302. data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvDebFilterDetail.fixtures.json +95 -0
  303. data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvDebFilterRules.fixtures.json +31 -0
  304. data/webpack/scenes/ContentViews/Details/Filters/__tests__/emptyCVDebFilterRules.fixtures.json +10 -0
  305. data/webpack/scenes/ContentViews/Details/Versions/BulkDelete/__tests__/hosts.fixtures.json +0 -1
  306. data/webpack/scenes/ContentViews/Details/Versions/Delete/__tests__/cvAffectedHosts.fixture.json +0 -1
  307. data/webpack/scenes/ContentViews/Details/__tests__/contentViewRollingDetail.test.js +15 -0
  308. data/webpack/scenes/ContentViews/Details/__tests__/contentViewRollingDetails.fixtures.json +1 -0
  309. data/webpack/scenes/ContentViews/__tests__/contentViewPage.test.js +9 -0
  310. data/webpack/scenes/FlatpakRemotes/CreateEdit/CreateFlatpakRemoteModal.js +5 -3
  311. data/webpack/scenes/FlatpakRemotes/CreateEdit/EditFlatpakRemotesModal.js +1 -1
  312. data/webpack/scenes/FlatpakRemotes/CreateEdit/FlatpakRemoteform.js +35 -3
  313. data/webpack/scenes/FlatpakRemotes/Details/FlatpakRemoteDetails.js +1 -1
  314. data/webpack/scenes/FlatpakRemotes/Details/RemoteRepositories/RemoteRepositoriesTable.css +3 -0
  315. data/webpack/scenes/FlatpakRemotes/Details/RemoteRepositories/RemoteRepositoriesTable.js +63 -132
  316. data/webpack/scenes/FlatpakRemotes/FlatpakRemotesPage.js +67 -143
  317. data/webpack/scenes/SmartProxy/ExpandableCvDetails.js +10 -2
  318. data/webpack/scenes/SmartProxy/SmartProxyContentActions.js +13 -2
  319. data/webpack/scenes/SmartProxy/SmartProxyContentConstants.js +1 -0
  320. data/webpack/scenes/SmartProxy/SmartProxyExpandableTable.js +8 -2
  321. data/webpack/scenes/SmartProxy/__tests__/SmartProxyContentTest.js +67 -1
  322. data/webpack/scenes/Subscriptions/Details/__tests__/__snapshots__/SubscriptionDetails.test.js.snap +2 -2
  323. data/webpack/scenes/Subscriptions/SubscriptionConstants.js +0 -2
  324. data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsActions.test.js.snap +2 -2
  325. metadata +83 -55
  326. data/app/lib/actions/katello/host/attach_subscriptions.rb +0 -59
  327. data/app/lib/actions/katello/host/auto_attach_subscriptions.rb +0 -22
  328. data/app/lib/actions/katello/host/remove_subscriptions.rb +0 -50
  329. data/app/lib/actions/katello/organization/simple_content_access/disable.rb +0 -25
  330. data/app/lib/actions/katello/organization/simple_content_access/enable.rb +0 -25
  331. data/app/lib/actions/katello/organization/simple_content_access/toggle.rb +0 -42
  332. data/lib/katello/tasks/migrate_structure_content_for_deb.rake +0 -105
  333. data/lib/katello/tasks/upgrades/4.2/remove_checksum_values.rake +0 -17
  334. data/locale/action_names.rb +0 -186
  335. /data/webpack/scenes/{BootedContainerImages → ContainerImages/Booted}/__tests__/bootedContainerImages.fixtures.js +0 -0
  336. /data/webpack/scenes/{BootedContainerImages → ContainerImages/Booted}/index.js +0 -0
@@ -95,7 +95,7 @@ module Katello
95
95
  update_params = rule_params
96
96
  update_params[:name] = update_params[:name].first if update_params[:name]
97
97
 
98
- if @rule.filter.content_type == ContentViewPackageFilter::CONTENT_TYPE
98
+ if [ContentViewPackageFilter::CONTENT_TYPE, ContentViewDebFilter::CONTENT_TYPE].include?(@rule.filter.content_type)
99
99
  update_params[:version] = "" unless rule_params[:version]
100
100
  update_params[:min_version] = "" unless rule_params[:min_version]
101
101
  update_params[:max_version] = "" unless rule_params[:max_version]
@@ -21,6 +21,7 @@ module Katello
21
21
  param :description, String, :desc => N_("Description for the content view")
22
22
  param :repository_ids, Array, :desc => N_("List of repository ids")
23
23
  param :component_ids, Array, :desc => N_("List of component content view version ids for composite views")
24
+ param :environment_ids, Array, :desc => N_("List of lifecycle environments for rolling content views")
24
25
  param :auto_publish, :bool, :desc => N_("Enable/Disable auto publish of composite view")
25
26
  param :solve_dependencies, :bool, :desc => N_("Solve RPM dependencies by default on Content View publish, defaults to false")
26
27
  param :import_only, :bool, :desc => N_("Designate this Content View for importing from upstream servers only. Defaults to false")
@@ -42,6 +43,7 @@ module Katello
42
43
  {
43
44
  :component_ids => Katello::ContentViewVersion,
44
45
  :repository_ids => Katello::Repository,
46
+ :environment_ids => Katello::KTEnvironment,
45
47
  }
46
48
  end
47
49
 
@@ -87,11 +89,12 @@ module Katello
87
89
  param :rolling, :bool, :desc => N_("Rolling content view")
88
90
  param_group :content_view
89
91
  def create
92
+ validate_environment_ids!(params[:rolling])
90
93
  @content_view = ContentView.create!(view_params) do |view|
91
94
  view.organization = @organization
92
95
  view.label ||= labelize_params(params[:content_view])
93
96
  end
94
- sync_task(::Actions::Katello::ContentView::Create, @content_view)
97
+ sync_task(::Actions::Katello::ContentView::Create, @content_view, sanitized_environment_ids)
95
98
 
96
99
  respond :resource => @content_view
97
100
  end
@@ -101,7 +104,8 @@ module Katello
101
104
  param :name, String, :desc => N_("New name for the content view")
102
105
  param_group :content_view
103
106
  def update
104
- sync_task(::Actions::Katello::ContentView::Update, @content_view, view_params)
107
+ validate_environment_ids!(@content_view.rolling?)
108
+ sync_task(::Actions::Katello::ContentView::Update, @content_view, view_params, sanitized_environment_ids)
105
109
  respond :resource => @content_view.reload
106
110
  end
107
111
 
@@ -299,12 +303,23 @@ module Katello
299
303
  if (!@content_view || !@content_view.composite?)
300
304
  attrs.push({:repository_ids => []}, :repository_ids)
301
305
  end
302
- result = params.require(:content_view).permit(*attrs).to_h
306
+ result = {}
307
+ result = params.require(:content_view).permit(*attrs).to_h unless action_name == "update" && @content_view.rolling? && params[:content_view].empty?
303
308
  # sanitize repository_ids to be a list of integers
304
309
  result[:repository_ids] = result[:repository_ids].compact.map(&:to_i) if result[:repository_ids].present?
305
310
  result
306
311
  end
307
312
 
313
+ def sanitized_environment_ids
314
+ params[:environment_ids]&.compact&.map(&:to_i)
315
+ end
316
+
317
+ def validate_environment_ids!(rolling)
318
+ if params[:environment_ids] && !rolling
319
+ fail HttpErrors::BadRequest, _("It's not possible to provide environment_ids for anything other than a rolling content view.")
320
+ end
321
+ end
322
+
308
323
  def find_environment
309
324
  return if !params.key?(:environment_id) && params[:action] == "index"
310
325
  @environment = KTEnvironment.readable.find(params[:environment_id])
@@ -13,15 +13,15 @@ module Katello
13
13
  def auto_complete(search)
14
14
  page_size = Katello::Concerns::FilteredAutoCompleteSearch::PAGE_SIZE
15
15
  debs = Deb.in_repositories(@repositories)
16
- col = ''
17
- case search
18
- when 'name'
19
- col = "#{Deb.table_name}.name"
20
- when 'arch'
21
- col = "#{Deb.table_name}.architecture"
22
- end
23
- debs = debs.where("#{col} ILIKE ?", "#{params[:term]}%").select(col).group(col).order(col).limit(page_size)
24
- render :json => debs.pluck(col)
16
+ col = case search
17
+ when 'name' then "#{Deb.table_name}.name"
18
+ when 'arch' then "#{Deb.table_name}.architecture"
19
+ end
20
+ return render json: [] if col.blank?
21
+
22
+ scope = debs.select(col).group(col).order(col).limit(page_size)
23
+ scope = scope.where("#{col} ILIKE ?", "%#{params[:term]}%") if params[:term].present?
24
+ render json: scope.pluck(Arel.sql(col))
25
25
  end
26
26
 
27
27
  def auto_complete_name
@@ -29,7 +29,7 @@ module Katello
29
29
  end
30
30
 
31
31
  def auto_complete_arch
32
- auto_complete('architecture')
32
+ auto_complete('arch')
33
33
  end
34
34
 
35
35
  api :GET, "/debs", N_("List deb packages")
@@ -52,6 +52,16 @@ module Katello
52
52
  super
53
53
  end
54
54
 
55
+ def thindex
56
+ sort_by, sort_order, options = sort_options
57
+
58
+ options[:select] = "DISTINCT ON (#{Deb.table_name}.name) #{Deb.table_name}.id, #{Deb.table_name}.name"
59
+ final_relation = custom_index_relation(Deb.all)
60
+
61
+ result = scoped_search(final_relation, sort_by, sort_order, options)
62
+ respond_for_index(:collection => result, :template => "thindex")
63
+ end
64
+
55
65
  def final_custom_index_relation(collection)
56
66
  # :packages_restrict_latest is intended to filter the result set after all
57
67
  # other constraints have been applied, including the scoped_search
@@ -95,7 +105,7 @@ module Katello
95
105
  collection = collection.installable_for_hosts(@hosts)
96
106
  elsif not_installed && params[:host_id]
97
107
  host = @hosts.first
98
- collection = Katello::Deb.apt_installable_for_host(host)
108
+ collection = Katello::Deb.deb_installable_for_host(host)
99
109
  elsif applicable
100
110
  collection = collection.applicable_to_hosts(@hosts)
101
111
  end
@@ -46,6 +46,13 @@ module Katello
46
46
 
47
47
  private
48
48
 
49
+ def custom_index_relation(collection)
50
+ collection.includes(
51
+ schema1: { docker_taggable: :docker_manifests },
52
+ schema2: { docker_taggable: :docker_manifests }
53
+ )
54
+ end
55
+
49
56
  def find_repositories
50
57
  @repositories = Repository.readable.where(:id => params[:repoids])
51
58
  end
@@ -4,7 +4,7 @@ module Katello
4
4
 
5
5
  before_action :find_remote_repository, :except => [:index, :auto_complete_search]
6
6
  before_action :find_optional_organization, :only => [:index, :auto_complete_search]
7
- before_action :find_product, :only => [:mirror]
7
+ before_action :find_and_validate_product_for_mirroring, :only => [:mirror]
8
8
 
9
9
  resource_description do
10
10
  name 'Flatpak Remote Repositories'
@@ -56,7 +56,6 @@ module Katello
56
56
  param :product_name, String, :desc => N_("Name of the product to mirror the remote repository to")
57
57
  param :organization_id, :number, :desc => N_("organization identifier")
58
58
  def mirror
59
- validate_product_for_mirroring
60
59
  task = async_task(::Actions::Katello::Flatpak::MirrorRemoteRepository, @flatpak_remote_repository, @product)
61
60
  respond_for_async :resource => task
62
61
  end
@@ -75,10 +74,17 @@ module Katello
75
74
  @flatpak_remote_repository
76
75
  end
77
76
 
78
- def find_product
77
+ protected
78
+
79
+ def rejected_autocomplete_items
80
+ ['flatpak_remote_id', 'flatpak_remote']
81
+ end
82
+
83
+ private
84
+
85
+ def find_and_validate_product_for_mirroring
79
86
  if params[:product_id]
80
- @product = Product.editable.find(params[:product_id])
81
- throw_resource_not_found(name: 'product', id: params[:product_id]) unless @product
87
+ @product = Product.editable.find(params[:product_id]) # will throw not found if id is invalid
82
88
  elsif params[:product_name] && params[:organization_id]
83
89
  @product = Product.editable.find_by(name: params[:product_name], organization_id: params[:organization_id])
84
90
  unless @product
@@ -86,22 +92,18 @@ module Katello
86
92
  { name: params[:product_name], org_id: params[:organization_id] }
87
93
  fail HttpErrors::NotFound, msg
88
94
  end
95
+ elsif params[:product_name]
96
+ msg = _("Organization must be specified when providing product by name.")
97
+ fail HttpErrors::BadRequest, msg
98
+ else
99
+ msg = _("Product must be specified.")
100
+ fail HttpErrors::BadRequest, msg
89
101
  end
90
- @product
91
- end
92
102
 
93
- protected
94
-
95
- def rejected_autocomplete_items
96
- ['flatpak_remote_id', 'flatpak_remote']
97
- end
98
-
99
- private
100
-
101
- def validate_product_for_mirroring
102
- return unless @product&.redhat?
103
- msg = _("Flatpak repositories cannot be mirrored into Red Hat products. Please select a custom product.")
104
- fail HttpErrors::UnprocessableEntity, msg
103
+ if @product.redhat?
104
+ msg = _("Flatpak repositories cannot be mirrored into Red Hat products. Please select a custom product.")
105
+ fail HttpErrors::UnprocessableEntity, msg
106
+ end
105
107
  end
106
108
  end
107
109
  end
@@ -1,14 +1,29 @@
1
1
  module Katello
2
2
  class Api::V2::HostDebsController < Api::V2::ApiController
3
3
  include Katello::Concerns::FilteredAutoCompleteSearch
4
+ include Katello::Concerns::Api::V2::RepositoryContentController
4
5
 
5
- before_action :find_host
6
+ before_action :find_host, only: [:index]
6
7
 
7
8
  resource_description do
8
9
  api_version 'v2'
9
10
  api_base_url "/api"
10
11
  end
11
12
 
13
+ api :GET, "/host_debs/installed_debs", N_("Return a list of installed debs distinct by name")
14
+ param_group :search, ::Katello::Api::V2::ApiController
15
+ def installed_debs
16
+ _sort_by, _sort_order, options = sort_options
17
+ sort_by = 'name'
18
+ sort_order = 'asc'
19
+
20
+ options[:select] = "DISTINCT ON (#{::Katello::InstalledDeb.table_name}.name) #{::Katello::InstalledDeb.table_name}.id, #{::Katello::InstalledDeb.table_name}.name"
21
+ final_relation = ::Katello::InstalledDeb.all
22
+
23
+ result = scoped_search(final_relation, sort_by, sort_order, options)
24
+ respond_for_index(:collection => result, :template => "installed_debs")
25
+ end
26
+
12
27
  api :GET, "/hosts/:host_id/debs", N_("List deb packages installed on the host")
13
28
  param :host_id, :number, :required => true, :desc => N_("ID of the host")
14
29
  param :include_latest_upgradable, :boolean, :desc => N_("Also include the latest upgradable package version for each host package")
@@ -2,7 +2,6 @@ module Katello
2
2
  class Api::V2::HostSubscriptionsController < Katello::Api::V2::ApiController
3
3
  include Katello::Concerns::Api::V2::ContentOverridesController
4
4
  before_action :find_host, :except => :create
5
- before_action :check_subscriptions, :only => [:add_subscriptions, :remove_subscriptions]
6
5
  before_action :find_content_view_environment, :only => :create
7
6
  before_action :check_registration_services, :only => [:destroy, :create]
8
7
  before_action :find_content_overrides, :only => [:content_override]
@@ -17,10 +16,9 @@ module Katello
17
16
 
18
17
  def_param_group :subscription_facet_attributes do
19
18
  param :release_version, String, :desc => N_("Release version for this Host to use (7Server, 7.1, etc)")
20
- param :autoheal, :bool, :desc => N_("Sets whether the Host will autoheal subscriptions upon checkin")
21
19
  param :purpose_usage, String, :desc => N_("Sets the system purpose usage")
22
20
  param :purpose_role, String, :desc => N_("Sets the system purpose usage")
23
- param :service_level, String, :desc => N_("Service level to be used for autoheal")
21
+ param :service_level, String, :desc => N_("Service level")
24
22
  param :hypervisor_guest_uuids, Array, :desc => N_("List of hypervisor guest uuids")
25
23
  param :installed_products_attributes, Array, :desc => N_("List of products installed on the host") do
26
24
  param_group :installed_products, Api::V2::HostSubscriptionsController
@@ -51,18 +49,6 @@ module Katello
51
49
  full_result_response(presenter.subscriptions)
52
50
  end
53
51
 
54
- api :PUT, "/hosts/:host_id/subscriptions/auto_attach", N_("Trigger an auto-attach of subscriptions"), deprecated: true
55
- param :host_id, Integer, :desc => N_("Id of the host"), :required => true
56
- def auto_attach
57
- deprecate_entitlement_mode_endpoint
58
- if @host.organization.simple_content_access?
59
- fail ::Katello::HttpErrors::BadRequest, _("This host's organization is in Simple Content Access mode. Auto-attach is disabled")
60
- end
61
-
62
- sync_task(::Actions::Katello::Host::AutoAttachSubscriptions, @host)
63
- respond_for_index(:collection => index_response(reload_host: true), :template => "index")
64
- end
65
-
66
52
  api :DELETE, "/hosts/:host_id/subscriptions/", N_("Unregister the host as a subscription consumer")
67
53
  param :host_id, Integer, :desc => N_("Id of the host"), :required => true
68
54
  def destroy
@@ -80,7 +66,7 @@ module Katello
80
66
  param_group :installed_products, ::Katello::Api::V2::HostSubscriptionsController
81
67
  end
82
68
  param :release_version, String, :desc => N_("Release version of the content host")
83
- param :service_level, String, :desc => N_("A service level for auto-healing process, e.g. SELF-SUPPORT")
69
+ param :service_level, String, :desc => N_("Service level, e.g. SELF-SUPPORT")
84
70
  param :lifecycle_environment_id, Integer, :desc => N_("Lifecycle Environment ID"), :required => true
85
71
  param :content_view_id, Integer, :desc => N_("Content View ID"), :required => true
86
72
  def create
@@ -115,45 +101,6 @@ module Katello
115
101
  rhsm_params
116
102
  end
117
103
 
118
- api :PUT, "/hosts/:host_id/subscriptions/remove_subscriptions", N_("Remove subscriptions from a host"), deprecated: true
119
- param :host_id, Integer, :desc => N_("Id of the host"), :required => true
120
- param :subscriptions, Array, :desc => N_("Array of subscriptions to remove") do
121
- param :id, String, :desc => N_("Subscription Pool id"), :required => true
122
- param :quantity, Integer, :desc => N_("If specified, remove the first instance of a subscription with matching id and quantity"), :required => false
123
- end
124
- def remove_subscriptions
125
- deprecate_entitlement_mode_endpoint
126
- #combine the quantities for duplicate pools into PoolWithQuantities objects
127
- pool_id_quantities = params.require(:subscriptions).inject({}) do |new_hash, subscription|
128
- new_hash[subscription['id']] ||= PoolWithQuantities.new(Pool.with_identifier(subscription['id']))
129
- new_hash[subscription['id']].quantities << subscription['quantity']
130
- new_hash
131
- end
132
-
133
- sync_task(::Actions::Katello::Host::RemoveSubscriptions, @host, pool_id_quantities.values)
134
- respond_for_index(:collection => index_response(reload_host: true), :template => "index")
135
- end
136
-
137
- api :PUT, "/hosts/:host_id/subscriptions/add_subscriptions", N_("Add a subscription to a host"), deprecated: true
138
- param :host_id, Integer, :desc => N_("Id of the host"), :required => true
139
- param :subscriptions, Array, :desc => N_("Array of subscriptions to add"), :required => true do
140
- param :id, String, :desc => N_("Subscription Pool id"), :required => true
141
- param :quantity, :number, :desc => N_("Quantity of this subscriptions to add"), :required => true
142
- end
143
- def add_subscriptions
144
- deprecate_entitlement_mode_endpoint
145
- if @host.organization.simple_content_access?
146
- fail ::Katello::HttpErrors::BadRequest, _("This host's organization is in Simple Content Access mode. Attaching subscriptions is disabled.")
147
- end
148
-
149
- pools_with_quantities = params.require(:subscriptions).map do |sub_params|
150
- PoolWithQuantities.new(Pool.with_identifier(sub_params['id']), sub_params['quantity'].to_i)
151
- end
152
-
153
- sync_task(::Actions::Katello::Host::AttachSubscriptions, @host, pools_with_quantities)
154
- respond_for_index(:collection => index_response(reload_host: true), :template => "index")
155
- end
156
-
157
104
  api :GET, "/hosts/:host_id/subscriptions/product_content", N_("Get content and overrides for the host")
158
105
  param :host_id, String, :desc => N_("Id of the host"), :required => true
159
106
  param :content_access_mode_all, :bool, :desc => N_("Get all content available, not just that provided by subscriptions")
@@ -215,10 +162,6 @@ module Katello
215
162
  fail HttpErrors::NotFound, _("Couldn't find specified content view and lifecycle environment.") if @content_view_environment.nil?
216
163
  end
217
164
 
218
- def check_subscriptions
219
- fail HttpErrors::BadRequest, _("subscriptions not specified") if params[:subscriptions].blank?
220
- end
221
-
222
165
  def check_registration_services
223
166
  fail "Unable to register system, not all services available" unless Katello::RegistrationManager.check_registration_services
224
167
  end
@@ -228,7 +171,7 @@ module Katello
228
171
  end
229
172
 
230
173
  def action_permission
231
- if ['add_subscriptions', 'destroy', 'remove_subscriptions', 'auto_attach', 'content_override'].include?(params[:action])
174
+ if ['destroy', 'content_override'].include?(params[:action])
232
175
  :edit
233
176
  elsif ['index', 'events', 'product_content', 'available_release_versions', 'enabled_repositories'].include?(params[:action])
234
177
  :view
@@ -1,5 +1,6 @@
1
1
  module Katello
2
2
  # this is Katello's host bulk actions controller, not to be confused with Foreman's
3
+ # rubocop:disable Metrics/ClassLength
3
4
  class Api::V2::HostsBulkActionsController < Api::V2::ApiController
4
5
  include ::Api::V2::BulkHostsExtension
5
6
  include Katello::Concerns::Api::V2::ContentOverridesController
@@ -13,11 +14,8 @@ module Katello
13
14
  before_action :find_deletable_hosts, only: [:destroy_hosts]
14
15
  before_action :find_readable_hosts, only: [:applicable_errata, :installable_errata, :available_incremental_updates]
15
16
  before_action :find_errata, only: [:available_incremental_updates]
16
- before_action :find_organization, only: [:add_subscriptions]
17
17
  before_action :find_traces, only: [:resolve_traces]
18
18
 
19
- before_action :validate_organization, only: [:add_subscriptions]
20
-
21
19
  # disable *_count fields on erratum rabl, since they perform N+1 queries
22
20
  before_action :disable_erratum_hosts_count
23
21
 
@@ -51,8 +49,14 @@ module Katello
51
49
  host_collection.save!
52
50
 
53
51
  final_count = host_collection.host_ids.count - pre_host_collection_count
54
- display_messages << _("Successfully added %{count} content host(s) to host collection %{host_collection}.") %
55
- {:count => final_count, :host_collection => host_collection.name }
52
+ msg = if final_count == 0
53
+ _("All selected hosts were already members of host collection %{host_collection}.") %
54
+ {:host_collection => host_collection.name }
55
+ else
56
+ _("Added %{count} host(s) to host collection %{host_collection}.") %
57
+ {:count => final_count, :host_collection => host_collection.name }
58
+ end
59
+ display_messages << msg
56
60
  end
57
61
  end
58
62
 
@@ -74,7 +78,7 @@ module Katello
74
78
  host_collection.save!
75
79
 
76
80
  final_count = pre_host_collection_count - host_collection.host_ids.count
77
- display_messages << _("Successfully removed %{count} content host(s) from host collection %{host_collection}.") %
81
+ display_messages << _("Removed %{count} host(s) from host collection %{host_collection}.") %
78
82
  {:count => final_count, :host_collection => host_collection.name }
79
83
  end
80
84
  end
@@ -106,49 +110,6 @@ module Katello
106
110
  respond_for_async :resource => task
107
111
  end
108
112
 
109
- api :PUT, "/hosts/bulk/remove_subscriptions", N_("Remove subscriptions from one or more hosts"), deprecated: true
110
- param_group :bulk_params
111
- param :subscriptions, Array, :desc => N_("Array of subscriptions to remove") do
112
- param :id, String, :desc => N_("Subscription Pool id"), :required => true
113
- param :quantity, Integer, :desc => N_("Quantity of specified subscription to remove"), :required => false
114
- end
115
- def remove_subscriptions
116
- #combine the quantities for duplicate pools into PoolWithQuantities objects
117
- pool_id_quantities = params.require(:subscriptions).inject({}) do |new_hash, subscription|
118
- new_hash[subscription['id']] ||= PoolWithQuantities.new(Pool.find(subscription['id']))
119
- new_hash[subscription['id']].quantities << subscription['quantity']
120
- new_hash
121
- end
122
- task = async_task(::Actions::BulkAction, ::Actions::Katello::Host::RemoveSubscriptions, @hosts, pool_id_quantities.values)
123
- respond_for_async :resource => task
124
- end
125
-
126
- api :PUT, "/hosts/bulk/add_subscriptions", N_("Add subscriptions to one or more hosts"), deprecated: true
127
- param_group :bulk_params
128
- param :subscriptions, Array, :desc => N_("Array of subscriptions to add"), :required => true do
129
- param :id, String, :desc => N_("Subscription Pool id"), :required => true
130
- param :quantity, :number, :desc => N_("Quantity of this subscriptions to add"), :required => true
131
- end
132
- def add_subscriptions
133
- if @organization.simple_content_access?
134
- fail HttpErrors::BadRequest, _("The specified organization is in Simple Content Access mode. Attaching subscriptions is disabled")
135
- end
136
-
137
- pools_with_quantities = params.require(:subscriptions).map do |sub_params|
138
- PoolWithQuantities.new(Pool.find(sub_params['id']), sub_params['quantity'])
139
- end
140
-
141
- task = async_task(::Actions::BulkAction, ::Actions::Katello::Host::AttachSubscriptions, @hosts, pools_with_quantities)
142
- respond_for_async :resource => task
143
- end
144
-
145
- api :PUT, "/hosts/bulk/auto_attach", N_("Trigger an auto-attach of subscriptions on one or more hosts"), deprecated: true
146
- param_group :bulk_params
147
- def auto_attach
148
- task = async_task(::Actions::BulkAction, ::Actions::Katello::Host::AutoAttachSubscriptions, @hosts)
149
- respond_for_async :resource => task
150
- end
151
-
152
113
  api :PUT, "/hosts/bulk/content_overrides", N_("Set content overrides to one or more hosts")
153
114
  param_group :bulk_params
154
115
  param :content_overrides, Array, :desc => N_("Array of Content override parameters") do
@@ -310,10 +271,6 @@ module Katello
310
271
  find_bulk_hosts(:destroy_hosts, params)
311
272
  end
312
273
 
313
- def validate_organization
314
- fail HttpErrors::BadRequest, _("Organization ID is required") if @organization.blank?
315
- end
316
-
317
274
  def validate_host_collection_membership_limit
318
275
  max_hosts_exceeded = []
319
276
  host_ids = @hosts.map(&:id)
@@ -676,7 +676,6 @@ Alternatively, use the 'force' parameter to regenerate metadata locally. On the
676
676
  root.deb_releases = repo_params[:deb_releases] if repo_params[:deb_releases]
677
677
  root.deb_components = repo_params[:deb_components] if repo_params[:deb_components]
678
678
  root.deb_architectures = repo_params[:deb_architectures] if repo_params[:deb_architectures]
679
- root.content_id = 'INITIAL_DUMMY_VALUE' unless Setting['deb_enable_structured_apt']
680
679
  end
681
680
 
682
681
  if root.ansible_collection?
@@ -24,6 +24,9 @@ module Katello
24
24
  if taxonomy_class == Organization
25
25
  begin
26
26
  @taxonomy = Organization.new(resource_params)
27
+ # Raise validation error early if invalid
28
+ @taxonomy.validate!
29
+
27
30
  ::Katello::OrganizationCreator.new(@taxonomy).create!
28
31
  @taxonomy.reload
29
32
  switch_taxonomy
@@ -3,7 +3,6 @@ module Actions
3
3
  class ActivationKey::Create < Candlepin::Abstract
4
4
  input_format do
5
5
  param :organization_label
6
- param :auto_attach
7
6
  param :service_level
8
7
  param :release_version
9
8
  param :purpose_role
@@ -13,7 +12,6 @@ module Actions
13
12
  def run
14
13
  output[:response] = ::Katello::Resources::Candlepin::ActivationKey.create(::Katello::Util::Model.uuid,
15
14
  input[:organization_label],
16
- input[:auto_attach],
17
15
  input[:service_level],
18
16
  input[:release_version],
19
17
  input[:purpose_role],
@@ -6,7 +6,6 @@ module Actions
6
6
  param :cp_id
7
7
  param :release_version
8
8
  param :service_level
9
- param :auto_attach
10
9
  param :purpose_role
11
10
  param :purpose_usage
12
11
  end
@@ -16,7 +15,6 @@ module Actions
16
15
  input[:cp_id],
17
16
  input[:release_version],
18
17
  input[:service_level],
19
- input[:auto_attach],
20
18
  input[:purpose_role],
21
19
  input[:purpose_usage])
22
20
  end
@@ -16,12 +16,10 @@ module Actions
16
16
  def run
17
17
  content_url = input[:content_url]
18
18
  if input[:type] == ::Katello::Repository::DEB_TYPE
19
- # We must retrieve the repository in the run phase, so the latest Pulp version_href is
20
- # already set. This is needed to retrieve the latest repository.deb_content_url_options!
19
+ # We must retrieve the deb? repository in the run phase, so the latest Pulp version_href
20
+ # is set. This is needed to retrieve the latest repository.deb_content_url_options!
21
21
  repository = ::Katello::Repository.find(input[:repository_id])
22
- if repository.deb_using_structured_apt?
23
- content_url += repository.deb_content_url_options
24
- end
22
+ content_url += repository.deb_content_url_options
25
23
  end
26
24
 
27
25
  output[:response] = ::Katello::Resources::Candlepin::Content.
@@ -16,11 +16,10 @@ module Actions
16
16
  end
17
17
 
18
18
  def finalize
19
+ # finalize, because Katello::Product::ContentCreate updates repository.content_id during finalize!
19
20
  content_url = input[:content_url]
20
- # We must retrieve the repository in the finalize phase, because Katello::Product::ContentCreate
21
- # only updates the repository.content_id in the finalize phase!
22
21
  repository = ::Katello::Repository.find(input[:repository_id])
23
- if repository.deb_using_structured_apt?
22
+ if repository.deb?
24
23
  content_url += repository.deb_content_url_options
25
24
  end
26
25
 
@@ -2,7 +2,7 @@ module Actions
2
2
  module Helpers
3
3
  module RollingCVRepos
4
4
  def find_related_rolling_repos(repo)
5
- repo.root.repositories.in_environment(repo.environment).where(
5
+ repo.root.repositories.where(
6
6
  content_view_version: ::Katello::ContentViewVersion.where(content_view: ::Katello::ContentView.rolling)
7
7
  )
8
8
  end
@@ -6,7 +6,6 @@ module Actions
6
6
  activation_key.save!
7
7
  cp_create = plan_action(Candlepin::ActivationKey::Create,
8
8
  organization_label: activation_key.organization.label,
9
- auto_attach: activation_key.auto_attach,
10
9
  service_level: params[:service_level],
11
10
  release_version: activation_key.release_version,
12
11
  purpose_role: activation_key.purpose_role,
@@ -12,14 +12,12 @@ module Actions
12
12
  cp_id: activation_key.cp_id,
13
13
  release_version: activation_key.release_version,
14
14
  service_level: activation_key.service_level,
15
- auto_attach: activation_key.auto_attach,
16
15
  purpose_role: activation_key.purpose_role,
17
16
  purpose_usage: activation_key.purpose_usage)
18
17
  end
19
18
  end
20
19
 
21
20
  def update_candlepin?(activation_key, activation_key_params)
22
- cp_changed?(activation_key.auto_attach, activation_key_params[:auto_attach]) ||
23
21
  cp_changed?(activation_key.service_level, activation_key_params[:service_level]) ||
24
22
  cp_changed?(activation_key.release_version, activation_key_params[:release_version]) ||
25
23
  cp_changed?(activation_key.purpose_role, activation_key_params[:purpose_role]) ||
@@ -2,7 +2,6 @@ module Actions
2
2
  module Katello
3
3
  module CapsuleContent
4
4
  class SyncCapsule < ::Actions::EntryAction
5
- include Helpers::RollingCVRepos
6
5
  # rubocop:disable Metrics/MethodLength
7
6
  execution_plan_hooks.use :update_content_counts, :on => :success
8
7
  def plan(smart_proxy, options = {})
@@ -59,11 +58,7 @@ module Actions
59
58
  smart_proxy_helper.lifecycle_environment_check(environment, repository)
60
59
  if repository
61
60
  if skip_metatadata_check || !repository.smart_proxy_sync_histories.where(:smart_proxy_id => smart_proxy).any? { |sph| !sph.finished_at.nil? }
62
- if repository.library_instance?
63
- [repository] + find_related_rolling_repos(repository)
64
- else
65
- [repository]
66
- end
61
+ [repository]
67
62
  end
68
63
  else
69
64
  repositories = smart_proxy_helper.repositories_available_to_capsule(environment, content_view).by_rpm_count
@@ -6,7 +6,7 @@ module Actions
6
6
  action_subject gpg_key
7
7
  gpg_key.update!(gpg_key_params)
8
8
  gpg_key.repositories.each do |repository|
9
- if repository.content_type == ::Katello::Repository::DEB_TYPE
9
+ if repository.deb?
10
10
  plan_action(::Actions::Katello::Repository::RefreshRepository, repository)
11
11
  end
12
12
  end