katello 4.13.1 → 4.14.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 (386) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/katello/hosts/host_and_hostgroup_edit.js +12 -8
  3. data/app/assets/javascripts/katello/locale/bn/katello.js +274 -22
  4. data/app/assets/javascripts/katello/locale/bn_IN/katello.js +274 -22
  5. data/app/assets/javascripts/katello/locale/ca/katello.js +274 -22
  6. data/app/assets/javascripts/katello/locale/cs/katello.js +274 -22
  7. data/app/assets/javascripts/katello/locale/cs_CZ/katello.js +275 -23
  8. data/app/assets/javascripts/katello/locale/de/katello.js +280 -28
  9. data/app/assets/javascripts/katello/locale/de_AT/katello.js +274 -22
  10. data/app/assets/javascripts/katello/locale/de_DE/katello.js +274 -22
  11. data/app/assets/javascripts/katello/locale/el/katello.js +274 -22
  12. data/app/assets/javascripts/katello/locale/en/katello.js +274 -22
  13. data/app/assets/javascripts/katello/locale/en_GB/katello.js +274 -22
  14. data/app/assets/javascripts/katello/locale/en_US/katello.js +274 -22
  15. data/app/assets/javascripts/katello/locale/es/katello.js +276 -24
  16. data/app/assets/javascripts/katello/locale/et_EE/katello.js +274 -22
  17. data/app/assets/javascripts/katello/locale/fr/katello.js +283 -31
  18. data/app/assets/javascripts/katello/locale/gl/katello.js +274 -22
  19. data/app/assets/javascripts/katello/locale/gu/katello.js +274 -22
  20. data/app/assets/javascripts/katello/locale/he_IL/katello.js +274 -22
  21. data/app/assets/javascripts/katello/locale/hi/katello.js +274 -22
  22. data/app/assets/javascripts/katello/locale/id/katello.js +274 -22
  23. data/app/assets/javascripts/katello/locale/it/katello.js +274 -22
  24. data/app/assets/javascripts/katello/locale/ja/katello.js +283 -31
  25. data/app/assets/javascripts/katello/locale/ka/katello.js +280 -28
  26. data/app/assets/javascripts/katello/locale/kn/katello.js +274 -22
  27. data/app/assets/javascripts/katello/locale/ko/katello.js +274 -22
  28. data/app/assets/javascripts/katello/locale/ml_IN/katello.js +274 -22
  29. data/app/assets/javascripts/katello/locale/mr/katello.js +274 -22
  30. data/app/assets/javascripts/katello/locale/nl_NL/katello.js +274 -22
  31. data/app/assets/javascripts/katello/locale/or/katello.js +274 -22
  32. data/app/assets/javascripts/katello/locale/pa/katello.js +274 -22
  33. data/app/assets/javascripts/katello/locale/pl/katello.js +274 -22
  34. data/app/assets/javascripts/katello/locale/pl_PL/katello.js +274 -22
  35. data/app/assets/javascripts/katello/locale/pt/katello.js +274 -22
  36. data/app/assets/javascripts/katello/locale/pt_BR/katello.js +276 -24
  37. data/app/assets/javascripts/katello/locale/ro/katello.js +274 -22
  38. data/app/assets/javascripts/katello/locale/ro_RO/katello.js +274 -22
  39. data/app/assets/javascripts/katello/locale/ru/katello.js +274 -22
  40. data/app/assets/javascripts/katello/locale/sl/katello.js +274 -22
  41. data/app/assets/javascripts/katello/locale/sv_SE/katello.js +274 -22
  42. data/app/assets/javascripts/katello/locale/ta/katello.js +274 -22
  43. data/app/assets/javascripts/katello/locale/ta_IN/katello.js +274 -22
  44. data/app/assets/javascripts/katello/locale/te/katello.js +274 -22
  45. data/app/assets/javascripts/katello/locale/tr/katello.js +274 -22
  46. data/app/assets/javascripts/katello/locale/vi/katello.js +274 -22
  47. data/app/assets/javascripts/katello/locale/vi_VN/katello.js +274 -22
  48. data/app/assets/javascripts/katello/locale/zh/katello.js +274 -22
  49. data/app/assets/javascripts/katello/locale/zh_CN/katello.js +283 -31
  50. data/app/assets/javascripts/katello/locale/zh_TW/katello.js +274 -22
  51. data/app/controllers/katello/api/registry/registry_proxies_controller.rb +118 -74
  52. data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +15 -10
  53. data/app/controllers/katello/api/v2/activation_keys_controller.rb +1 -1
  54. data/app/controllers/katello/api/v2/api_controller.rb +7 -0
  55. data/app/controllers/katello/api/v2/content_view_versions_controller.rb +4 -4
  56. data/app/controllers/katello/api/v2/debs_controller.rb +3 -2
  57. data/app/controllers/katello/api/v2/environments_controller.rb +2 -4
  58. data/app/controllers/katello/api/v2/host_contents_controller.rb +8 -3
  59. data/app/controllers/katello/api/v2/host_errata_controller.rb +4 -4
  60. data/app/controllers/katello/api/v2/host_packages_controller.rb +2 -2
  61. data/app/controllers/katello/api/v2/organizations_controller.rb +1 -1
  62. data/app/controllers/katello/api/v2/packages_controller.rb +13 -3
  63. data/app/controllers/katello/api/v2/repositories_bulk_actions_controller.rb +6 -2
  64. data/app/controllers/katello/api/v2/repositories_controller.rb +3 -4
  65. data/app/controllers/katello/api/v2/repository_sets_controller.rb +13 -14
  66. data/app/controllers/katello/api/v2/subscriptions_controller.rb +15 -9
  67. data/app/controllers/katello/api/v2/sync_controller.rb +2 -2
  68. data/app/controllers/katello/application_controller.rb +1 -1
  69. data/app/controllers/katello/concerns/api/v2/authorization.rb +3 -2
  70. data/app/controllers/katello/concerns/api/v2/hosts_controller_extensions.rb +28 -0
  71. data/app/controllers/katello/concerns/api/v2/registration_commands_controller_extensions.rb +1 -1
  72. data/app/controllers/katello/concerns/api/v2/repository_content_controller.rb +4 -3
  73. data/app/controllers/katello/concerns/hosts_controller_extensions.rb +2 -4
  74. data/app/controllers/katello/remote_execution_controller.rb +53 -58
  75. data/app/helpers/katello/hosts_and_hostgroups_helper.rb +19 -2
  76. data/app/helpers/katello/katello_urls_helper.rb +1 -1
  77. data/app/lib/actions/katello/alternate_content_source/alternate_content_source_common.rb +1 -1
  78. data/app/lib/actions/katello/alternate_content_source/update.rb +2 -1
  79. data/app/lib/actions/katello/capsule_content/verify_checksum.rb +1 -2
  80. data/app/lib/actions/katello/content_view/publish.rb +1 -0
  81. data/app/lib/actions/katello/content_view_version/create_repos.rb +1 -0
  82. data/app/lib/actions/katello/content_view_version/incremental_update.rb +3 -2
  83. data/app/lib/actions/katello/environment/{publish_repositories.rb → publish_container_repositories.rb} +10 -8
  84. data/app/lib/actions/katello/foreman/content_update.rb +4 -6
  85. data/app/lib/actions/katello/host/hypervisors_update.rb +6 -4
  86. data/app/lib/actions/katello/repository/create.rb +4 -4
  87. data/app/lib/actions/katello/repository/import_upload.rb +4 -6
  88. data/app/lib/actions/katello/repository/metadata_generate.rb +1 -0
  89. data/app/lib/actions/katello/repository/update.rb +3 -3
  90. data/app/lib/actions/katello/repository_set/enable_repository.rb +5 -6
  91. data/app/lib/actions/middleware/backend_services_check.rb +3 -2
  92. data/app/lib/actions/pulp3/abstract_async_task.rb +2 -4
  93. data/app/lib/actions/pulp3/capsule_content/verify_checksum.rb +1 -2
  94. data/app/lib/actions/pulp3/orchestration/repository/copy_all_units.rb +5 -1
  95. data/app/lib/actions/pulp3/orchestration/repository/delete.rb +5 -2
  96. data/app/lib/actions/pulp3/repository/save_version.rb +3 -5
  97. data/app/lib/katello/concerns/base_template_scope_extensions.rb +5 -9
  98. data/app/lib/katello/errors.rb +1 -0
  99. data/app/lib/katello/http_resource.rb +1 -0
  100. data/app/lib/katello/lazy_accessor.rb +1 -1
  101. data/app/lib/katello/resources/candlepin/candlepin_ping.rb +0 -5
  102. data/app/lib/katello/resources/candlepin/owner.rb +1 -1
  103. data/app/lib/katello/resources/candlepin/pool.rb +1 -2
  104. data/app/lib/katello/resources/candlepin/upstream_job.rb +1 -1
  105. data/app/lib/katello/resources/cdn.rb +3 -2
  106. data/app/lib/katello/resources/discovery/yum.rb +3 -3
  107. data/app/lib/katello/util/cdn_var_substitutor.rb +5 -3
  108. data/app/lib/katello/util/data.rb +3 -2
  109. data/app/lib/katello/util/errata.rb +4 -3
  110. data/app/lib/katello/util/package.rb +3 -3
  111. data/app/lib/katello/util/path_with_substitutions.rb +1 -1
  112. data/app/lib/katello/util/report_table.rb +3 -2
  113. data/app/lib/katello/util/url_matcher.rb +1 -1
  114. data/app/lib/katello/validators/alternate_content_source_path_validator.rb +4 -3
  115. data/app/lib/katello/validators/alternate_content_source_products_validator.rb +5 -7
  116. data/app/lib/katello/validators/container_image_name_validator.rb +1 -1
  117. data/app/lib/katello/validators/katello_name_format_validator.rb +2 -2
  118. data/app/lib/katello/validators/no_trailing_space_validator.rb +2 -2
  119. data/app/lib/katello/validators/prior_validator.rb +2 -2
  120. data/app/lib/katello/validators/product_unique_attribute_validator.rb +2 -4
  121. data/app/models/katello/activation_key.rb +4 -6
  122. data/app/models/katello/alternate_content_source.rb +1 -1
  123. data/app/models/katello/authorization/host_tracer.rb +1 -2
  124. data/app/models/katello/candlepin/repository_mapper.rb +2 -2
  125. data/app/models/katello/concerns/host_managed_extensions.rb +41 -10
  126. data/app/models/katello/concerns/hostgroup_extensions.rb +2 -4
  127. data/app/models/katello/concerns/location_extensions.rb +2 -4
  128. data/app/models/katello/concerns/operatingsystem_extensions.rb +84 -16
  129. data/app/models/katello/concerns/smart_proxy_extensions.rb +4 -4
  130. data/app/models/katello/concerns/subscription_facet_host_extensions.rb +2 -0
  131. data/app/models/katello/content_view.rb +5 -1
  132. data/app/models/katello/content_view_environment.rb +19 -4
  133. data/app/models/katello/content_view_environment_content_facet.rb +11 -0
  134. data/app/models/katello/erratum.rb +1 -1
  135. data/app/models/katello/event.rb +1 -1
  136. data/app/models/katello/glue/provider.rb +1 -2
  137. data/app/models/katello/hash_util.rb +1 -1
  138. data/app/models/katello/host/content_facet.rb +16 -3
  139. data/app/models/katello/host/subscription_facet.rb +27 -4
  140. data/app/models/katello/host_collection.rb +12 -8
  141. data/app/models/katello/pool.rb +5 -1
  142. data/app/models/katello/product.rb +7 -4
  143. data/app/models/katello/provider.rb +1 -2
  144. data/app/models/katello/repository.rb +18 -4
  145. data/app/models/katello/root_repository.rb +19 -0
  146. data/app/models/katello/rpm.rb +2 -2
  147. data/app/models/katello/subscription_facet_pool.rb +1 -1
  148. data/app/models/katello/sync_plan.rb +5 -4
  149. data/app/models/katello/task_status.rb +18 -18
  150. data/app/presenters/katello/product_host_count_presenter.rb +10 -0
  151. data/app/services/katello/candlepin/consumer.rb +11 -11
  152. data/app/services/katello/candlepin/message_handler.rb +3 -2
  153. data/app/services/katello/content_unit_indexer.rb +6 -0
  154. data/app/services/katello/pulp3/alternate_content_source.rb +1 -3
  155. data/app/services/katello/pulp3/api/core.rb +1 -1
  156. data/app/services/katello/pulp3/api/docker.rb +10 -0
  157. data/app/services/katello/pulp3/content_view_version/export.rb +1 -0
  158. data/app/services/katello/pulp3/content_view_version/import.rb +6 -4
  159. data/app/services/katello/pulp3/content_view_version/importable_products.rb +1 -3
  160. data/app/services/katello/pulp3/repository/apt.rb +4 -16
  161. data/app/services/katello/pulp3/repository/yum.rb +9 -5
  162. data/app/services/katello/pulp3/repository.rb +2 -2
  163. data/app/services/katello/pulp3/repository_mirror.rb +2 -9
  164. data/app/services/katello/pulp3/task.rb +4 -2
  165. data/app/services/katello/registration_manager.rb +13 -3
  166. data/app/services/katello/smart_proxy_helper.rb +1 -0
  167. data/app/views/dashboard/_host_collection_widget.html.erb +5 -4
  168. data/app/views/foreman/job_templates/install_errata.erb +2 -0
  169. data/app/views/foreman/job_templates/install_errata_-_katello_ansible_default.erb +2 -0
  170. data/app/views/foreman/job_templates/install_errata_by_search_query.erb +2 -0
  171. data/app/views/foreman/job_templates/install_errata_by_search_query_-_katello_ansible_default.erb +3 -1
  172. data/app/views/foreman/job_templates/install_packages_by_search_query_-_katello_ansible_default.erb +1 -1
  173. data/app/views/foreman/job_templates/remove_packages_by_search_query_-_katello_ansible_default.erb +2 -2
  174. data/app/views/foreman/job_templates/resolve_traces.erb +5 -1
  175. data/app/views/foreman/job_templates/update_packages_by_search_query_-_katello_ansible_default.erb +1 -1
  176. data/app/views/foreman/job_templates/upload_profile.erb +2 -0
  177. data/app/views/foreman/smart_proxies/_reclaim_space.html.erb +7 -5
  178. data/app/views/katello/api/v2/content_facet/base.json.rabl +18 -2
  179. data/app/views/katello/api/v2/packages/thindex.json.rabl +6 -0
  180. data/app/views/katello/api/v2/repositories/show.json.rabl +8 -8
  181. data/app/views/katello/api/v2/repository_sets/show.json.rabl +1 -1
  182. data/app/views/katello/api/v2/subscription_facet/base.json.rabl +1 -1
  183. data/app/views/katello/api/v2/subscriptions/index.json.rabl +1 -0
  184. data/app/views/katello/api/v2/subscriptions/show.json.rabl +1 -0
  185. data/app/views/overrides/activation_keys/_host_environment_select.html.erb +14 -11
  186. data/app/views/overrides/activation_keys/_host_synced_content_select.html.erb +4 -4
  187. data/config/routes/api/v2.rb +3 -1
  188. data/config/routes.rb +1 -3
  189. data/db/migrate/20160114200145_add_mirror_on_sync_to_repositories.rb +1 -0
  190. data/db/migrate/20160131182301_add_download_policy_to_katello_repositories.rb +1 -0
  191. data/db/migrate/20210119162528_delete_puppet_and_ostree_repos.rb +3 -0
  192. data/db/migrate/20240522165308_add_priority_to_content_view_environment_content_facet.rb +5 -0
  193. data/db/migrate/20240621121212_katello_repository_debs_id_bigint.rb +6 -0
  194. data/db/migrate/20240729192228_add_convert2rhel_to_host_facets.rb +9 -0
  195. data/db/seeds.d/102-organizations.rb +5 -7
  196. data/db/seeds.d/150-module_job_templates.rb +7 -9
  197. data/db/seeds.d/75-job_templates.rb +9 -16
  198. data/engines/bastion_katello/README.md +3 -0
  199. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-errata.controller.js +3 -3
  200. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/debs/details/views/deb-info.html +6 -6
  201. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/views/erratum-content-hosts.html +2 -2
  202. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/bastion_katello.pot +4 -4
  203. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/views/package-info.html +6 -6
  204. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +28 -27
  205. data/engines/bastion_katello/lib/bastion_katello/engine.rb +2 -2
  206. data/lib/katello/engine.rb +1 -8
  207. data/lib/katello/permission_creator.rb +3 -2
  208. data/lib/katello/plugin.rb +31 -27
  209. data/lib/katello/tasks/clean_old_file_repos.rake +2 -4
  210. data/lib/katello/tasks/reset.rake +3 -4
  211. data/lib/katello/version.rb +1 -1
  212. data/lib/katello.rb +0 -2
  213. data/lib/monkeys/ar_postgres_evr_t.rb +2 -0
  214. data/locale/action_names.rb +1 -1
  215. data/locale/bn/LC_MESSAGES/katello.mo +0 -0
  216. data/locale/bn/katello.po +274 -22
  217. data/locale/bn_IN/katello.po +274 -22
  218. data/locale/ca/katello.po +274 -22
  219. data/locale/cs/katello.po +274 -22
  220. data/locale/cs_CZ/LC_MESSAGES/katello.mo +0 -0
  221. data/locale/cs_CZ/katello.po +275 -23
  222. data/locale/de/LC_MESSAGES/katello.mo +0 -0
  223. data/locale/de/katello.po +280 -28
  224. data/locale/de_AT/katello.po +274 -22
  225. data/locale/de_DE/katello.po +274 -22
  226. data/locale/el/katello.po +274 -22
  227. data/locale/en/katello.po +274 -22
  228. data/locale/en_GB/katello.po +274 -22
  229. data/locale/en_US/katello.po +274 -22
  230. data/locale/es/LC_MESSAGES/katello.mo +0 -0
  231. data/locale/es/katello.po +276 -24
  232. data/locale/et_EE/katello.po +274 -22
  233. data/locale/fr/LC_MESSAGES/katello.mo +0 -0
  234. data/locale/fr/katello.po +283 -31
  235. data/locale/gl/katello.po +274 -22
  236. data/locale/gu/katello.po +274 -22
  237. data/locale/he_IL/katello.po +274 -22
  238. data/locale/hi/katello.po +274 -22
  239. data/locale/id/katello.po +274 -22
  240. data/locale/it/LC_MESSAGES/katello.mo +0 -0
  241. data/locale/it/katello.po +274 -22
  242. data/locale/ja/LC_MESSAGES/katello.mo +0 -0
  243. data/locale/ja/katello.po +283 -31
  244. data/locale/ka/LC_MESSAGES/katello.mo +0 -0
  245. data/locale/ka/katello.po +280 -28
  246. data/locale/katello.pot +1001 -527
  247. data/locale/kn/katello.po +274 -22
  248. data/locale/ko/LC_MESSAGES/katello.mo +0 -0
  249. data/locale/ko/katello.po +274 -22
  250. data/locale/ml_IN/katello.po +274 -22
  251. data/locale/mr/katello.po +274 -22
  252. data/locale/nl_NL/katello.po +274 -22
  253. data/locale/or/katello.po +274 -22
  254. data/locale/pa/katello.po +274 -22
  255. data/locale/pl/katello.po +274 -22
  256. data/locale/pl_PL/katello.po +274 -22
  257. data/locale/pt/katello.po +274 -22
  258. data/locale/pt_BR/LC_MESSAGES/katello.mo +0 -0
  259. data/locale/pt_BR/katello.po +276 -24
  260. data/locale/ro/katello.po +274 -22
  261. data/locale/ro_RO/katello.po +274 -22
  262. data/locale/ru/LC_MESSAGES/katello.mo +0 -0
  263. data/locale/ru/katello.po +274 -22
  264. data/locale/sl/katello.po +274 -22
  265. data/locale/sv_SE/katello.po +274 -22
  266. data/locale/ta/LC_MESSAGES/katello.mo +0 -0
  267. data/locale/ta/katello.po +274 -22
  268. data/locale/ta_IN/katello.po +274 -22
  269. data/locale/te/katello.po +274 -22
  270. data/locale/tr/katello.po +274 -22
  271. data/locale/vi/katello.po +274 -22
  272. data/locale/vi_VN/katello.po +274 -22
  273. data/locale/zh/katello.po +274 -22
  274. data/locale/zh_CN/LC_MESSAGES/katello.mo +0 -0
  275. data/locale/zh_CN/katello.po +283 -31
  276. data/locale/zh_TW/LC_MESSAGES/katello.mo +0 -0
  277. data/locale/zh_TW/katello.po +274 -22
  278. data/webpack/ForemanColumnExtensions/index.js +44 -1
  279. data/webpack/components/Table/TableWrapper.js +6 -0
  280. data/webpack/components/extensions/HostDetails/Cards/ContentViewDetailsCard/ChangeHostCVModal.js +24 -3
  281. data/webpack/components/extensions/HostDetails/Cards/ContentViewDetailsCard/ContentViewDetailsCard.js +124 -56
  282. data/webpack/components/extensions/HostDetails/Cards/ContentViewDetailsCard/HostContentViewActions.js +2 -3
  283. data/webpack/components/extensions/HostDetails/Cards/ContentViewDetailsCard/__tests__/contentViewDetailsCard.test.js +44 -10
  284. data/webpack/components/extensions/HostDetails/Tabs/RemoteExecutionActions.js +75 -31
  285. data/webpack/components/extensions/HostDetails/Tabs/RemoteExecutionConstants.js +1 -0
  286. data/webpack/components/extensions/HostDetails/Tabs/RemoteExecutionHooks.js +1 -1
  287. data/webpack/components/extensions/HostDetails/Tabs/customizedRexUrlHelpers.js +22 -7
  288. data/webpack/components/extensions/Hosts/ActionsBar/ActionsBar.scss +14 -0
  289. data/webpack/components/extensions/Hosts/ActionsBar/index.js +82 -23
  290. data/webpack/components/extensions/Hosts/BulkActions/BulkChangeHostCVModal/index.js +5 -2
  291. data/webpack/components/extensions/Hosts/BulkActions/BulkErrataWizard/02_BulkErrataTable.js +171 -0
  292. data/webpack/components/extensions/Hosts/BulkActions/BulkErrataWizard/04_Review.js +160 -0
  293. data/webpack/components/extensions/Hosts/BulkActions/BulkErrataWizard/04_ReviewFooter.js +99 -0
  294. data/webpack/components/extensions/Hosts/BulkActions/BulkErrataWizard/BulkErrataWizard.js +157 -0
  295. data/webpack/components/extensions/Hosts/BulkActions/BulkErrataWizard/index.js +24 -0
  296. data/webpack/components/extensions/Hosts/BulkActions/BulkPackagesWizard/02_BulkPackagesTable.js +157 -0
  297. data/webpack/components/extensions/Hosts/BulkActions/BulkPackagesWizard/04_Review.js +168 -0
  298. data/webpack/components/extensions/Hosts/BulkActions/BulkPackagesWizard/04_ReviewFooter.js +141 -0
  299. data/webpack/components/extensions/Hosts/BulkActions/BulkPackagesWizard/BulkPackagesWizard.js +252 -0
  300. data/webpack/components/extensions/Hosts/BulkActions/BulkPackagesWizard/index.js +24 -0
  301. data/webpack/components/extensions/Hosts/BulkActions/HostReview.js +176 -0
  302. data/webpack/components/extensions/Hosts/TableRowActions/index.js +17 -0
  303. data/webpack/global_index.js +11 -3
  304. data/webpack/redux/actions/RedHatRepositories/repositorySetRepositories.js +5 -6
  305. data/webpack/redux/reducers/RedHatRepositories/__tests__/repositorySetRepositories.test.js +1 -1
  306. data/webpack/redux/reducers/RedHatRepositories/repositorySetRepositories.js +1 -1
  307. data/webpack/scenes/ContentViews/Copy/CopyContentViewModal.js +2 -1
  308. data/webpack/scenes/ContentViews/Details/ComponentContentViews/ComponentContentViewAddModal.js +2 -1
  309. data/webpack/scenes/ContentViews/Details/ComponentContentViews/ComponentContentViewBulkAddModal.js +2 -1
  310. data/webpack/scenes/ContentViews/Details/ComponentContentViews/ContentViewComponents.js +2 -1
  311. data/webpack/scenes/ContentViews/Details/ContentViewDetails.js +2 -1
  312. data/webpack/scenes/ContentViews/Details/Repositories/ContentViewRepositories.js +2 -2
  313. data/webpack/scenes/ContentViews/Publish/CVPublishForm.js +2 -1
  314. data/webpack/scenes/ContentViews/Publish/CVPublishReview.js +3 -2
  315. data/webpack/scenes/ContentViews/Publish/PublishContentViewWizard.js +2 -1
  316. data/webpack/scenes/ContentViews/Table/ContentViewsTable.js +2 -1
  317. data/webpack/scenes/ContentViews/components/CVBreadCrumb.js +2 -1
  318. data/webpack/scenes/ContentViews/components/ContentViewSelect/ContentViewSelectOption.js +2 -2
  319. data/webpack/scenes/Subscriptions/Details/SubscriptionAttributes.js +1 -0
  320. data/webpack/scenes/Subscriptions/Details/__tests__/__snapshots__/SubscriptionDetailInfo.test.js.snap +10 -0
  321. data/webpack/scenes/Subscriptions/SubscriptionConstants.js +6 -0
  322. data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsPage.test.js.snap +2 -0
  323. data/webpack/scenes/Subscriptions/__tests__/subscriptions.fixtures.js +14 -0
  324. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTableHelpers.js +1 -0
  325. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTableSchema.js +10 -0
  326. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTable.fixtures.js +1 -0
  327. data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/__snapshots__/SubscriptionsToolbar.test.js.snap +10 -0
  328. data/webpack/scenes/Tasks/helpers.js +1 -1
  329. metadata +24 -63
  330. data/app/assets/javascripts/katello/containers/container.js +0 -304
  331. data/app/lib/katello/util/http_helper.rb +0 -15
  332. data/app/models/732bd3db9f64c621c64d2be4f2a838727aac0845.patch +0 -61
  333. data/app/models/katello/repository.rb.bak +0 -978
  334. data/app/services/katello/pulp3/content_view_version/import_validator.rb.bak +0 -166
  335. data/app/services/katello/pulp3/content_view_version/importable_repositories.rb.bak +0 -164
  336. data/lib/katello/tasks/update_repository_expiry.rake +0 -114
  337. data/locale/bn/katello.po.time_stamp +0 -0
  338. data/locale/bn_IN/katello.po.time_stamp +0 -0
  339. data/locale/ca/katello.po.time_stamp +0 -0
  340. data/locale/cs/katello.po.time_stamp +0 -0
  341. data/locale/cs_CZ/katello.po.time_stamp +0 -0
  342. data/locale/de/katello.po.time_stamp +0 -0
  343. data/locale/de_AT/katello.po.time_stamp +0 -0
  344. data/locale/de_DE/katello.po.time_stamp +0 -0
  345. data/locale/el/katello.po.time_stamp +0 -0
  346. data/locale/en/katello.po.time_stamp +0 -0
  347. data/locale/en_GB/katello.po.time_stamp +0 -0
  348. data/locale/en_US/katello.po.time_stamp +0 -0
  349. data/locale/es/katello.po.time_stamp +0 -0
  350. data/locale/et_EE/katello.po.time_stamp +0 -0
  351. data/locale/fr/katello.po.time_stamp +0 -0
  352. data/locale/gl/katello.po.time_stamp +0 -0
  353. data/locale/gu/katello.po.time_stamp +0 -0
  354. data/locale/he_IL/katello.po.time_stamp +0 -0
  355. data/locale/hi/katello.po.time_stamp +0 -0
  356. data/locale/id/katello.po.time_stamp +0 -0
  357. data/locale/it/katello.po.time_stamp +0 -0
  358. data/locale/ja/katello.po.time_stamp +0 -0
  359. data/locale/ka/katello.po.time_stamp +0 -0
  360. data/locale/kn/katello.po.time_stamp +0 -0
  361. data/locale/ko/katello.po.time_stamp +0 -0
  362. data/locale/ml_IN/katello.po.time_stamp +0 -0
  363. data/locale/mr/katello.po.time_stamp +0 -0
  364. data/locale/nl_NL/katello.po.time_stamp +0 -0
  365. data/locale/or/katello.po.time_stamp +0 -0
  366. data/locale/pa/katello.po.time_stamp +0 -0
  367. data/locale/pl/katello.po.time_stamp +0 -0
  368. data/locale/pl_PL/katello.po.time_stamp +0 -0
  369. data/locale/pt/katello.po.time_stamp +0 -0
  370. data/locale/pt_BR/katello.po.time_stamp +0 -0
  371. data/locale/ro/katello.po.time_stamp +0 -0
  372. data/locale/ro_RO/katello.po.time_stamp +0 -0
  373. data/locale/ru/katello.po.time_stamp +0 -0
  374. data/locale/sl/katello.po.time_stamp +0 -0
  375. data/locale/sv_SE/katello.po.time_stamp +0 -0
  376. data/locale/ta/katello.po.time_stamp +0 -0
  377. data/locale/ta_IN/katello.po.time_stamp +0 -0
  378. data/locale/te/katello.po.time_stamp +0 -0
  379. data/locale/tr/katello.po.time_stamp +0 -0
  380. data/locale/vi/katello.po.time_stamp +0 -0
  381. data/locale/vi_VN/katello.po.time_stamp +0 -0
  382. data/locale/zh/katello.po.time_stamp +0 -0
  383. data/locale/zh_CN/katello.po.time_stamp +0 -0
  384. data/locale/zh_TW/katello.po.time_stamp +0 -0
  385. data/webpack/global_test_setup.js.bak +0 -59
  386. data/webpack/utils/useKatelloDocUrl.js +0 -18
