katello 4.13.0 → 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 (341) 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 -2
  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/discover.rb +11 -4
  88. data/app/lib/actions/katello/repository/import_upload.rb +4 -6
  89. data/app/lib/actions/katello/repository/metadata_generate.rb +1 -0
  90. data/app/lib/actions/katello/repository/update.rb +3 -3
  91. data/app/lib/actions/katello/repository_set/enable_repository.rb +5 -6
  92. data/app/lib/actions/middleware/backend_services_check.rb +3 -2
  93. data/app/lib/actions/pulp3/abstract_async_task.rb +2 -4
  94. data/app/lib/actions/pulp3/capsule_content/verify_checksum.rb +1 -2
  95. data/app/lib/actions/pulp3/orchestration/repository/copy_all_units.rb +5 -1
  96. data/app/lib/actions/pulp3/orchestration/repository/delete.rb +5 -2
  97. data/app/lib/actions/pulp3/repository/create_publication.rb +4 -0
  98. data/app/lib/actions/pulp3/repository/save_version.rb +3 -5
  99. data/app/lib/katello/concerns/base_template_scope_extensions.rb +5 -9
  100. data/app/lib/katello/errors.rb +1 -0
  101. data/app/lib/katello/http_resource.rb +1 -0
  102. data/app/lib/katello/lazy_accessor.rb +1 -1
  103. data/app/lib/katello/repo_discovery.rb +4 -190
  104. data/app/lib/katello/resources/candlepin/candlepin_ping.rb +0 -5
  105. data/app/lib/katello/resources/candlepin/owner.rb +1 -1
  106. data/app/lib/katello/resources/candlepin/pool.rb +1 -2
  107. data/app/lib/katello/resources/candlepin/upstream_job.rb +1 -1
  108. data/app/lib/katello/resources/cdn.rb +3 -2
  109. data/app/lib/katello/resources/discovery/container.rb +127 -0
  110. data/app/lib/katello/resources/discovery/yum.rb +95 -0
  111. data/app/lib/katello/util/cdn_var_substitutor.rb +5 -3
  112. data/app/lib/katello/util/data.rb +3 -2
  113. data/app/lib/katello/util/errata.rb +4 -3
  114. data/app/lib/katello/util/package.rb +3 -3
  115. data/app/lib/katello/util/path_with_substitutions.rb +1 -1
  116. data/app/lib/katello/util/report_table.rb +3 -2
  117. data/app/lib/katello/util/url_matcher.rb +1 -1
  118. data/app/lib/katello/validators/alternate_content_source_path_validator.rb +4 -3
  119. data/app/lib/katello/validators/alternate_content_source_products_validator.rb +5 -7
  120. data/app/lib/katello/validators/container_image_name_validator.rb +1 -1
  121. data/app/lib/katello/validators/katello_name_format_validator.rb +2 -2
  122. data/app/lib/katello/validators/no_trailing_space_validator.rb +2 -2
  123. data/app/lib/katello/validators/prior_validator.rb +2 -2
  124. data/app/lib/katello/validators/product_unique_attribute_validator.rb +2 -4
  125. data/app/models/katello/activation_key.rb +4 -6
  126. data/app/models/katello/alternate_content_source.rb +1 -1
  127. data/app/models/katello/authorization/host_tracer.rb +1 -2
  128. data/app/models/katello/candlepin/repository_mapper.rb +2 -2
  129. data/app/models/katello/concerns/host_managed_extensions.rb +41 -10
  130. data/app/models/katello/concerns/hostgroup_extensions.rb +2 -4
  131. data/app/models/katello/concerns/location_extensions.rb +2 -4
  132. data/app/models/katello/concerns/operatingsystem_extensions.rb +84 -16
  133. data/app/models/katello/concerns/smart_proxy_extensions.rb +4 -4
  134. data/app/models/katello/concerns/subscription_facet_host_extensions.rb +2 -0
  135. data/app/models/katello/content_view.rb +5 -1
  136. data/app/models/katello/content_view_environment.rb +19 -4
  137. data/app/models/katello/content_view_environment_content_facet.rb +11 -0
  138. data/app/models/katello/erratum.rb +1 -1
  139. data/app/models/katello/event.rb +1 -1
  140. data/app/models/katello/glue/provider.rb +1 -2
  141. data/app/models/katello/hash_util.rb +1 -1
  142. data/app/models/katello/host/content_facet.rb +16 -3
  143. data/app/models/katello/host/subscription_facet.rb +27 -4
  144. data/app/models/katello/host_collection.rb +12 -8
  145. data/app/models/katello/pool.rb +5 -1
  146. data/app/models/katello/product.rb +7 -4
  147. data/app/models/katello/provider.rb +1 -2
  148. data/app/models/katello/repository.rb +18 -4
  149. data/app/models/katello/root_repository.rb +29 -0
  150. data/app/models/katello/rpm.rb +2 -2
  151. data/app/models/katello/subscription_facet_pool.rb +1 -1
  152. data/app/models/katello/sync_plan.rb +5 -4
  153. data/app/models/katello/task_status.rb +18 -18
  154. data/app/presenters/katello/product_host_count_presenter.rb +10 -0
  155. data/app/services/katello/candlepin/consumer.rb +11 -11
  156. data/app/services/katello/candlepin/message_handler.rb +3 -2
  157. data/app/services/katello/content_unit_indexer.rb +6 -0
  158. data/app/services/katello/pulp3/alternate_content_source.rb +1 -3
  159. data/app/services/katello/pulp3/api/core.rb +1 -1
  160. data/app/services/katello/pulp3/api/docker.rb +10 -0
  161. data/app/services/katello/pulp3/content_view_version/export.rb +1 -0
  162. data/app/services/katello/pulp3/content_view_version/import.rb +6 -4
  163. data/app/services/katello/pulp3/content_view_version/importable_products.rb +1 -3
  164. data/app/services/katello/pulp3/repository/apt.rb +4 -16
  165. data/app/services/katello/pulp3/repository/yum.rb +9 -5
  166. data/app/services/katello/pulp3/repository.rb +2 -2
  167. data/app/services/katello/pulp3/repository_mirror.rb +2 -9
  168. data/app/services/katello/pulp3/task.rb +4 -2
  169. data/app/services/katello/registration_manager.rb +13 -3
  170. data/app/services/katello/repository_type.rb +1 -1
  171. data/app/services/katello/smart_proxy_helper.rb +1 -0
  172. data/app/views/dashboard/_host_collection_widget.html.erb +5 -4
  173. data/app/views/foreman/job_templates/install_errata.erb +2 -0
  174. data/app/views/foreman/job_templates/install_errata_-_katello_ansible_default.erb +2 -0
  175. data/app/views/foreman/job_templates/install_errata_by_search_query.erb +2 -0
  176. data/app/views/foreman/job_templates/install_errata_by_search_query_-_katello_ansible_default.erb +3 -1
  177. data/app/views/foreman/job_templates/install_packages_by_search_query_-_katello_ansible_default.erb +1 -1
  178. data/app/views/foreman/job_templates/remove_packages_by_search_query_-_katello_ansible_default.erb +2 -2
  179. data/app/views/foreman/job_templates/resolve_traces.erb +5 -1
  180. data/app/views/foreman/job_templates/update_packages_by_search_query_-_katello_ansible_default.erb +1 -1
  181. data/app/views/foreman/job_templates/upload_profile.erb +2 -0
  182. data/app/views/foreman/smart_proxies/_reclaim_space.html.erb +7 -5
  183. data/app/views/katello/api/v2/content_facet/base.json.rabl +18 -2
  184. data/app/views/katello/api/v2/packages/thindex.json.rabl +6 -0
  185. data/app/views/katello/api/v2/repositories/show.json.rabl +8 -8
  186. data/app/views/katello/api/v2/repository_sets/show.json.rabl +1 -1
  187. data/app/views/katello/api/v2/subscription_facet/base.json.rabl +1 -1
  188. data/app/views/katello/api/v2/subscriptions/index.json.rabl +1 -0
  189. data/app/views/katello/api/v2/subscriptions/show.json.rabl +1 -0
  190. data/app/views/overrides/activation_keys/_host_environment_select.html.erb +14 -11
  191. data/app/views/overrides/activation_keys/_host_synced_content_select.html.erb +4 -4
  192. data/config/initializers/monkeys.rb +0 -1
  193. data/config/routes/api/v2.rb +3 -1
  194. data/config/routes.rb +1 -3
  195. data/db/migrate/20160114200145_add_mirror_on_sync_to_repositories.rb +1 -0
  196. data/db/migrate/20160131182301_add_download_policy_to_katello_repositories.rb +1 -0
  197. data/db/migrate/20210119162528_delete_puppet_and_ostree_repos.rb +3 -0
  198. data/db/migrate/20240522165308_add_priority_to_content_view_environment_content_facet.rb +5 -0
  199. data/db/migrate/20240621121212_katello_repository_debs_id_bigint.rb +6 -0
  200. data/db/migrate/20240729192228_add_convert2rhel_to_host_facets.rb +9 -0
  201. data/db/seeds.d/102-organizations.rb +5 -7
  202. data/db/seeds.d/150-module_job_templates.rb +7 -9
  203. data/db/seeds.d/75-job_templates.rb +9 -16
  204. data/engines/bastion_katello/README.md +3 -0
  205. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-errata.controller.js +3 -3
  206. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/debs/details/views/deb-info.html +6 -6
  207. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/views/erratum-content-hosts.html +2 -2
  208. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/bastion_katello.pot +4 -4
  209. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/views/package-info.html +6 -6
  210. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +31 -27
  211. data/engines/bastion_katello/lib/bastion_katello/engine.rb +2 -2
  212. data/lib/katello/engine.rb +1 -8
  213. data/lib/katello/permission_creator.rb +3 -2
  214. data/lib/katello/plugin.rb +31 -27
  215. data/lib/katello/repository_types/docker.rb +1 -0
  216. data/lib/katello/repository_types/yum.rb +1 -0
  217. data/lib/katello/tasks/clean_old_file_repos.rake +2 -4
  218. data/lib/katello/tasks/reset.rake +3 -4
  219. data/lib/katello/version.rb +1 -1
  220. data/lib/katello.rb +0 -4
  221. data/lib/monkeys/ar_postgres_evr_t.rb +2 -0
  222. data/locale/action_names.rb +1 -1
  223. data/locale/bn/LC_MESSAGES/katello.mo +0 -0
  224. data/locale/bn/katello.po +274 -22
  225. data/locale/bn_IN/katello.po +274 -22
  226. data/locale/ca/katello.po +274 -22
  227. data/locale/cs/katello.po +274 -22
  228. data/locale/cs_CZ/LC_MESSAGES/katello.mo +0 -0
  229. data/locale/cs_CZ/katello.po +275 -23
  230. data/locale/de/LC_MESSAGES/katello.mo +0 -0
  231. data/locale/de/katello.po +280 -28
  232. data/locale/de_AT/katello.po +274 -22
  233. data/locale/de_DE/katello.po +274 -22
  234. data/locale/el/katello.po +274 -22
  235. data/locale/en/katello.po +274 -22
  236. data/locale/en_GB/katello.po +274 -22
  237. data/locale/en_US/katello.po +274 -22
  238. data/locale/es/LC_MESSAGES/katello.mo +0 -0
  239. data/locale/es/katello.po +276 -24
  240. data/locale/et_EE/katello.po +274 -22
  241. data/locale/fr/LC_MESSAGES/katello.mo +0 -0
  242. data/locale/fr/katello.po +283 -31
  243. data/locale/gl/katello.po +274 -22
  244. data/locale/gu/katello.po +274 -22
  245. data/locale/he_IL/katello.po +274 -22
  246. data/locale/hi/katello.po +274 -22
  247. data/locale/id/katello.po +274 -22
  248. data/locale/it/LC_MESSAGES/katello.mo +0 -0
  249. data/locale/it/katello.po +274 -22
  250. data/locale/ja/LC_MESSAGES/katello.mo +0 -0
  251. data/locale/ja/katello.po +283 -31
  252. data/locale/ka/LC_MESSAGES/katello.mo +0 -0
  253. data/locale/ka/katello.po +280 -28
  254. data/locale/katello.pot +1001 -527
  255. data/locale/kn/katello.po +274 -22
  256. data/locale/ko/LC_MESSAGES/katello.mo +0 -0
  257. data/locale/ko/katello.po +274 -22
  258. data/locale/ml_IN/katello.po +274 -22
  259. data/locale/mr/katello.po +274 -22
  260. data/locale/nl_NL/katello.po +274 -22
  261. data/locale/or/katello.po +274 -22
  262. data/locale/pa/katello.po +274 -22
  263. data/locale/pl/katello.po +274 -22
  264. data/locale/pl_PL/katello.po +274 -22
  265. data/locale/pt/katello.po +274 -22
  266. data/locale/pt_BR/LC_MESSAGES/katello.mo +0 -0
  267. data/locale/pt_BR/katello.po +276 -24
  268. data/locale/ro/katello.po +274 -22
  269. data/locale/ro_RO/katello.po +274 -22
  270. data/locale/ru/LC_MESSAGES/katello.mo +0 -0
  271. data/locale/ru/katello.po +274 -22
  272. data/locale/sl/katello.po +274 -22
  273. data/locale/sv_SE/katello.po +274 -22
  274. data/locale/ta/LC_MESSAGES/katello.mo +0 -0
  275. data/locale/ta/katello.po +274 -22
  276. data/locale/ta_IN/katello.po +274 -22
  277. data/locale/te/katello.po +274 -22
  278. data/locale/tr/katello.po +274 -22
  279. data/locale/vi/katello.po +274 -22
  280. data/locale/vi_VN/katello.po +274 -22
  281. data/locale/zh/katello.po +274 -22
  282. data/locale/zh_CN/LC_MESSAGES/katello.mo +0 -0
  283. data/locale/zh_CN/katello.po +283 -31
  284. data/locale/zh_TW/LC_MESSAGES/katello.mo +0 -0
  285. data/locale/zh_TW/katello.po +274 -22
  286. data/webpack/ForemanColumnExtensions/index.js +44 -1
  287. data/webpack/components/Table/TableWrapper.js +6 -0
  288. data/webpack/components/extensions/HostDetails/Cards/ContentViewDetailsCard/ChangeHostCVModal.js +24 -3
  289. data/webpack/components/extensions/HostDetails/Cards/ContentViewDetailsCard/ContentViewDetailsCard.js +124 -56
  290. data/webpack/components/extensions/HostDetails/Cards/ContentViewDetailsCard/HostContentViewActions.js +2 -3
  291. data/webpack/components/extensions/HostDetails/Cards/ContentViewDetailsCard/__tests__/contentViewDetailsCard.test.js +44 -10
  292. data/webpack/components/extensions/HostDetails/Tabs/RemoteExecutionActions.js +75 -31
  293. data/webpack/components/extensions/HostDetails/Tabs/RemoteExecutionConstants.js +1 -0
  294. data/webpack/components/extensions/HostDetails/Tabs/RemoteExecutionHooks.js +1 -1
  295. data/webpack/components/extensions/HostDetails/Tabs/customizedRexUrlHelpers.js +22 -7
  296. data/webpack/components/extensions/Hosts/ActionsBar/ActionsBar.scss +14 -0
  297. data/webpack/components/extensions/Hosts/ActionsBar/index.js +82 -23
  298. data/webpack/components/extensions/Hosts/BulkActions/BulkChangeHostCVModal/index.js +5 -2
  299. data/webpack/components/extensions/Hosts/BulkActions/BulkErrataWizard/02_BulkErrataTable.js +171 -0
  300. data/webpack/components/extensions/Hosts/BulkActions/BulkErrataWizard/04_Review.js +160 -0
  301. data/webpack/components/extensions/Hosts/BulkActions/BulkErrataWizard/04_ReviewFooter.js +99 -0
  302. data/webpack/components/extensions/Hosts/BulkActions/BulkErrataWizard/BulkErrataWizard.js +157 -0
  303. data/webpack/components/extensions/Hosts/BulkActions/BulkErrataWizard/index.js +24 -0
  304. data/webpack/components/extensions/Hosts/BulkActions/BulkPackagesWizard/02_BulkPackagesTable.js +157 -0
  305. data/webpack/components/extensions/Hosts/BulkActions/BulkPackagesWizard/04_Review.js +168 -0
  306. data/webpack/components/extensions/Hosts/BulkActions/BulkPackagesWizard/04_ReviewFooter.js +141 -0
  307. data/webpack/components/extensions/Hosts/BulkActions/BulkPackagesWizard/BulkPackagesWizard.js +252 -0
  308. data/webpack/components/extensions/Hosts/BulkActions/BulkPackagesWizard/index.js +24 -0
  309. data/webpack/components/extensions/Hosts/BulkActions/HostReview.js +176 -0
  310. data/webpack/components/extensions/Hosts/TableRowActions/index.js +17 -0
  311. data/webpack/global_index.js +11 -3
  312. data/webpack/redux/actions/RedHatRepositories/repositorySetRepositories.js +5 -6
  313. data/webpack/redux/reducers/RedHatRepositories/__tests__/repositorySetRepositories.test.js +1 -1
  314. data/webpack/redux/reducers/RedHatRepositories/repositorySetRepositories.js +1 -1
  315. data/webpack/scenes/ContentViews/Copy/CopyContentViewModal.js +2 -1
  316. data/webpack/scenes/ContentViews/Details/ComponentContentViews/ComponentContentViewAddModal.js +2 -1
  317. data/webpack/scenes/ContentViews/Details/ComponentContentViews/ComponentContentViewBulkAddModal.js +2 -1
  318. data/webpack/scenes/ContentViews/Details/ComponentContentViews/ContentViewComponents.js +2 -1
  319. data/webpack/scenes/ContentViews/Details/ContentViewDetails.js +2 -1
  320. data/webpack/scenes/ContentViews/Details/Repositories/ContentViewRepositories.js +2 -2
  321. data/webpack/scenes/ContentViews/Publish/CVPublishForm.js +2 -1
  322. data/webpack/scenes/ContentViews/Publish/CVPublishReview.js +3 -2
  323. data/webpack/scenes/ContentViews/Publish/PublishContentViewWizard.js +2 -1
  324. data/webpack/scenes/ContentViews/Table/ContentViewsTable.js +2 -1
  325. data/webpack/scenes/ContentViews/components/CVBreadCrumb.js +2 -1
  326. data/webpack/scenes/ContentViews/components/ContentViewSelect/ContentViewSelectOption.js +2 -2
  327. data/webpack/scenes/Subscriptions/Details/SubscriptionAttributes.js +1 -0
  328. data/webpack/scenes/Subscriptions/Details/__tests__/__snapshots__/SubscriptionDetailInfo.test.js.snap +10 -0
  329. data/webpack/scenes/Subscriptions/SubscriptionConstants.js +6 -0
  330. data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsPage.test.js.snap +2 -0
  331. data/webpack/scenes/Subscriptions/__tests__/subscriptions.fixtures.js +14 -0
  332. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTableHelpers.js +1 -0
  333. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTableSchema.js +10 -0
  334. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTable.fixtures.js +1 -0
  335. data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/__snapshots__/SubscriptionsToolbar.test.js.snap +10 -0
  336. data/webpack/scenes/Tasks/helpers.js +1 -1
  337. metadata +49 -29
  338. data/app/assets/javascripts/katello/containers/container.js +0 -304
  339. data/db/migrate/20240531193030_remove_sha1_repository_checksum_type.rb +0 -10
  340. data/lib/monkeys/anemone.rb +0 -33
  341. data/webpack/utils/useKatelloDocUrl.js +0 -18
@@ -155,8 +155,7 @@ Pass [] to make repo available for clients regardless of OS version. Maximum len
155
155
  query = query.where(:root_id => RootRepository.where(:label => params[:label])) if params[:label]
156
156
  query = index_relation_content_unit(query)
157
157
  query = index_relation_content_view(query)
158
- query = index_relation_environment(query)
159
- query
158
+ index_relation_environment(query)
160
159
  end
161
160
 
162
161
  def index_relation_product(query)
@@ -439,7 +438,7 @@ Alternatively, use the 'force' parameter to regenerate metadata locally. On the
439
438
  respond_for_async :resource => sync_task(::Actions::Katello::Repository::RemoveContent, @repository, @content, content_type: params[:content_type], sync_capsule: sync_capsule)
440
439
  end
441
440
 
442
- api :POST, "/repositories/:id/upload_content", N_("Upload content into the repository")
441
+ api :POST, "/repositories/:id/upload_content", N_("This endpoint is primarily designed for UI interactions and uploading content into the repository. For API-based uploads, please use the 'content_uploads' endpoint instead.")
443
442
  param :id, :number, :required => true, :desc => N_("repository ID")
444
443
  param :content, File, :required => true, :desc => N_("Content files to upload. Can be a single file or array of files.")
445
444
  param :content_type, String, :required => false, :desc => N_("The type of content to upload (srpm, file, etc.). Check uploadable types here: /katello/api/repositories/repository_types")