@@ -32,6 +32,8 @@ module Katello
32
32
 
33
33
  EXPORTABLE_TYPES = [YUM_TYPE, FILE_TYPE, ANSIBLE_COLLECTION_TYPE, DOCKER_TYPE, DEB_TYPE].freeze
34
34
 
35
+ ALLOWED_UPDATE_FIELDS = ['version_href', 'last_indexed'].freeze
36
+
35
37
  define_model_callbacks :sync, :only => :after
36
38
 
37
39
  belongs_to :root, :inverse_of => :repositories, :class_name => "Katello::RootRepository"
@@ -119,8 +121,10 @@ module Katello
119
121
 
120
122
  before_validation :set_pulp_id
121
123
  before_validation :set_container_repository_name, :unless => :skip_container_name?
124
+ before_update :prevent_updates, :unless => :allow_updates?
122
125
 
123
126
  scope :has_url, -> { joins(:root).where.not("#{RootRepository.table_name}.url" => nil) }
127
+ scope :not_uln, -> { joins(:root).where("#{RootRepository.table_name}.url NOT LIKE 'uln%'") }
124
128
  scope :on_demand, -> { joins(:root).where("#{RootRepository.table_name}.download_policy" => ::Katello::RootRepository::DOWNLOAD_ON_DEMAND) }