@@ -537,7 +536,7 @@ Alternatively, use the 'force' parameter to regenerate metadata locally. On the
537
536
  if @repository.root.gpg_key && @repository.root.gpg_key.content.present?
538
537
  render(:plain => @repository.root.gpg_key.content, :layout => false)
539
538
  else
540
- head(404)
539
+ head(:not_found)
541
540
  end
542
541
  end
543
542
 
@@ -144,8 +144,8 @@ module Katello
144
144
 
145
145
  relation = relation.where(Katello::Content.table_name => {:name => params[:name]}) if params[:name].present?
146
146
  # ignore with_custom if repository_type is specified
147
- if params[:repository_type].blank?
148
- relation = relation.redhat unless ::Foreman::Cast.to_bool(params[:with_custom])
147
+ if params[:repository_type].blank? && !::Foreman::Cast.to_bool(params[:with_custom])
148
+ relation = relation.redhat
149
149
  end
150
150
  index_relation_with_consumable_overrides(relation)
151
151
  end
@@ -240,18 +240,17 @@ module Katello
240
240
  end
241
241
 
242
242
  def sort_score(pc) # sort order for enabled
243
- score = if pc.enabled_content_override&.value == "1"
244
- 4 # overridden to enabled
245
- elsif pc.enabled_content_override.nil? && pc.enabled
246
- 3 # enabled
247
- elsif pc.enabled_content_override.nil? && !pc.enabled
248
- 2 # disabled
249
- elsif pc.enabled_content_override&.value == "0"
250
- 1 # overridden to disabled
251
- else
252
- 0
253
- end
254
- score
243
+ if pc.enabled_content_override&.value == "1"
244
+ 4 # overridden to enabled
245
+ elsif pc.enabled_content_override.nil? && pc.enabled
246
+ 3 # enabled
247
+ elsif pc.enabled_content_override.nil? && !pc.enabled
248
+ 2 # disabled
249
+ elsif pc.enabled_content_override&.value == "0"
250
+ 1 # overridden to disabled
251
+ else
252
+ 0
253
+ end
255
254
  end