125
129
  scope :immediate, -> { joins(:root).where("#{RootRepository.table_name}.download_policy" => ::Katello::RootRepository::DOWNLOAD_IMMEDIATE) }
126
130
  scope :non_immediate, -> { joins(:root).where.not("#{RootRepository.table_name}.download_policy" => ::Katello::RootRepository::DOWNLOAD_IMMEDIATE) }
@@ -166,7 +170,7 @@ module Katello
166
170
  scoped_search :on => :name, :relation => :product, :rename => :product_name
167
171
  scoped_search :on => :id, :relation => :product, :rename => :product_id, :only_explicit => true
168
172
  scoped_search :on => :label, :relation => :root, :complete_value => true, :only_explicit => true
169
- scoped_search :on => :content_label, :ext_method => :search_by_content_label
173
+ scoped_search :on => :content_label, :ext_method => :search_by_content_label, :default_operator => :like
170
174
 
171
175
  delegate :product, :redhat?, :custom?, :to => :root
172
176
  delegate :yum?, :docker?, :deb?, :file?, :ostree?, :ansible_collection?, :generic?, :to => :root
@@ -179,7 +183,7 @@ module Katello
179
183
  :deb_components, :deb_architectures, :ssl_ca_cert_id, :ssl_ca_cert, :ssl_client_cert, :ssl_client_cert_id,