256
255
 
257
256
  def custom_sort_results(unsorted_relation)
@@ -41,16 +41,17 @@ module Katello
41
41
  format.csv do
42
42
  options[:csv] = true
43
43
  collection = scoped_search(*base_args, options)
44
- csv_response(collection,
45
- [:id, :subscription_id, :name, :cp_id, :organization_id, :sockets, :cores,
46
- :start_date, :end_date, :consumed, :quantity, :account_number, :contract_number,
47
- :support_level, :ram, :stacking_id, :multi_entitlement, :type, :product_id,
48
- :unmapped_guest, :virt_only, :virt_who, :upstream?],
49
- ['Pool Id Number', 'Subscription Id', 'Name', 'Pool Id', 'Organization Id',
50
- 'Sockets', 'Cores', 'Start Date', 'End Date', 'Consumed', 'Quantity', 'Account Number',
51
- 'Contract Number', 'Support Level', 'RAM', 'Stacking Id', 'Multi Entitlement', 'Type',
52
- 'Product Id', 'Unmapped Guest', 'Virt Only', 'Requires Virt Who', 'Upstream'])
44
+ fields = [:id, :subscription_id, :name, :cp_id, :organization_id, :sockets, :cores,
45
+ :start_date, :end_date, :consumed, :quantity, :account_number, :contract_number,
46
+ :support_level, :ram, :stacking_id, :multi_entitlement, :type, :product_id,
47
+ :unmapped_guest, :virt_only, :virt_who, :upstream?, :product_host_count]
48
+ headers = ['Pool Id Number', 'Subscription Id', 'Name', 'Pool Id', 'Organization Id',
49
+ 'Sockets', 'Cores', 'Start Date', 'End Date', 'Consumed', 'Quantity', 'Account Number',
50
+ 'Contract Number', 'Support Level', 'RAM', 'Stacking Id', 'Multi Entitlement', 'Type',
51
+ 'Product Id', 'Unmapped Guest', 'Virt Only', 'Requires Virt Who', 'Upstream', 'Product Host Count']
52
+ csv_response(collection, fields, headers)
53
53
  end