180
184
  :ssl_client_key_id, :os_versions, :ssl_client_key, :ignorable_content, :description, :include_tags, :exclude_tags,
181
185
  :ansible_collection_requirements, :ansible_collection_auth_url, :ansible_collection_auth_token,
182
- :http_proxy_policy, :http_proxy_id, :to => :root
186
+ :http_proxy_policy, :http_proxy_id, :prevent_updates, :to => :root
183
187
 
184
188
  delegate :content_id, to: :root, allow_nil: true
185
189
  delegate :repository_type, to: :root
@@ -345,9 +349,10 @@ module Katello
345
349
  def content_counts
346
350
  content_counts = {}
347
351
  RepositoryTypeManager.defined_repository_types[content_type].content_types_to_index.each do |content_type|
348
- if content_type&.model_class::CONTENT_TYPE == DockerTag::CONTENT_TYPE
352
+ case content_type&.model_class::CONTENT_TYPE
353
+ when DockerTag::CONTENT_TYPE
349
354
  content_counts[DockerTag::CONTENT_TYPE] = docker_tags.count
350
- elsif content_type&.model_class::CONTENT_TYPE == GenericContentUnit::CONTENT_TYPE
355
+ when GenericContentUnit::CONTENT_TYPE
351
356
  content_counts[content_type.content_type] = content_type&.model_class&.in_repositories(self)&.where(:content_type => content_type.content_type)&.count