54
+
54
55
  format.any do
55
56
  collection = scoped_search(*base_args, options)
56
57
  if params[:activation_key_id]
@@ -59,6 +60,9 @@ module Katello
59
60
  ActivationKeySubscriptionsPresenter.new(pool, key_pools)
60
61
  end
61
62
  end
63
+ collection[:results] = collection[:results].map do |pool|
64
+ ProductHostCountPresenter.new(pool)
65
+ end
62
66
  respond(:collection => collection)
63
67
  end
64
68
  end
@@ -88,6 +92,8 @@ module Katello
88
92
  fail HttpErrors::BadRequest, N_('This subscription is not relevant to the current organization.')
89
93
  end
90
94
 
95
+ @resource = ProductHostCountPresenter.new(@resource)
96
+
91
97
  respond(:resource => @resource)
92
98
  end
93
99
 
@@ -37,8 +37,8 @@ module Katello
37
37
  end
38
38
 
39
39
  def ensure_library
40
- unless @repository.nil?
41
- fail HttpErrors::NotFound, _("You can check sync status for repositories only in the library lifecycle environment.'") unless @repository.environment.library?
40
+ if !@repository.nil? && !@repository.environment.library?
41
+ fail HttpErrors::NotFound, _("You can check sync status for repositories only in the library lifecycle environment.'")
42
42
  end
43
43
  end
44
44
  end
@@ -108,7 +108,7 @@ module Katello
108
108
  exception = args.find { |o| o.is_a? Exception }
109
109
  message = args.find { |o| o.is_a? String } || exception.try(:message) || default_message
110
110
 
111
- status = if exception&.respond_to?(:status_code)
111
+ status = if exception.respond_to?(:status_code)
112
112
  exception.status_code
113
113
  else
114
114
  400
@@ -99,9 +99,10 @@ module Katello
99
99
  def find_param_arrays(hash = params)
100
100
  list_of_paths = []
101
101
  hash.each do |key, value|
102
- if value.is_a?(ActionController::Parameters) || value.is_a?(Hash)
102
+ case value
103
+ when ActionController::Parameters, Hash
103
104
  list_of_paths += find_param_arrays(value).compact.map { |inner_keys| [key] + inner_keys }
104
- elsif value.is_a?(Array)
105
+ when Array
105
106
  list_of_paths << [key]
106
107
  end
107
108
  end
@@ -18,6 +18,7 @@ module Katello
18
18
  included do
19
19
  prepend Overrides
20
20
  before_action :purpose_addon_params, only: [:create, :update]
21
+ before_action :set_content_view_environments, only: [:create, :update]
21
22
 
22
23
  def destroy
23
24
  Katello::RegistrationManager.unregister_host(@host, :unregistering => false)
@@ -39,6 +40,33 @@ module Katello
39
40
  params[:host][:subscription_facet_attributes][:purpose_addon_ids] = addons.map { |addon_name| ::Katello::PurposeAddon.find_or_create_by(name: addon_name).id }
40
41
  params[:host][:subscription_facet_attributes].delete(:purpose_addons)
41
42
  end
43
+
44
+ def set_content_view_environments
45
+ content_facet_attributes = params.dig(:host, :content_facet_attributes)
46
+ return if content_facet_attributes.blank? || @host&.content_facet.blank? ||
47
+ (cve_params[:content_view_id].present? && cve_params[:lifecycle_environment_id].present?)
48
+ new_cves = nil
49
+ if cve_params[:content_view_environments].present? && cve_params[:content_view_environment_ids].blank?
50
+ # Must do maps here to ensure CVEs remain in the same order.
51
+ # Using ActiveRecord .where will return them in a different order.
52
+ environment_names = cve_params[:content_view_environments].map(&:strip)
53
+ Rails.logger.debug "new environment names: #{environment_names}"
54
+ new_cves = environment_names.map do |name|
55
+ ::Katello::ContentViewEnvironment.with_candlepin_name(name, organization: @host.organization)
56
+ end
57
+ end
58
+ if cve_params[:content_view_environment_ids].present?
59
+ new_cves = cve_params[:content_view_environment_ids].map do |id|
60
+ ::Katello::ContentViewEnvironment.find_by(id: id)
61
+ end
62
+ end
63
+
64
+ @host.content_facet.content_view_environments = new_cves.compact if new_cves.present?
65
+ end
66
+
67
+ def cve_params
68
+ params.require(:host).require(:content_facet_attributes).permit(:content_view_id, :lifecycle_environment_id, content_view_environments: [], content_view_environment_ids: [])
69
+ end
42
70
  end
43
71
  end
44
72
  end
@@ -28,7 +28,7 @@ module Katello
28
28
  update_api(:create) do
29
29
  param :registration_command, Hash do
30
30
  param :activation_key, String, desc: N_('Activation key for subscription-manager client, required for CentOS and Red Hat Enterprise Linux. For multiple keys use `activation_keys` param instead.'), deprecated: true
31
- param :activation_keys, Array, desc: N_('Activation keys for subscription-manager client, required for CentOS and Red Hat Enterprise Linux. Required only if host group has no activation keys.')
31
+ param :activation_keys, Array, desc: N_('Activation keys for subscription-manager client, required for CentOS and Red Hat Enterprise Linux. Required only if host group has no activation keys or if you do not provide a host group.')
32
32
  param :force, :bool, required: false, desc: N_('Clear any previous registration and run subscription-manager with --force.')
33
33
  param :ignore_subman_errors, :bool, required: false, desc: N_('Ignore subscription-manager errors for `subscription-manager register` command')
34
34
  end
@@ -101,9 +101,10 @@ module Katello
101
101
  end
102
102
 
103
103
  def sort_options
104
- if default_sort.is_a?(Array)
104
+ case default_sort
105
+ when Array
105
106
  return [default_sort[0], default_sort[1], {}]
106
- elsif default_sort.is_a?(Proc)
107
+ when Proc
107
108
  return [nil, nil, { :custom_sort => default_sort }]
108
109
  else
109
110
  fail "Unsupported default_sort type"
@@ -145,7 +146,7 @@ module Katello
145
146
  def compare_same(collection, content_view_versions = nil)
146
147
  cv_version_first = content_view_versions[0]