352
357
  else
353
358
  content_counts[content_type.label] = content_type&.model_class&.in_repositories(self)&.count
@@ -791,6 +796,8 @@ module Katello
791
796
  return true
792
797
  elsif !self.custom? && self.redhat_deletable?(remove_from_content_view_versions)
793
798
  return true
799
+ elsif Setting.find_by(name: 'delete_repo_across_cv')&.value
800
+ return true
794
801
  else
795
802
  errors.add(:base, _("Repository cannot be deleted since it has already been included in a published Content View. " \
796
803
  "Please delete all Content View versions containing this repository before attempting to delete it "\
@@ -1007,6 +1014,7 @@ module Katello
1007
1014
  repository_type.index_additional_data_proc&.call(self)
1008
1015
  end
1009
1016
  self.update!(last_indexed: DateTime.now)
1017
+
1010
1018
  true
1011
1019
  end
1012
1020
 
@@ -1048,6 +1056,12 @@ module Katello
1048
1056
  DockerMetaTag.cleanup_tags
1049
1057
  end
1050
1058
 
1059
+ def allow_updates?
1060
+ # allow the update if this repo is not in the default view
1061
+ return true unless in_default_view?
1062
+ root.allow_updates?(::Katello::Repository::ALLOWED_UPDATE_FIELDS)
1063
+ end
1064
+
1051
1065
  apipie :class, desc: "A class representing #{model_name.human} object" do
1052
1066
  name 'Repository'
1053
1067
  refs 'Repository'
@@ -46,6 +46,8 @@ module Katello
46
46
  MIRRORING_POLICY_COMPLETE = 'mirror_complete'.freeze
47
47
  MIRRORING_POLICIES = [MIRRORING_POLICY_ADDITIVE, MIRRORING_POLICY_COMPLETE, MIRRORING_POLICY_CONTENT].freeze
48
48
 
49
+ ALLOWED_UPDATE_FIELDS = ['updated_at', 'content_id'].freeze
50
+
49
51
  belongs_to :product, :inverse_of => :root_repositories, :class_name => "Katello::Product"
50
52
  has_one :provider, :through => :product
51
53
 
@@ -115,6 +117,7 @@ module Katello
115
117
  }
116
118
 
117
119
  validates :container_push_name_format, inclusion: { in: ['label', 'id'].freeze, allow_nil: true}
120
+ before_update :prevent_updates, :unless => :allow_updates?
118
121
 
119
122
  scope :subscribable, -> { where(content_type: RootRepository::SUBSCRIBABLE_TYPES) }
120
123
  scope :skipable_metadata_check, -> { where(content_type: RootRepository::SKIPABLE_METADATA_TYPES) }
@@ -455,6 +458,22 @@ module Katello
455
458
  end
456
459
  end
457
460
 
461
+ def allow_updates?(additional_allowed_fields = [])
462
+ # allow updates for non-container-push repos, repos not in default view, and
463
+ # repos with a library instance
464
+ return true unless is_container_push && library_instance.present?
465
+
466
+ # let updates that contain ONLY allowed strings through
467
+ allowed_fields = ::Katello::RootRepository::ALLOWED_UPDATE_FIELDS + additional_allowed_fields
468
+ return true if (changed - allowed_fields).empty?
469
+
470
+ false
471
+ end
472
+
473
+ def prevent_updates
474
+ fail _("Cannot update properties of a container push repository")
475
+ end
476
+
458
477
  apipie :class, desc: 'A class representing Repository object' do
459
478
  name 'Repository'
460
479
  refs 'Repository'
@@ -53,7 +53,7 @@ module Katello
53
53
  # https://github.com/wvanbergen/scoped_search/blob/master/lib/scoped_search/query_builder.rb
54
54
  if ['LIKE', 'NOT LIKE'].include?(operator)
55
55
  conditions = "#{self.table_name}.#{column} #{operator} ?"
56
- parameter = (value !~ /^\%|\*/ && value !~ /\%|\*$/) ? "%#{value}%" : value.tr_s('%*', '%')
56
+ parameter = (value !~ /^%|\*/ && value !~ /%|\*$/) ? "%#{value}%" : value.tr_s('%*', '%')
57
57
  return { :conditions => conditions, :parameter => [parameter] }
58
58
  elsif ['IN', 'NOT IN'].include?(operator)
59
59
  conditions = "#{self.table_name}.#{column} #{operator} (#{value.split(',').collect { '?' }.join(',')})"
@@ -124,7 +124,7 @@ module Katello
124
124
  end
125
125
 
126
126
  def self.scoped_search_evr_like(operator, value)
127
- val = (value !~ /^\%|\*/ && value !~ /\%|\*$/) ? "%#{value}%" : value.tr_s('%*', '%')
127
+ val = (value !~ /^%|\*/ && value !~ /%|\*$/) ? "%#{value}%" : value.tr_s('%*', '%')
128
128
  evr = Util::Package.parse_evr(val)
129
129
  (e, v, r) = [evr[:epoch], evr[:version], evr[:release]]
130
130
  conditions = []
@@ -1,6 +1,6 @@
1
1
  module Katello
2
2
  class SubscriptionFacetPool < Katello::Model
3
- # Note: Do not use active record call backs or dependent references on this class
3
+ # NOTE: Do not use active record call backs or dependent references on this class
4
4
  # Direct deletes are made in Pool#import_hosts (instead of destroys).
5
5
  belongs_to :subscription_facet, :inverse_of => :subscription_facet_pools, :class_name => 'Katello::Host::SubscriptionFacet'
6
6
  belongs_to :pool, :inverse_of => :subscription_facet_pools, :class_name => 'Katello::Pool'
@@ -148,13 +148,14 @@ module Katello
148
148
  if interval.nil?
149
149
  fail _("Interval cannot be nil")
150
150
  end
151
- if (interval.downcase.eql? "hourly")
151
+ case interval.downcase
152
+ when "hourly"
152
153
  cron = min.to_s + " * * * *"
153
- elsif (interval.downcase.eql? "daily")
154
+ when "daily"
154
155
  cron = min.to_s + " " + hour.to_s + " * * *"
155
- elsif (interval.downcase.eql? "weekly")
156
+ when "weekly"
156
157
  cron = min.to_s + " " + hour.to_s + " * * " + day.to_s
157
- elsif (interval.downcase.eql? CUSTOM_CRON)
158
+ when CUSTOM_CRON
158
159
  cron = cron_expression
159
160
  else
160
161
  fail _("Interval not set correctly")
@@ -154,18 +154,16 @@ module Katello
154
154
  when :package
155
155
  p = self.parameters[:packages]
156
156
  first_package = p.first.is_a?(Hash) ? p.first[:name] : p.first
157
- unless p && p.length > 0
158
- if self.task_type == "package_update"
159
- case self.overall_status
160
- when "running"
161
- return "updating"
162
- when "waiting"
163
- return "updating"
164
- when "error"
165
- return _("all packages update failed")
166
- else
167
- return _("all packages update")
168
- end
157
+ if !p && p.length > 0 && (self.task_type == "package_update")
158
+ case self.overall_status
159
+ when "running"
160
+ return "updating"
161
+ when "waiting"
162
+ return "updating"
163
+ when "error"
164
+ return _("all packages update failed")
165
+ else
166
+ return _("all packages update")
169
167
  end
170
168
  end
171
169
 
@@ -229,14 +227,15 @@ module Katello
229
227
  ret = []
230
228
  task_type = self.task_type.to_s
231
229
 
232
- if task_type =~ /^package_group/
230
+ case task_type
231
+ when /^package_group/
233
232
  action = task_type.include?("remove") ? :removed : :installed
234
233
  ret = packages_change_description(result[:details][:package_group], action)
235
- elsif task_type == "package_install" || task_type == "errata_install"
234
+ when "package_install", "errata_install"
236
235
  ret = packages_change_description(result[:details][:rpm], :installed)
237
- elsif task_type == "package_update"
236
+ when "package_update"
238
237
  ret = packages_change_description(result[:details][:rpm], :updated)
239
- elsif task_type == "package_remove"
238
+ when "package_remove"
240
239
  ret = packages_change_description(result[:details][:rpm], :removed)
241
240
  end
242
241
  ret
@@ -246,13 +245,14 @@ module Katello
246
245
  errors, stacktrace = self.result[:errors]
247
246
  return "" unless errors
248
247
  # Handle not very friendly Pulp message
249
- if errors =~ /^\(.*\)$/
248
+ case errors
249
+ when /^\(.*\)$/
250
250
  if stacktrace.class == Array
251
251
  stacktrace.last.split(":").first
252
252
  else
253
253
  stacktrace.split("(").first
254
254
  end
255
- elsif errors =~ /^\[.*,.*\]$/m
255
+ when /^\[.*,.*\]$/m
256
256
  result = errors.split(",").map do |error|
257
257
  error.gsub(/^\W+|\W+$/, "")
258
258
  end
@@ -0,0 +1,10 @@
1
+ module Katello
2
+ class ProductHostCountPresenter < SimpleDelegator
3
+ attr_reader :product_host_count
4
+
5
+ def initialize(pool)
6
+ @product_host_count = pool.product_host_count
7
+ super(pool)
8
+ end
9
+ end
10
+ end
@@ -136,26 +136,26 @@ module Katello
136
136
  def self.distribution_to_puppet_os(name)
137
137
  return ::Operatingsystem::REDHAT_ATOMIC_HOST_OS if name == ::Operatingsystem::REDHAT_ATOMIC_HOST_DISTRO_NAME
138
138
 
139
- name = name.downcase
140
- if name =~ /red\s*hat/
139
+ case name.downcase
140
+ when /red\s*hat/
141
141
  'RedHat'
142
- elsif name =~ /centos/
142
+ when /centos/
143
143
  'CentOS'
144
- elsif name =~ /fedora/
144
+ when /fedora/
145
145
  'Fedora'
146
- elsif name =~ /sles/ || name =~ /suse.*enterprise.*/
146
+ when /sles/, /suse.*enterprise.*/
147
147
  'SLES'
148
- elsif name =~ /debian/
148
+ when /debian/
149
149
  'Debian'
150
- elsif name =~ /ubuntu/
150
+ when /ubuntu/
151
151
  'Ubuntu'
152
- elsif name =~ /oracle/
152
+ when /oracle/
153
153
  'OracleLinux'
154
- elsif name =~ /almalinux/
154
+ when /almalinux/
155
155
  'AlmaLinux'
156
- elsif name =~ /rocky/
156
+ when /rocky/
157
157
  'Rocky'
158
- elsif name =~ /amazon/
158
+ when /amazon/
159
159
  'Amazon'
160
160
  else
161
161
  'Unknown'
@@ -43,9 +43,10 @@ module Katello
43
43
  end
44
44
 
45
45
  def pool_id
46
- if subject == 'pool.created' || subject == 'pool.deleted'
46
+ case subject
47
+ when 'pool.created', 'pool.deleted'
47
48
  content['entityId']
48
- elsif subject == 'entitlement.created' || subject == 'entitlement.deleted'
49
+ when 'entitlement.created', 'entitlement.deleted'
49
50
  content['referenceId']
50
51
  end
51
52
  end
@@ -38,6 +38,12 @@ module Katello
38
38
  end
39
39
  end
40
40
 
41
+ # Even after this bug (https://github.com/pulp/pulp_rpm/issues/2821) is fixed,
42
+ # it is possible to have duplicate errata asosociated to a repo.
43
+ if @content_type.label == 'erratum'
44
+ to_insert.uniq! { |row| row["pulp_id"] || row[:pulp_id] }
45
+ end
46
+
41
47
  next if to_insert.empty?
42
48
  insert_timestamps(to_insert)
43
49
  if @content_type.mutable
@@ -3,9 +3,7 @@ module Katello
3
3
  module Pulp3
4
4
  class AlternateContentSource
5
5
  include Katello::Pulp3::ServiceCommon
6
- attr_accessor :acs
7
- attr_accessor :smart_proxy
8
- attr_accessor :repository
6
+ attr_accessor :acs, :smart_proxy, :repository
9
7
 
10
8
  def initialize(acs, smart_proxy, repository = nil)
11
9
  @acs = acs
@@ -264,7 +264,7 @@ module Katello
264
264
  (response.count && (page_opts['offset'] < response.count)) ||
265
265
  page_opts["offset"] == 0)
266
266
  response = yield page_opts
267
- results = results.concat(response.results)
267
+ results.concat(response.results)
268
268
  page_opts[:offset] += page_size
269
269
  end
270
270
 
@@ -19,6 +19,16 @@ module Katello
19
19
  def container_push_api
20
20
  PulpContainerClient::RepositoriesContainerPushApi.new(api_client)
21
21
  end
22
+
23
+ def container_push_repo_for_name(name)
24
+ # There should be only one repository in Pulp with the requested name
25
+ container_push_api.list(name: name)&.results&.first
26
+ end
27
+
28
+ def container_push_distribution_for_repository(repository_href)
29
+ # There should be only one repository in Pulp with the requested repository_href
30
+ distributions_api.list(repository: repository_href)&.results&.first
31
+ end
22
32
  end
23
33
  end
24
34
  end
@@ -8,6 +8,7 @@ module Katello
8
8
  FORMATS = [SYNCABLE, IMPORTABLE].freeze
9
9
 
10
10
  attr_reader :smart_proxy, :content_view_version, :destination_server, :from_content_view_version, :repository, :base_path
11
+
11
12
  def self.create(options)
12
13
  if options.delete(:format) == SYNCABLE
13
14
  SyncableFormatExport.new(**options)
@@ -107,9 +107,10 @@ module Katello
107
107
  end