147
148
  collection_ids = collection.in_repositories(Katello::Repository.where(:content_view_version_id => cv_version_first&.id))&.pluck(:id)
148
- content_view_versions[1..-1].each do |version|
149
+ content_view_versions[1..].each do |version|
149
150
  collection_version_ids = collection.in_repositories(Katello::Repository.where(:content_view_version_id => version&.id))&.pluck(:id)
150
151
  collection_ids = collection_ids.intersection collection_version_ids
151
152
  end
@@ -94,10 +94,8 @@ module Katello
94
94
  .joins(:lifecycle_environments)
95
95
  .distinct
96
96
 
97
- if Katello.with_remote_execution?
98
- template_id = RemoteExecutionFeature.feature!(:katello_change_content_source).job_template_id
99
- job_invocation_path = new_job_invocation_path(template_id: template_id, host_ids: content_hosts.map { |h| h[:id] }) if template_id
100
- end
97
+ template_id = RemoteExecutionFeature.feature!(:katello_change_content_source).job_template_id
98
+ job_invocation_path = new_job_invocation_path(template_id: template_id, host_ids: content_hosts.map { |h| h[:id] }) if template_id
101
99
 
102
100
  render json: {
103
101
  content_hosts: content_hosts,
@@ -1,75 +1,70 @@
1
1
  module Katello
2
- if Katello.with_remote_execution?
3
- class RemoteExecutionController < JobInvocationsController
4
- include ::Api::V2::BulkHostsExtension
5
- include Concerns::Api::V2::HostErrataExtensions
2
+ class RemoteExecutionController < JobInvocationsController
3
+ include ::Api::V2::BulkHostsExtension
4
+ include Concerns::Api::V2::HostErrataExtensions
6
5
 
7
- def new
8
- @composer = prepare_composer
9
- end
10
-
11
- def create
12
- @composer = prepare_composer
13
- if params[:customize] != 'true' && @composer.save
14
- @composer.trigger
15
- redirect_to job_invocation_path(@composer.job_invocation)
16
- else
17
- render :action => 'new'
18
- end
19
- end
6
+ def new
7
+ @composer = prepare_composer
8
+ end
20
9
 
21
- # to overcome the isolated namespace engine difficulties with paths
22
- helper Rails.application.routes.url_helpers
23
- def _routes
24
- Rails.application.routes
10
+ def create
11
+ @composer = prepare_composer
12
+ if params[:customize] != 'true' && @composer.save
13
+ @composer.trigger
14
+ redirect_to job_invocation_path(@composer.job_invocation)
15
+ else
16
+ render :action => 'new'
25
17
  end
18
+ end
26
19
 
27
- private
20
+ # to overcome the isolated namespace engine difficulties with paths
21
+ helper Rails.application.routes.url_helpers
22
+ def _routes
23
+ Rails.application.routes
24
+ end
28
25
 
29
- def prepare_composer
30
- JobInvocationComposer.for_feature(feature_name, hosts, inputs)
31
- end
26
+ private
32
27
 
33
- def hosts
34
- bulk_host_ids = ActiveSupport::JSON.decode(params[:bulk_host_ids]).deep_symbolize_keys
28
+ def prepare_composer
29
+ JobInvocationComposer.for_feature(feature_name, hosts, inputs)
30
+ end
35
31
 
36
- find_bulk_hosts('edit_hosts', bulk_host_ids)
37
- end
32
+ def hosts
33
+ bulk_host_ids = ActiveSupport::JSON.decode(params[:bulk_host_ids]).deep_symbolize_keys
38
34
 
39
- def errata_inputs
40
- if ::Foreman::Cast.to_bool(params[:install_all])
41
- Erratum.installable_for_hosts(hosts).pluck(:errata_id).join(',')
42
- elsif params[:bulk_errata_ids]
43
- find_bulk_errata_ids(hosts, params[:bulk_errata_ids]).join(',')
44
- else
45
- params[:name]
46
- end
47
- end
35
+ find_bulk_hosts('edit_hosts', bulk_host_ids)
36
+ end
48
37
 
49
- def inputs
50
- case feature_name
51
- when 'katello_errata_install'
52
- { :errata => errata_inputs }
53
- when 'katello_service_restart'
54
- { :helper => params[:name] }
55
- when 'katello_module_stream_action'
56
- fail HttpErrors::NotFound, _('module streams not found') if params[:module_spec].blank?
57
- fail HttpErrors::NotFound, _('actions not found') if params[:module_stream_action].blank?
58
- inputs = { :module_spec => params[:module_spec], :action => params[:module_stream_action] }
59
- inputs[:options] = params[:options] if params[:options]
60
- inputs
61
- else
62
- { :package => params[:name] }
63
- end
38
+ def errata_inputs
39
+ if ::Foreman::Cast.to_bool(params[:install_all])
40
+ Erratum.installable_for_hosts(hosts).pluck(:errata_id).join(',')
41
+ elsif params[:bulk_errata_ids]
42
+ find_bulk_errata_ids(hosts, params[:bulk_errata_ids]).join(',')
43
+ else
44
+ params[:name]
64
45
  end
46
+ end
65
47
 
66
- def feature_name
67
- # getting packageInstall from UI, translating to 'katello_package_install' feature
68
- "katello_#{params[:remote_action].underscore}"
48
+ def inputs
49
+ case feature_name
50
+ when 'katello_errata_install'
51
+ { :errata => errata_inputs }
52
+ when 'katello_service_restart'
53
+ { :helper => params[:name] }
54
+ when 'katello_module_stream_action'
55
+ fail HttpErrors::NotFound, _('module streams not found') if params[:module_spec].blank?
56
+ fail HttpErrors::NotFound, _('actions not found') if params[:module_stream_action].blank?
57
+ inputs = { :module_spec => params[:module_spec], :action => params[:module_stream_action] }
58
+ inputs[:options] = params[:options] if params[:options]
59
+ inputs
60
+ else
61
+ { :package => params[:name] }
69
62
  end
70
63
  end
71
- else
72
- class RemoteExecutionController < ApplicationController
64
+
65
+ def feature_name
66
+ # getting packageInstall from UI, translating to 'katello_package_install' feature
67
+ "katello_#{params[:remote_action].underscore}"
73
68
  end
74
69
  end
75
70
  end
@@ -12,6 +12,22 @@ module Katello
12
12
  edit_action? && !using_discovered_hosts_page?
13
13
  end
14
14
 
15
+ def content_source_inherited?(host)
16
+ !using_hostgroups_page? && host&.content_source.blank? && host&.hostgroup&.content_source.present? && cv_lce_disabled?
17
+ end
18
+
19
+ def lifecycle_environment_inherited?(host)
20
+ !using_hostgroups_page? && host&.lifecycle_environments&.empty? && host&.hostgroup&.lifecycle_environment.present? && cv_lce_disabled?
21
+ end
22
+
23
+ def content_view_inherited?(host)
24
+ !using_hostgroups_page? && host&.content_views&.empty? && host&.hostgroup&.content_view.present? && cv_lce_disabled?
25
+ end
26
+
27
+ def kickstart_repo_inheritable?(host)
28
+ host&.kickstart_repository_id.blank?
29
+ end
30
+
15
31
  def using_discovered_hosts_page?
16
32
  controller.controller_name == "discovered_hosts"
17
33
  end
@@ -138,9 +154,10 @@ module Katello
138
154
  all_options = []
139
155
  orgs.each do |org|
140
156
  content_object_options = ""
141
- accessible_content_objects = if object_type == :lifecycle_environment
157
+ accessible_content_objects = case object_type
158
+ when :lifecycle_environment
142
159
  accessible_lifecycle_environments(org, host)
143
- elsif object_type == :content_source
160
+ when :content_source
144
161
  accessible_content_proxies(host)
145
162
  end
146
163
  accessible_content_objects.each do |content_object|
@@ -44,7 +44,7 @@ module Katello
44
44
  returns String, desc: 'Absolute path to a file'
45
45
  end
46
46
  def repository_url(content_path, _content_type = nil, schema = 'http')
47
- return content_path if content_path =~ %r|^([\w\-\+]+)://|
47
+ return content_path if content_path =~ %r|^([\w\-+]+)://|
48
48
  url = if @host.content_source
49
49
  "#{schema}://#{@host.content_source.hostname}"
50
50
  else
@@ -4,7 +4,7 @@ module Actions
4
4
  module AlternateContentSourceCommon
5
5
  def create_simplified_acs(acs, smart_proxy)
6
6
  acs.products.each do |product|
7
- product.repositories.has_url.library.with_type(acs.content_type).each do |repo|
7
+ product.acs_compatible_repositories.with_type(acs.content_type).each do |repo|
8
8
  smart_proxy_acs = ::Katello::SmartProxyAlternateContentSource.create(alternate_content_source_id: acs.id, smart_proxy_id: smart_proxy.id, repository_id: repo.id)
9
9
  plan_action(Pulp3::Orchestration::AlternateContentSource::Create, smart_proxy_acs)
10
10
  end
@@ -63,12 +63,13 @@ module Actions
63
63
  plan_action(Pulp3::Orchestration::AlternateContentSource::Update, smart_proxy_acs)
64
64
  elsif acs.simplified?
65
65
  products_to_associate.each do |product|
66
- product.repositories.library.with_type(acs.content_type).each do |repo|
66
+ product.acs_compatible_repositories.with_type(acs.content_type).each do |repo|
67
67
  smart_proxy_acs = ::Katello::SmartProxyAlternateContentSource.create(alternate_content_source_id: acs.id, smart_proxy_id: smart_proxy.id, repository_id: repo.id)
68
68
  plan_action(Pulp3::Orchestration::AlternateContentSource::Create, smart_proxy_acs)
69
69
  end
70
70
  end
71
71
  products_to_disassociate.each do |product|
72
+ # Don't use the acs_compatible_repositories filter here to ensure the proper repositories get disassociated
72
73
  product.repositories.library.with_type(acs.content_type).each do |repo|
73
74
  smart_proxy_acs = ::Katello::SmartProxyAlternateContentSource.find_by(alternate_content_source_id: acs.id, smart_proxy_id: smart_proxy.id, repository_id: repo.id)
74
75
  plan_action(Pulp3::Orchestration::AlternateContentSource::Delete, smart_proxy_acs) if smart_proxy_acs.present?
@@ -36,8 +36,7 @@ module Actions
36
36
  if repository
37
37
  [repository]
38
38
  else
39
- repositories = smart_proxy_helper.repositories_available_to_capsule(environment, content_view).by_rpm_count
40
- repositories
39
+ smart_proxy_helper.repositories_available_to_capsule(environment, content_view).by_rpm_count
41
40
  end
42
41
  end
43
42
 
@@ -6,6 +6,7 @@ module Actions
6
6
  include ::Katello::ContentViewHelper
7
7
  include ::Actions::ObservableAction
8
8
  attr_accessor :version
9
+
9
10
  execution_plan_hooks.use :trigger_capsule_sync, :on => :success
10
11
  execution_plan_hooks.use :notify_on_failure, :on => [:failure, :paused]
11
12
 
@@ -4,6 +4,7 @@ module Actions
4
4
  class CreateRepos < Actions::Base
5
5
  # allows accessing the build object from the superior action
6
6
  attr_accessor :repository_mapping
7
+
7
8
  def plan(version, source_repositories = [])
8
9
  self.repository_mapping = {}
9
10
  concurrence do
@@ -127,9 +127,10 @@ module Actions
127
127
  ::Katello::Rpm.with_identifiers(content[:package_ids])
128
128
  unit_map = { :errata => [], :rpms => [] }
129
129
  units.each do |unit|
130
- if unit.class.name == "Katello::Erratum"
130
+ case unit.class.name
131
+ when "Katello::Erratum"
131
132
  unit_map[:errata] << unit.id
132
- elsif unit.class.name == "Katello::Rpm"
133
+ when "Katello::Rpm"
133
134
  unit_map[:rpms] << unit.id
134
135
  end
135
136
  end
@@ -1,7 +1,7 @@
1
1
  module Actions
2
2
  module Katello
3
3
  module Environment
4
- class PublishRepositories < Actions::EntryAction
4
+ class PublishContainerRepositories < Actions::EntryAction
5
5
  middleware.use ::Actions::Middleware::RemoteAction
6
6
 
7
7
  input_format do
@@ -9,16 +9,18 @@ module Actions
9
9
  param :name
10
10
  end
11
11
 
12
- def plan(env, options = {})
13
- repositories = options[:content_type] ? env.repositories.with_type(options[:content_type]) : env.repositories
12
+ def plan(env)
13
+ repositories = env.repositories.docker_type
14
14
  action_subject(env)
15
15
  concurrence do
16
16
  repositories.each do |repository|
17
17
  sequence do
18
- repository.set_container_repository_name
19
- repository.clear_smart_proxy_sync_histories
20
- plan_action(::Actions::Katello::Repository::InstanceUpdate, repository)
21
- plan_action(::Actions::Katello::Repository::CapsuleSync, repository)
18
+ unless repository.root.is_container_push && repository.library_instance?
19
+ repository.set_container_repository_name
20
+ repository.clear_smart_proxy_sync_histories
21
+ plan_action(::Actions::Katello::Repository::InstanceUpdate, repository)
22
+ plan_action(::Actions::Katello::Repository::CapsuleSync, repository)
23
+ end
22
24
  end
23
25
  end
24
26
 
@@ -31,7 +33,7 @@ module Actions
31
33
  end
32
34
 
33
35
  def humanized_name
34
- _("Publish Lifecycle Environment Repositories")
36
+ _("Publish Lifecycle Environment Container Repositories")
35
37
  end
36
38
 
37
39
  def humanized_input
@@ -20,12 +20,10 @@ module Actions
20
20
  content_view = ::Katello::ContentView.find(input[:content_view_id])
21
21
  repository = ::Katello::Repository.find(input[:repository_id]) if input[:repository_id]
22
22
 
23
- if content_view.default? && repository
24
- if repository.distribution_bootable?
25
- os = Redhat.find_or_create_operating_system(repository)
26
- arch = Architecture.where(:name => repository.distribution_arch).first_or_create!
27
- os.architectures << arch unless os.architectures.include?(arch)
28
- end
23
+ if content_view.default? && repository && repository.distribution_bootable?
24
+ os = Redhat.find_or_create_operating_system(repository)
25
+ arch = Architecture.where(:name => repository.distribution_arch).first_or_create!
26
+ os.architectures << arch unless os.architectures.include?(arch)
29
27
  end
30
28
  end
31
29
  end
@@ -33,6 +33,8 @@ module Actions
33
33
  end
34
34
  end
35
35
 
36
+ return if @duplicate_uuid_hypervisors.empty?
37
+
36
38
  @duplicate_uuid_hypervisors.each do |hypervisor, existing_host|
37
39
  fail _("Host creation was skipped for %s because it shares a BIOS UUID with %s. " \
38
40
  "To report this hypervisor, override its dmi.system.uuid fact or set 'candlepin.use_system_uuid_for_matching' " \
@@ -120,8 +122,8 @@ module Actions
120
122
  end
121
123
 
122
124
  def validate_host_organization(host, organization)
123
- if host.organization_id.nil? || host.organization_id != organization
124
- fail _("Host '%{name}' does not belong to an organization") % {:name => host.name} unless host.organization
125
+ if (host.organization_id.nil? || host.organization_id != organization) && !host.organization
126
+ fail _("Host '%{name}' does not belong to an organization") % {:name => host.name}
125
127
  end
126
128
  end
127
129
 
@@ -175,8 +177,8 @@ module Actions
175
177
  end
176
178
 
177
179
  def update_facts(uuid, host)
178
- if @candlepin_attributes.key?(uuid)
179
- ::Katello::Host::SubscriptionFacet.update_facts(host, @candlepin_attributes[uuid][:facts]) unless @candlepin_attributes[uuid][:facts].blank?
180
+ if @candlepin_attributes.key?(uuid) && !@candlepin_attributes[uuid][:facts].blank?
181
+ ::Katello::Host::SubscriptionFacet.update_facts(host, @candlepin_attributes[uuid][:facts])
180
182
  end
181
183
  end
182
184
 
@@ -2,7 +2,7 @@ module Actions
2
2
  module Katello
3
3
  module Repository
4
4
  class Create < Actions::EntryAction
5
- # rubocop:disable Metrics/MethodLength
5
+ # rubocop:disable Metrics/MethodLength, Metrics/CyclomaticComplexity
6
6
  def plan(repository, args = {})
7
7
  clone = args[:clone] || false
8
8
  force_repo_create = args[:force_repo_create] || false
@@ -15,7 +15,7 @@ module Actions
15
15
  sequence do
16
16
  # Container push repositories will already be in pulp. The version_href is
17
17
  # directly updated after a push.
18
- unless root.is_container_push
18
+ unless root.is_container_push && repository.in_default_view?
19
19
  create_action = plan_action(Pulp3::Orchestration::Repository::Create,
20
20
  repository, SmartProxy.pulp_primary, force_repo_create)
21
21
  return if create_action.error
@@ -36,10 +36,10 @@ module Actions
36
36
  end
37
37
 
38
38
  # Container push repos do not need metadata generation or ACS (they do not sync)
39
- unless root.is_container_push
39
+ unless root.is_container_push && repository.in_default_view?
40
40
  concurrence do
41
41
  plan_self(:repository_id => repository.id, :clone => clone)
42
- if !clone && repository.url.present?
42
+ if !clone && repository.url.present? && !repository.url.start_with?('uln')
43
43
  repository.product.alternate_content_sources.with_type(repository.content_type).each do |acs|
44
44
  acs.smart_proxies.each do |smart_proxy|
45
45
  smart_proxy_acs = ::Katello::SmartProxyAlternateContentSource.create(alternate_content_source_id: acs.id, smart_proxy_id: smart_proxy.id, repository_id: repository.id)
@@ -31,10 +31,17 @@ module Actions
31
31
  (on nil do
32
32
  unless output[:to_follow].empty?
33
33
  password = decrypt_field(input[:upstream_password])
34
- repo_discovery = ::Katello::RepoDiscovery.new(input[:url], input[:content_type],
35
- input[:upstream_username], password,
36
- input[:search],
37
- output[:crawled], output[:repo_urls], output[:to_follow])
34
+ repo_discovery = ::Katello::RepoDiscovery.class_for(input[:content_type]).new(
35
+ input[:url],
36
+ output[:crawled],
37
+ output[:repo_urls],
38
+ output[:to_follow],
39
+ {
40
+ upstream_username: input[:upstream_username],
41
+ upstream_password: password,
42
+ search: input[:search]
43
+ }
44
+ )
38
45
 
39
46
  repo_discovery.run(output[:to_follow].shift)
40
47
  suspend { |suspended_action| world.clock.ping suspended_action, 0.001 }