108
108
 
109
109
  def import_cv_name_from_export(name:, generated_for:)
110
- if generated_for == :library_import
110
+ case generated_for
111
+ when :library_import
111
112
  ::Katello::ContentView::IMPORT_LIBRARY
112
- elsif generated_for == :repository_import
113
+ when :repository_import
113
114
  name.gsub(/^Export/, 'Import')
114
115
  else
115
116
  name
@@ -138,9 +139,10 @@ module Katello
138
139
  }
139
140
  end
140
141
 
141
- if generated_for == :library_export
142
+ case generated_for
143
+ when :library_export
142
144
  generated_for = :library_import
143
- elsif generated_for == :repository_export
145
+ when :repository_export
144
146
  generated_for = :repository_import
145
147
  end
146
148
 
@@ -54,12 +54,10 @@ module Katello
54
54
  end
55
55
 
56
56
  def update_params(metadata_product)
57
- params = {
57
+ {
58
58
  gpg_key_id: gpg_key_id(metadata_product),
59
59
  description: metadata_product.description
60
60
  }
61
-
62
- params
63
61
  end
64
62
 
65
63
  def gpg_key_id(metadata_product)
@@ -51,16 +51,6 @@ module Katello
51
51
  popts
52
52
  end
53
53
 
54
- def mirror_publication_options
55
- {
56
- # Since we are synchronizing the "default" distribution from the simple publisher on the server,
57
- # it will be included in the structured publish. Therefore, we MUST NOT use the simple publisher
58
- # on the proxy, since this would collide!
59
- #simple: true,
60
- structured: true # publish real suites (e.g. 'stable')
61
- }
62
- end
63
-
64
54
  def distribution_options(path)
65
55
  {
66
56
  base_path: path,
@@ -87,12 +77,10 @@ module Katello
87
77
  # Not needed during incremental update due to dest_base_version
88
78
  # -> Unless incrementally updating a CV repo that is a soft copy of its library instance.
89
79
  # -> I.e. no filters and not an incremental version.
90
- unless dest_repo_id_map[:base_version]
91
- # Don't perform extra content actions if the repo is a soft copy of its library instance.
92
- # Taken care of by the IncrementalUpdate action.
93
- unless dest_repo.soft_copy_of_library?
94
- tasks << remove_all_content_from_repo(dest_repo_href)
95
- end
80
+ # Don't perform extra content actions if the repo is a soft copy of its library instance.
81
+ # Taken care of by the IncrementalUpdate action.
82
+ if !dest_repo_id_map[:base_version] && !dest_repo.soft_copy_of_library?
83
+ tasks << remove_all_content_from_repo(dest_repo_href)
96
84
  end
97
85
  source_repo_ids.each do |source_repo_id|
98
86
  source_repo_version = ::Katello::Repository.find(source_repo_id).version_href
@@ -22,7 +22,13 @@ module Katello
22
22
 
23
23
  def publication_options(repository_version)
24
24
  options = super(repository_version)
25
- options.merge(checksum_type: root.checksum_type)
25
+ # To work around https://projects.theforeman.org/issues/37715
26
+ checksum_type = if root.checksum_type.nil?
27
+ 'sha256'
28
+ else
29
+ root.checksum_type
30
+ end
31
+ options.merge(checksum_type: checksum_type)
26
32
  end
27
33
 
28
34
  def specific_create_options
@@ -57,10 +63,8 @@ module Katello
57
63
  :distribution_family => distribution.results.first.release_name,
58
64
  :distribution_bootable => self.class.distribution_bootable?(distribution)
59
65
  )
60
- unless distribution.results.first.variants.empty?
61
- unless distribution.results.first.variants.first.name.nil?
62
- repo.update!(:distribution_variant => distribution.results.first.variants.map(&:name).join(','))
63
- end
66
+ if !distribution.results.first.variants.empty? && !distribution.results.first.variants.first.name.nil?
67
+ repo.update!(:distribution_variant => distribution.results.first.variants.map(&:name).join(','))
64
68
  end
65
69
  end
66
70
  end
@@ -5,8 +5,8 @@ module Katello
5
5
  class Repository
6
6
  include Katello::Util::HttpProxy
7
7
  include Katello::Pulp3::ServiceCommon
8
- attr_accessor :repo
9
- attr_accessor :smart_proxy
8
+ attr_accessor :repo, :smart_proxy
9
+
10
10
  delegate :root, to: :repo
11
11
  delegate :pulp3_api, to: :smart_proxy
12
12
 
@@ -2,6 +2,7 @@ module Katello
2
2
  module Pulp3
3
3
  class RepositoryMirror
4
4
  attr_accessor :repo_service
5
+
5
6
  delegate :repo, to: :repo_service
6
7
  delegate :smart_proxy, to: :repo_service
7
8
 
@@ -166,21 +167,13 @@ module Katello
166
167
  uri.to_s
167
168
  end
168
169
 
169
- def publication_options(repository_version)
170
- popts = {repository_version: repository_version}
171
- if (type_specific_options = repo_service.try(:mirror_publication_options))
172
- popts.merge!(type_specific_options)
173
- end
174
- popts
175
- end
176
-
177
170
  def create_publication
178
171
  if (href = version_href)
179
172
  if repo_service.repo.content_type == "deb"
180
173
  publication_data = api.publication_verbatim_class.new({repository_version: href})
181
174
  api.publications_verbatim_api.create(publication_data)
182
175
  else
183
- publication_data = api.publication_class.new(publication_options(href))
176
+ publication_data = api.publication_class.new(repository_version: href)
184
177
  api.publications_api.create(publication_data)
185
178
  end
186
179
  end
@@ -39,6 +39,7 @@ module Katello
39
39
  #needed for serialization in dynflow
40
40
 
41
41
  attr_reader :pulp_data
42
+
42
43
  delegate :[], :key?, :dig, :to_hash, :to => :task_data
43
44
 
44
45
  def initialize(smart_proxy, data)
@@ -105,9 +106,10 @@ module Katello
105
106
  end
106
107
 
107
108
  def error
108
- if task_data[:state] == CANCELED
109
+ case task_data[:state]
110
+ when CANCELED
109
111
  _("Task canceled")
110
- elsif task_data[:state] == FAILED
112
+ when FAILED
111
113
  if task_data[:error][:description].blank?
112
114
  _("Pulp task error")
113
115
  else
@@ -125,9 +125,11 @@ module Katello
125
125
  # * organization_destroy: destroy some data associated with host, but
126
126
  # leave items alone that will be removed later as part of org destroy
127
127
  # * unregistering: unregister the host but don't destroy it
128
+ # * keep_kickstart_repository: ensure the KS repo ID is not set to nil
128
129
  def unregister_host(host, options = {})
129
130
  organization_destroy = options.fetch(:organization_destroy, false)
130
131
  unregistering = options.fetch(:unregistering, false)
132
+ keep_kickstart_repository = options.fetch(:keep_kickstart_repository, false)
131
133
 
132
134
  # if the first operation fails, just raise the error since there's nothing to clean up yet.
133
135
  candlepin_consumer_destroy(host.subscription_facet.uuid) if !organization_destroy && host.subscription_facet.try(:uuid)
@@ -138,7 +140,11 @@ module Katello
138
140
  host.subscription_facet.try(:destroy!)
139
141
 
140
142
  if unregistering
141
- remove_host_artifacts(host)
143
+ if keep_kickstart_repository
144
+ remove_host_artifacts(host, kickstart_repository_id: host&.content_facet&.kickstart_repository_id)
145
+ else
146
+ remove_host_artifacts(host)
147
+ end
142
148
  elsif organization_destroy
143
149
  host.content_facet.try(:destroy!)
144
150
  remove_host_artifacts(host, clear_content_facet: false)
@@ -152,7 +158,9 @@ module Katello
152
158
  new_host = host.new_record?
153
159
  unless new_host
154
160
  host.save!
155
- unregister_host(host, :unregistering => true)
161
+ # Keep the kickstart repository ID so the host's Medium isn't unset
162
+ # Important for registering a host during provisioning
163
+ unregister_host(host, :unregistering => true, :keep_kickstart_repository => true)
156
164
  host.reload
157
165
  end
158
166
 
@@ -294,13 +302,15 @@ module Katello
294
302
  subscription_facet
295
303
  end
296
304
 
297
- def remove_host_artifacts(host, clear_content_facet: true)
305
+ def remove_host_artifacts(host, clear_content_facet: true, kickstart_repository_id: nil)
306
+ Rails.logger.debug "Host ID: #{host.id}, clear_content_facet: #{clear_content_facet}, kickstart_repository_id: #{kickstart_repository_id}"
298
307
  if host.content_facet && clear_content_facet
299
308
  host.content_facet.bound_repositories = []
300
309
  host.content_facet.applicable_errata = []
301
310
  host.content_facet.uuid = nil
302
311
  host.content_facet.content_view_environments = []
303
312
  host.content_facet.content_source = ::SmartProxy.pulp_primary
313
+ host.content_facet.kickstart_repository_id = kickstart_repository_id
304
314
  host.content_facet.save!
305
315
  Rails.logger.debug "remove_host_artifacts: marking CVEs unchanged to prevent backend update"
306
316
  host.content_facet.mark_cves_unchanged
@@ -1,6 +1,7 @@
1
1
  module Katello
2
2
  class SmartProxyHelper
3
3
  attr_accessor :smart_proxy
4
+
4
5
  def initialize(smart_proxy)
5
6
  @smart_proxy = smart_proxy
6
7
  end
@@ -18,13 +18,14 @@
18
18
  </tr>
19
19
  </thead>
20
20
  <tbody>
21
+ <% installable_only = Setting['errata_status_installable'] %>
21
22
  <% host_collections.each do |host_collection| %>
22
23
  <tr>
23
24
  <td>
24
- <% if host_collection.security_updates? %>
25
- <a href="/host_collections/<%= host_collection.id %>" style="text-align: center"><i class="label label-danger">&nbsp;</i></a>
26
- <% elsif host_collection.bugzilla_updates? || host_collection.enhancement_updates? %>
27
- <a href="/host_collections/<%= host_collection.id %>" style="text-align: center"><i class="label label-warning">&nbsp;</i></a>
25
+ <% if host_collection.security_updates?(installable_only: installable_only) %>
26
+ <a href="/host_collections/<%= host_collection.id %>" style="text-align: center" title="<%= installable_only ? _('Installable security errata') : _('Applicable security errata') %>"><i class="label label-danger">&nbsp;</i></a>
27
+ <% elsif host_collection.bugzilla_updates?(installable_only: installable_only) || host_collection.enhancement_updates?(installable_only: installable_only) %>
28
+ <a href="/host_collections/<%= host_collection.id %>" style="text-align: center" title="<%= installable_only ? _('Installable bugfix/enhancement errata') : _('Applicable bugfix/enhancement errata') %>"><i class="label label-warning">&nbsp;</i></a>
28
29
  <% else %>
29
30
  <a href="/host_collections/<%= host_collection.id %>" style="text-align: center"><i class="label label-success">&nbsp;</i></a>
30
31
  <% end %>
@@ -14,6 +14,7 @@ foreign_input_sets:
14
14
  - template: Package Action - Script Default
15
15
  exclude: action,package
16
16
  %>
17
+ <%= snippet_if_exists(template_name + " custom pre") %>
17
18
  <% if @host.operatingsystem.family == 'Suse' -%>
18
19
  <% advisories = input(:errata).split(',').join(' ') -%>
19
20
  <%= render_template('Package Action - Script Default', :action => 'install -n -t patch', :package => advisories) %>
@@ -21,3 +22,4 @@ foreign_input_sets:
21
22
  <% advisories = input(:errata).split(',').map { |e| "--advisory=#{e}" }.join(' ') -%>
22
23
  <%= render_template('Package Action - Script Default', :action => 'update-minimal', :package => advisories) %>
23
24
  <% end -%>
25
+ <%= snippet_if_exists(template_name + " custom post") %>
@@ -14,6 +14,7 @@ provider_type: Ansible
14
14
  kind: job_template
15
15
  %>
16
16
 
17
+ <%= snippet_if_exists(template_name + " custom pre") %>
17
18
  <% if @host.operatingsystem.family == 'Suse' -%>
18
19
  <% advisories = input(:errata).split(',').join(' ') -%>
19
20
  <%= render_template('Run Command - Ansible Default', :command => "zypper -n install -t patch #{advisories}") %>
@@ -21,3 +22,4 @@ kind: job_template
21
22
  <% advisories = input(:errata).split(',').map { |e| "--advisory=#{e}" }.join(' ') -%>
22
23
  <%= render_template('Run Command - Ansible Default', :command => "yum -y update-minimal #{advisories}") %>
23
24
  <% end -%>
25
+ <%= snippet_if_exists(template_name + " custom post") %>