katello 4.14.1 → 4.15.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 (453) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/katello/common/chosen.jquery.js +3 -3
  3. data/app/assets/javascripts/katello/common/env_select_scroll.js +3 -3
  4. data/app/assets/javascripts/katello/common/katello.js +8 -7
  5. data/app/assets/javascripts/katello/common/katello_object.js +3 -3
  6. data/app/assets/javascripts/katello/common/menu.js +7 -7
  7. data/app/assets/javascripts/katello/hosts/host_and_hostgroup_edit.js +6 -6
  8. data/app/assets/javascripts/katello/locale/bn/katello.js +259 -28
  9. data/app/assets/javascripts/katello/locale/bn_IN/katello.js +258 -27
  10. data/app/assets/javascripts/katello/locale/ca/katello.js +258 -27
  11. data/app/assets/javascripts/katello/locale/cs/katello.js +258 -27
  12. data/app/assets/javascripts/katello/locale/cs_CZ/katello.js +258 -27
  13. data/app/assets/javascripts/katello/locale/de/katello.js +259 -28
  14. data/app/assets/javascripts/katello/locale/de_AT/katello.js +258 -27
  15. data/app/assets/javascripts/katello/locale/de_DE/katello.js +258 -27
  16. data/app/assets/javascripts/katello/locale/el/katello.js +258 -27
  17. data/app/assets/javascripts/katello/locale/en/katello.js +258 -27
  18. data/app/assets/javascripts/katello/locale/en_GB/katello.js +258 -27
  19. data/app/assets/javascripts/katello/locale/en_US/katello.js +258 -27
  20. data/app/assets/javascripts/katello/locale/es/katello.js +259 -28
  21. data/app/assets/javascripts/katello/locale/et_EE/katello.js +258 -27
  22. data/app/assets/javascripts/katello/locale/fr/katello.js +259 -28
  23. data/app/assets/javascripts/katello/locale/gl/katello.js +258 -27
  24. data/app/assets/javascripts/katello/locale/gu/katello.js +258 -27
  25. data/app/assets/javascripts/katello/locale/he_IL/katello.js +258 -27
  26. data/app/assets/javascripts/katello/locale/hi/katello.js +258 -27
  27. data/app/assets/javascripts/katello/locale/id/katello.js +258 -27
  28. data/app/assets/javascripts/katello/locale/it/katello.js +259 -28
  29. data/app/assets/javascripts/katello/locale/ja/katello.js +259 -28
  30. data/app/assets/javascripts/katello/locale/ka/katello.js +259 -28
  31. data/app/assets/javascripts/katello/locale/kn/katello.js +258 -27
  32. data/app/assets/javascripts/katello/locale/ko/katello.js +259 -28
  33. data/app/assets/javascripts/katello/locale/ml_IN/katello.js +258 -27
  34. data/app/assets/javascripts/katello/locale/mr/katello.js +258 -27
  35. data/app/assets/javascripts/katello/locale/nl_NL/katello.js +258 -27
  36. data/app/assets/javascripts/katello/locale/or/katello.js +258 -27
  37. data/app/assets/javascripts/katello/locale/pa/katello.js +258 -27
  38. data/app/assets/javascripts/katello/locale/pl/katello.js +258 -27
  39. data/app/assets/javascripts/katello/locale/pl_PL/katello.js +258 -27
  40. data/app/assets/javascripts/katello/locale/pt/katello.js +258 -27
  41. data/app/assets/javascripts/katello/locale/pt_BR/katello.js +259 -28
  42. data/app/assets/javascripts/katello/locale/ro/katello.js +258 -27
  43. data/app/assets/javascripts/katello/locale/ro_RO/katello.js +258 -27
  44. data/app/assets/javascripts/katello/locale/ru/katello.js +259 -28
  45. data/app/assets/javascripts/katello/locale/sl/katello.js +258 -27
  46. data/app/assets/javascripts/katello/locale/sv_SE/katello.js +258 -27
  47. data/app/assets/javascripts/katello/locale/ta/katello.js +259 -28
  48. data/app/assets/javascripts/katello/locale/ta_IN/katello.js +258 -27
  49. data/app/assets/javascripts/katello/locale/te/katello.js +258 -27
  50. data/app/assets/javascripts/katello/locale/tr/katello.js +258 -27
  51. data/app/assets/javascripts/katello/locale/vi/katello.js +258 -27
  52. data/app/assets/javascripts/katello/locale/vi_VN/katello.js +258 -27
  53. data/app/assets/javascripts/katello/locale/zh/katello.js +258 -27
  54. data/app/assets/javascripts/katello/locale/zh_CN/katello.js +259 -28
  55. data/app/assets/javascripts/katello/locale/zh_TW/katello.js +259 -28
  56. data/app/assets/javascripts/katello/organizations/download_certificate.js +1 -1
  57. data/app/assets/javascripts/katello/sync_management/sync_management.js +9 -9
  58. data/app/assets/javascripts/katello/widgets/env_content_view_selector.js +5 -5
  59. data/app/assets/javascripts/katello/widgets/path_selector.js +6 -6
  60. data/app/assets/javascripts/katello/widgets/subpanel_new.js +1 -1
  61. data/app/controllers/katello/api/registry/registry_proxies_controller.rb +7 -7
  62. data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +6 -1
  63. data/app/controllers/katello/api/v2/activation_keys_controller.rb +131 -59
  64. data/app/controllers/katello/api/v2/api_controller.rb +1 -1
  65. data/app/controllers/katello/api/v2/capsule_content_controller.rb +21 -10
  66. data/app/controllers/katello/api/v2/content_view_components_controller.rb +1 -1
  67. data/app/controllers/katello/api/v2/content_view_environments_controller.rb +54 -0
  68. data/app/controllers/katello/api/v2/content_view_versions_controller.rb +3 -3
  69. data/app/controllers/katello/api/v2/content_views_controller.rb +1 -1
  70. data/app/controllers/katello/api/v2/environments_controller.rb +1 -1
  71. data/app/controllers/katello/api/v2/exports_controller.rb +1 -1
  72. data/app/controllers/katello/api/v2/host_collections_controller.rb +2 -2
  73. data/app/controllers/katello/api/v2/host_contents_controller.rb +1 -1
  74. data/app/controllers/katello/api/v2/host_errata_controller.rb +1 -1
  75. data/app/controllers/katello/api/v2/host_subscriptions_controller.rb +1 -1
  76. data/app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb +1 -4
  77. data/app/controllers/katello/api/v2/organizations_controller.rb +1 -1
  78. data/app/controllers/katello/api/v2/repositories_controller.rb +3 -2
  79. data/app/controllers/katello/api/v2/repository_sets_controller.rb +1 -1
  80. data/app/controllers/katello/concerns/api/v2/hosts_controller_extensions.rb +10 -16
  81. data/app/controllers/katello/concerns/api/v2/multi_cv_params_handling.rb +24 -0
  82. data/app/controllers/katello/concerns/authorization/api/v2/content_views_controller.rb +2 -5
  83. data/app/controllers/katello/concerns/hosts_controller_extensions.rb +1 -1
  84. data/app/controllers/katello/concerns/registration_commands_controller_extensions.rb +1 -1
  85. data/app/helpers/katello/concerns/smart_proxy_helper_extensions.rb +5 -5
  86. data/app/helpers/katello/hosts_and_hostgroups_helper.rb +2 -2
  87. data/app/helpers/katello/katello_url_helper.rb +1 -1
  88. data/app/lib/actions/candlepin/product/content_create.rb +12 -1
  89. data/app/lib/actions/candlepin/product/content_update.rb +21 -4
  90. data/app/lib/actions/katello/activation_key/reassign.rb +4 -3
  91. data/app/lib/actions/katello/capsule_content/sync_capsule.rb +8 -3
  92. data/app/lib/actions/katello/capsule_content/update_content_counts.rb +21 -3
  93. data/app/lib/actions/katello/cdn_configuration/update.rb +1 -1
  94. data/app/lib/actions/katello/content_view/capsule_sync.rb +17 -1
  95. data/app/lib/actions/katello/content_view/incremental_updates.rb +1 -1
  96. data/app/lib/actions/katello/content_view/presenters/incremental_updates_presenter.rb +1 -1
  97. data/app/lib/actions/katello/content_view/remove.rb +8 -12
  98. data/app/lib/actions/katello/content_view_version/import.rb +1 -1
  99. data/app/lib/actions/katello/content_view_version/incremental_update.rb +2 -2
  100. data/app/lib/actions/katello/flatpak/scan_remote.rb +62 -0
  101. data/app/lib/actions/katello/host/hypervisors.rb +1 -1
  102. data/app/lib/actions/katello/product/content_create.rb +28 -19
  103. data/app/lib/actions/katello/product/content_destroy.rb +6 -5
  104. data/app/lib/actions/katello/product/destroy.rb +1 -1
  105. data/app/lib/actions/katello/repository/clone_contents.rb +14 -0
  106. data/app/lib/actions/katello/repository/create.rb +24 -17
  107. data/app/lib/actions/katello/repository/create_container_push_root.rb +44 -0
  108. data/app/lib/actions/katello/repository/create_root.rb +5 -15
  109. data/app/lib/actions/katello/repository/destroy.rb +3 -3
  110. data/app/lib/actions/katello/repository/discover.rb +1 -1
  111. data/app/lib/actions/katello/repository/finish_upload.rb +13 -0
  112. data/app/lib/actions/katello/repository/import_upload.rb +1 -1
  113. data/app/lib/actions/katello/repository/sync.rb +16 -0
  114. data/app/lib/actions/katello/repository/update.rb +11 -20
  115. data/app/lib/actions/katello/repository/upload_files.rb +1 -1
  116. data/app/lib/actions/katello/repository_set/enable_repository.rb +1 -1
  117. data/app/lib/actions/katello/repository_set/scan_cdn.rb +1 -1
  118. data/app/lib/actions/katello/upstream_subscriptions/bind_entitlement.rb +1 -1
  119. data/app/lib/actions/pulp3/capsule_content/sync.rb +1 -1
  120. data/app/lib/actions/pulp3/orchestration/content_view_version/export_library.rb +1 -1
  121. data/app/lib/actions/pulp3/orchestration/repository/create.rb +6 -1
  122. data/app/lib/actions/pulp3/orchestration/repository/trigger_update_repo_cert_guard.rb +1 -1
  123. data/app/lib/actions/pulp3/repository/initialize.rb +17 -0
  124. data/app/lib/actions/pulp3/repository/refresh_distribution.rb +1 -1
  125. data/app/lib/katello/api/constraints/register_with_activation_key_constraint.rb +11 -0
  126. data/app/lib/katello/concerns/base_template_scope_extensions.rb +1 -1
  127. data/app/lib/katello/http_resource.rb +6 -6
  128. data/app/lib/katello/messaging/stomp_connection.rb +4 -4
  129. data/app/lib/katello/resources/candlepin/activation_key.rb +1 -1
  130. data/app/lib/katello/resources/candlepin/owner.rb +1 -1
  131. data/app/lib/katello/resources/candlepin/product.rb +1 -1
  132. data/app/lib/katello/resources/candlepin.rb +1 -1
  133. data/app/lib/katello/resources/cdn/katello_cdn.rb +3 -3
  134. data/app/lib/katello/resources/cdn.rb +1 -1
  135. data/app/lib/katello/resources/discovery/container.rb +5 -3
  136. data/app/lib/katello/resources/discovery/yum.rb +3 -1
  137. data/app/lib/katello/resources/registry.rb +0 -3
  138. data/app/lib/katello/util/candlepin_repository_checker.rb +2 -2
  139. data/app/lib/katello/util/cveak_migrator.rb +38 -0
  140. data/app/lib/katello/util/deb.rb +9 -0
  141. data/app/lib/katello/util/deduplication_migrator.rb +8 -8
  142. data/app/lib/katello/util/model.rb +2 -2
  143. data/app/lib/katello/util/search.rb +5 -5
  144. data/app/lib/katello/util/task_status.rb +19 -19
  145. data/app/lib/katello/util/url_matcher.rb +3 -3
  146. data/app/lib/katello/validators/content_view_environment_org_validator.rb +2 -1
  147. data/app/lib/katello/validators/katello_url_format_validator.rb +2 -2
  148. data/app/mailers/katello/errata_mailer.rb +1 -4
  149. data/app/models/katello/activation_key.rb +123 -27
  150. data/app/models/katello/alternate_content_source.rb +5 -5
  151. data/app/models/katello/authorization/activation_key.rb +1 -1
  152. data/app/models/katello/authorization/content_view_environment.rb +7 -0
  153. data/app/models/katello/cdn_configuration.rb +1 -1
  154. data/app/models/katello/concerns/content_facet_host_extensions.rb +24 -2
  155. data/app/models/katello/concerns/host_managed_extensions.rb +11 -6
  156. data/app/models/katello/concerns/organization_extensions.rb +4 -4
  157. data/app/models/katello/concerns/redhat_extensions.rb +1 -1
  158. data/app/models/katello/concerns/smart_proxy_extensions.rb +84 -39
  159. data/app/models/katello/content.rb +3 -3
  160. data/app/models/katello/content_view.rb +15 -18
  161. data/app/models/katello/content_view_environment.rb +56 -15
  162. data/app/models/katello/content_view_environment_activation_key.rb +20 -0
  163. data/app/models/katello/content_view_erratum_filter_rule.rb +1 -1
  164. data/app/models/katello/content_view_filter.rb +2 -2
  165. data/app/models/katello/content_view_history.rb +1 -1
  166. data/app/models/katello/content_view_repository.rb +1 -1
  167. data/app/models/katello/content_view_version.rb +3 -3
  168. data/app/models/katello/content_view_version_export_history.rb +2 -2
  169. data/app/models/katello/content_view_version_import_history.rb +1 -1
  170. data/app/models/katello/events/delete_latest_content_view_version.rb +1 -1
  171. data/app/models/katello/flatpak_remote.rb +11 -0
  172. data/app/models/katello/flatpak_remote_repository.rb +12 -0
  173. data/app/models/katello/flatpak_remote_repository_manifest.rb +10 -0
  174. data/app/models/katello/glue/candlepin/activation_key.rb +1 -1
  175. data/app/models/katello/glue/candlepin/candlepin_object.rb +1 -1
  176. data/app/models/katello/glue/candlepin/pool.rb +1 -1
  177. data/app/models/katello/glue/pulp/repos.rb +1 -1
  178. data/app/models/katello/host/content_facet.rb +33 -17
  179. data/app/models/katello/host/info_provider.rb +2 -4
  180. data/app/models/katello/host/subscription_facet.rb +2 -2
  181. data/app/models/katello/host_available_module_stream.rb +1 -1
  182. data/app/models/katello/installed_product.rb +2 -2
  183. data/app/models/katello/kt_environment.rb +11 -6
  184. data/app/models/katello/ping.rb +2 -3
  185. data/app/models/katello/repository.rb +40 -6
  186. data/app/models/katello/rhel_lifecycle_status.rb +10 -10
  187. data/app/models/katello/root_repository.rb +14 -18
  188. data/app/models/katello/task_status.rb +1 -1
  189. data/app/models/katello/upstream_pool.rb +2 -2
  190. data/app/presenters/katello/product_content_presenter.rb +2 -2
  191. data/app/presenters/katello/repository_presenter.rb +3 -3
  192. data/app/presenters/katello/sync_status_presenter.rb +3 -3
  193. data/app/services/cert/certs.rb +6 -2
  194. data/app/services/katello/candlepin_event_listener.rb +1 -1
  195. data/app/services/katello/event_monitor/poller_thread.rb +1 -1
  196. data/app/services/katello/event_queue.rb +1 -1
  197. data/app/services/katello/product_content_finder.rb +10 -10
  198. data/app/services/katello/product_content_importer.rb +1 -1
  199. data/app/services/katello/pulp3/alternate_content_source.rb +2 -2
  200. data/app/services/katello/pulp3/ansible_collection.rb +1 -1
  201. data/app/services/katello/pulp3/api/apt.rb +4 -0
  202. data/app/services/katello/pulp3/content.rb +1 -0
  203. data/app/services/katello/pulp3/content_view_version/export.rb +3 -10
  204. data/app/services/katello/pulp3/content_view_version/export_validator.rb +1 -1
  205. data/app/services/katello/pulp3/content_view_version/import.rb +2 -2
  206. data/app/services/katello/pulp3/content_view_version/import_gpg_keys.rb +1 -1
  207. data/app/services/katello/pulp3/content_view_version/importable_products.rb +2 -2
  208. data/app/services/katello/pulp3/content_view_version/importable_repositories.rb +4 -4
  209. data/app/services/katello/pulp3/content_view_version/metadata_generator.rb +2 -2
  210. data/app/services/katello/pulp3/deb.rb +35 -1
  211. data/app/services/katello/pulp3/docker_manifest.rb +1 -1
  212. data/app/services/katello/pulp3/docker_manifest_list.rb +6 -2
  213. data/app/services/katello/pulp3/docker_tag.rb +1 -1
  214. data/app/services/katello/pulp3/erratum.rb +2 -2
  215. data/app/services/katello/pulp3/file_unit.rb +1 -1
  216. data/app/services/katello/pulp3/generic_content_unit.rb +1 -1
  217. data/app/services/katello/pulp3/module_stream.rb +2 -2
  218. data/app/services/katello/pulp3/repository/ansible_collection.rb +1 -1
  219. data/app/services/katello/pulp3/repository/apt.rb +22 -16
  220. data/app/services/katello/pulp3/repository/docker.rb +2 -2
  221. data/app/services/katello/pulp3/repository/file.rb +1 -1
  222. data/app/services/katello/pulp3/repository/generic.rb +1 -1
  223. data/app/services/katello/pulp3/repository/yum.rb +7 -7
  224. data/app/services/katello/pulp3/repository.rb +15 -9
  225. data/app/services/katello/pulp3/repository_mirror.rb +3 -3
  226. data/app/services/katello/registration_manager.rb +23 -6
  227. data/app/services/katello/repository_type.rb +3 -3
  228. data/app/services/katello/smart_proxy_helper.rb +3 -3
  229. data/app/services/katello/ui_notifications/content_view/delete_latest_version_failure.rb +1 -1
  230. data/app/services/katello/ui_notifications/subscriptions/expire_soon.rb +3 -3
  231. data/app/services/katello/ui_notifications/subscriptions/manifest_expire_soon_warning.rb +3 -3
  232. data/app/services/katello/ui_notifications/task_notification.rb +2 -2
  233. data/app/services/katello/upstream_connection_checker.rb +1 -1
  234. data/app/views/katello/api/v2/activation_keys/base.json.rabl +43 -8
  235. data/app/views/katello/api/v2/alternate_content_sources/base.json.rabl +1 -1
  236. data/app/views/katello/api/v2/capsule_content/sync_status.json.rabl +5 -5
  237. data/app/views/katello/api/v2/common/_metadata.json.rabl +1 -1
  238. data/app/views/katello/api/v2/content_credentials/show.json.rabl +1 -1
  239. data/app/views/katello/api/v2/content_facet/base.json.rabl +15 -6
  240. data/app/views/katello/api/v2/content_facet/show.json.rabl +1 -1
  241. data/app/views/katello/api/v2/content_view_environments/index.json.rabl +7 -0
  242. data/app/views/katello/api/v2/content_view_environments/show.json.rabl +33 -0
  243. data/app/views/katello/api/v2/content_view_filter_rules/show.json.rabl +1 -1
  244. data/app/views/katello/api/v2/content_view_filters/show.json.rabl +1 -1
  245. data/app/views/katello/api/v2/content_view_versions/base.json.rabl +3 -3
  246. data/app/views/katello/api/v2/content_views/base.json.rabl +3 -3
  247. data/app/views/katello/api/v2/content_views/show.json.rabl +1 -1
  248. data/app/views/katello/api/v2/debs/backend.json.rabl +7 -0
  249. data/app/views/katello/api/v2/debs/base.json.rabl +4 -0
  250. data/app/views/katello/api/v2/debs/show.json.rabl +2 -0
  251. data/app/views/katello/api/v2/docker_manifest_lists/show.json.rabl +1 -0
  252. data/app/views/katello/api/v2/docker_tags/_base.json.rabl +2 -2
  253. data/app/views/katello/api/v2/environments/show.json.rabl +4 -4
  254. data/app/views/katello/api/v2/gpg_keys/show.json.rabl +1 -1
  255. data/app/views/katello/api/v2/host_collections/base.json.rabl +1 -1
  256. data/app/views/katello/api/v2/hosts/base.json.rabl +2 -2
  257. data/app/views/katello/api/v2/package_groups/base.json.rabl +2 -2
  258. data/app/views/katello/api/v2/products/show.json.rabl +2 -2
  259. data/app/views/katello/api/v2/repositories/show.json.rabl +1 -1
  260. data/app/views/katello/api/v2/repository_sets/show.json.rabl +1 -1
  261. data/app/views/katello/api/v2/subscriptions/base.json.rabl +1 -1
  262. data/app/views/katello/api/v2/subscriptions/show.json.rabl +3 -3
  263. data/app/views/katello/api/v2/sync_plans/show.json.rabl +1 -1
  264. data/config/initializers/inflections.rb +11 -0
  265. data/config/katello.yaml.example +4 -10
  266. data/config/routes/api/registry.rb +0 -2
  267. data/config/routes/api/rhsm.rb +1 -4
  268. data/config/routes/api/v2.rb +2 -3
  269. data/db/migrate/20140716211853_repo_rename_feed_to_url.rb +1 -1
  270. data/db/migrate/20141003210742_add_docker_container_registry_url_to_providers.rb +1 -1
  271. data/db/migrate/20150224083608_remove_docker_registry_url.rb +1 -1
  272. data/db/migrate/20160808002834_add_files.rb +1 -1
  273. data/db/migrate/20161014133811_move_content_view_version_description_to_histories.rb +1 -1
  274. data/db/migrate/20200818192230_update_system_purpose_status.rb +1 -1
  275. data/db/migrate/20201012172713_remove_gpg_key_perms.rb +1 -1
  276. data/db/migrate/20210322142311_add_auth_url_token_to_root_repositories.rb +1 -1
  277. data/db/migrate/20211220185935_clean_duplicate_content_units.rb +2 -2
  278. data/db/migrate/20230717150442_change_change_content_source_job_template_name.rb +1 -1
  279. data/db/migrate/20240207191223_remove_entitlement_mode_host_statuses.rb +1 -1
  280. data/db/migrate/20240508100434_add_content_id_to_katello_repository.rb +5 -0
  281. data/db/migrate/20240730163043_add_content_view_environment_activation_key.rb +87 -0
  282. data/db/migrate/20240806130902_add_more_deb_fields.rb +15 -0
  283. data/db/migrate/20240903194428_add_priority_to_content_view_environment_activation_key.rb +5 -0
  284. data/db/migrate/20241007200316_add_fields_to_katello_docker_manifest_list.rb +8 -0
  285. data/db/migrate/20241007212705_add_bootc_facts_to_content_facet.rb +27 -0
  286. data/db/migrate/20241025151105_remove_pulp3_migrated_hrefs_from_content_tables.rb +10 -0
  287. data/db/migrate/20241030181402_create_katello_flatpak_tables.rb +41 -0
  288. data/db/seeds.d/106-mail_notifications.rb +9 -9
  289. data/db/seeds.d/108-subcription-bookmarks.rb +1 -1
  290. data/db/seeds.d/109-katello-notification-blueprints.rb +21 -21
  291. data/db/seeds.d/110-content-view-autopublish.rb +5 -5
  292. data/db/seeds.d/111-container-image-bookmarks.rb +1 -1
  293. data/db/seeds.d/111-upgrade_tasks.rb +1 -1
  294. data/engines/bastion/lib/bastion/engine.rb +1 -1
  295. data/engines/bastion/lib/bastion.rb +1 -1
  296. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-repository-sets.controller.js +16 -0
  297. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-info.html +29 -15
  298. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-repository-sets.html +13 -0
  299. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/views/activation-keys.html +2 -0
  300. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-host-collections-modal.controller.js +2 -0
  301. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-host-collections-modal.html +4 -4
  302. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/debs/debs.routes.js +9 -0
  303. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/debs/details/views/deb-dependencies.html +54 -0
  304. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/debs/details/views/deb-info.html +13 -1
  305. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/debs/details/views/deb.html +8 -1
  306. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/views/apply-errata-confirm.html +1 -1
  307. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +4 -0
  308. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/views/new-repository.html +11 -0
  309. data/engines/bastion_katello/app/assets/stylesheets/bastion_katello/activation_keys.scss +1 -1
  310. data/engines/bastion_katello/lib/bastion_katello/engine.rb +1 -1
  311. data/lib/katello/engine.rb +17 -15
  312. data/lib/katello/permission_creator.rb +51 -49
  313. data/lib/katello/permissions/host_permissions.rb +4 -4
  314. data/lib/katello/permissions/organization_permissions.rb +4 -4
  315. data/lib/katello/permissions/registry_permissions.rb +1 -1
  316. data/lib/katello/permissions/roles_permissions.rb +1 -1
  317. data/lib/katello/permissions/user_permissions.rb +1 -1
  318. data/lib/katello/plugin.rb +14 -8
  319. data/lib/katello/repository_types/docker.rb +4 -2
  320. data/lib/katello/repository_types/ostree.rb +5 -3
  321. data/lib/katello/repository_types/python.rb +1 -1
  322. data/lib/katello/repository_types/yum.rb +2 -1
  323. data/lib/katello/scheduled_jobs.rb +1 -1
  324. data/lib/katello/tasks/migrate_structure_content_for_deb.rake +105 -0
  325. data/lib/katello/tasks/receptor/extract_orgs.rake +1 -1
  326. data/lib/katello/tasks/reimport.rake +1 -1
  327. data/lib/katello/tasks/repository.rake +19 -9
  328. data/lib/katello/tasks/upgrades/4.1/reupdate_content_import_export_perms.rake +1 -1
  329. data/lib/katello/tasks/upgrades/4.3/fix_url_auth.rake +1 -1
  330. data/lib/katello/version.rb +1 -1
  331. data/locale/action_names.rb +92 -1
  332. data/locale/bn/LC_MESSAGES/katello.mo +0 -0
  333. data/locale/bn/katello.po +259 -28
  334. data/locale/bn_IN/LC_MESSAGES/katello.mo +0 -0
  335. data/locale/bn_IN/katello.po +258 -27
  336. data/locale/ca/LC_MESSAGES/katello.mo +0 -0
  337. data/locale/ca/katello.po +258 -27
  338. data/locale/cs/LC_MESSAGES/katello.mo +0 -0
  339. data/locale/cs/katello.po +258 -30
  340. data/locale/cs_CZ/LC_MESSAGES/katello.mo +0 -0
  341. data/locale/cs_CZ/katello.po +258 -27
  342. data/locale/de/LC_MESSAGES/katello.mo +0 -0
  343. data/locale/de/katello.po +259 -28
  344. data/locale/de_AT/LC_MESSAGES/katello.mo +0 -0
  345. data/locale/de_AT/katello.po +258 -27
  346. data/locale/de_DE/LC_MESSAGES/katello.mo +0 -0
  347. data/locale/de_DE/katello.po +258 -27
  348. data/locale/el/LC_MESSAGES/katello.mo +0 -0
  349. data/locale/el/katello.po +258 -27
  350. data/locale/en/LC_MESSAGES/katello.mo +0 -0
  351. data/locale/en/katello.po +258 -27
  352. data/locale/en_GB/LC_MESSAGES/katello.mo +0 -0
  353. data/locale/en_GB/katello.po +258 -27
  354. data/locale/en_US/LC_MESSAGES/katello.mo +0 -0
  355. data/locale/en_US/katello.po +258 -27
  356. data/locale/es/LC_MESSAGES/katello.mo +0 -0
  357. data/locale/es/katello.po +259 -28
  358. data/locale/et_EE/LC_MESSAGES/katello.mo +0 -0
  359. data/locale/et_EE/katello.po +258 -27
  360. data/locale/fr/LC_MESSAGES/katello.mo +0 -0
  361. data/locale/fr/katello.po +259 -28
  362. data/locale/gl/LC_MESSAGES/katello.mo +0 -0
  363. data/locale/gl/katello.po +258 -27
  364. data/locale/gu/LC_MESSAGES/katello.mo +0 -0
  365. data/locale/gu/katello.po +258 -27
  366. data/locale/he_IL/LC_MESSAGES/katello.mo +0 -0
  367. data/locale/he_IL/katello.po +258 -27
  368. data/locale/hi/LC_MESSAGES/katello.mo +0 -0
  369. data/locale/hi/katello.po +258 -27
  370. data/locale/id/LC_MESSAGES/katello.mo +0 -0
  371. data/locale/id/katello.po +258 -27
  372. data/locale/it/LC_MESSAGES/katello.mo +0 -0
  373. data/locale/it/katello.po +259 -28
  374. data/locale/ja/LC_MESSAGES/katello.mo +0 -0
  375. data/locale/ja/katello.po +259 -28
  376. data/locale/ka/LC_MESSAGES/katello.mo +0 -0
  377. data/locale/ka/katello.po +259 -28
  378. data/locale/katello.pot +1041 -696
  379. data/locale/kn/LC_MESSAGES/katello.mo +0 -0
  380. data/locale/kn/katello.po +258 -27
  381. data/locale/ko/LC_MESSAGES/katello.mo +0 -0
  382. data/locale/ko/katello.po +259 -28
  383. data/locale/ml_IN/LC_MESSAGES/katello.mo +0 -0
  384. data/locale/ml_IN/katello.po +258 -27
  385. data/locale/mr/LC_MESSAGES/katello.mo +0 -0
  386. data/locale/mr/katello.po +258 -27
  387. data/locale/nl_NL/LC_MESSAGES/katello.mo +0 -0
  388. data/locale/nl_NL/katello.po +258 -27
  389. data/locale/or/LC_MESSAGES/katello.mo +0 -0
  390. data/locale/or/katello.po +258 -27
  391. data/locale/pa/LC_MESSAGES/katello.mo +0 -0
  392. data/locale/pa/katello.po +258 -27
  393. data/locale/pl/LC_MESSAGES/katello.mo +0 -0
  394. data/locale/pl/katello.po +258 -27
  395. data/locale/pl_PL/LC_MESSAGES/katello.mo +0 -0
  396. data/locale/pl_PL/katello.po +258 -27
  397. data/locale/pt/LC_MESSAGES/katello.mo +0 -0
  398. data/locale/pt/katello.po +258 -27
  399. data/locale/pt_BR/LC_MESSAGES/katello.mo +0 -0
  400. data/locale/pt_BR/katello.po +259 -28
  401. data/locale/ro/LC_MESSAGES/katello.mo +0 -0
  402. data/locale/ro/katello.po +258 -27
  403. data/locale/ro_RO/LC_MESSAGES/katello.mo +0 -0
  404. data/locale/ro_RO/katello.po +258 -27
  405. data/locale/ru/LC_MESSAGES/katello.mo +0 -0
  406. data/locale/ru/katello.po +259 -28
  407. data/locale/sl/LC_MESSAGES/katello.mo +0 -0
  408. data/locale/sl/katello.po +258 -27
  409. data/locale/sv_SE/LC_MESSAGES/katello.mo +0 -0
  410. data/locale/sv_SE/katello.po +258 -27
  411. data/locale/ta/LC_MESSAGES/katello.mo +0 -0
  412. data/locale/ta/katello.po +259 -28
  413. data/locale/ta_IN/LC_MESSAGES/katello.mo +0 -0
  414. data/locale/ta_IN/katello.po +258 -27
  415. data/locale/te/LC_MESSAGES/katello.mo +0 -0
  416. data/locale/te/katello.po +258 -27
  417. data/locale/tr/LC_MESSAGES/katello.mo +0 -0
  418. data/locale/tr/katello.po +258 -27
  419. data/locale/vi/LC_MESSAGES/katello.mo +0 -0
  420. data/locale/vi/katello.po +258 -27
  421. data/locale/vi_VN/LC_MESSAGES/katello.mo +0 -0
  422. data/locale/vi_VN/katello.po +258 -27
  423. data/locale/zh/LC_MESSAGES/katello.mo +0 -0
  424. data/locale/zh/katello.po +258 -27
  425. data/locale/zh_CN/LC_MESSAGES/katello.mo +0 -0
  426. data/locale/zh_CN/katello.po +259 -28
  427. data/locale/zh_TW/LC_MESSAGES/katello.mo +0 -0
  428. data/locale/zh_TW/katello.po +259 -28
  429. data/vendor/assets/javascripts/katello/chosen.jquery.js +2 -2
  430. data/vendor/assets/javascripts/katello/jquery.ba-bbq.js +1 -1
  431. data/vendor/assets/javascripts/katello/jquery.hoverIntent.js +2 -2
  432. data/webpack/ForemanColumnExtensions/index.js +1 -1
  433. data/webpack/components/extensions/HostDetails/Cards/ContentViewDetailsCard/ContentViewDetailsCard.js +113 -86
  434. data/webpack/components/extensions/HostDetails/DetailsTabCards/HwPropertiesCard.js +7 -2
  435. data/webpack/components/extensions/HostDetails/Tabs/DebsTab/DebsTab.js +31 -4
  436. data/webpack/components/extensions/HostDetails/Tabs/RepositorySetsTab/RepositorySetsTab.js +1 -1
  437. data/webpack/components/extensions/RegistrationCommands/fields/ActivationKeys.js +1 -7
  438. data/webpack/components/extensions/RegistrationCommands/helpers.js +15 -0
  439. data/webpack/components/extensions/RegistrationCommands/index.js +3 -9
  440. data/webpack/global_index.js +11 -4
  441. data/webpack/redux/actions/RedHatRepositories/helpers.js +2 -0
  442. data/webpack/scenes/ActivationKeys/Details/ActivationKeyDetails.js +4 -0
  443. data/webpack/scenes/ActivationKeys/Details/components/CVEDetailsCard.js +37 -0
  444. data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionDetailConfig.js +1 -2
  445. data/webpack/scenes/Hosts/ChangeContentSource/helpers.js +2 -8
  446. data/webpack/scenes/SmartProxy/ExpandableCvDetails.js +22 -2
  447. data/webpack/scenes/SmartProxy/ExpandedSmartProxyRepositories.js +39 -20
  448. data/webpack/scenes/SmartProxy/SmartProxyContentActions.js +2 -1
  449. data/webpack/scenes/SmartProxy/SmartProxyExpandableTable.js +6 -4
  450. data/webpack/scenes/SmartProxy/__tests__/SmartProxyContentTest.js +62 -0
  451. metadata +134 -76
  452. data/app/lib/katello/api/constraints/activation_key_constraint.rb +0 -7
  453. /data/app/lib/katello/{api → routing}/mapper_extensions.rb +0 -0
@@ -0,0 +1,11 @@
1
+ module Katello
2
+ module Api
3
+ module Constraints
4
+ class RegisterWithActivationKeyConstraint
5
+ def matches?(request)
6
+ request.params[:activation_keys]
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
@@ -308,7 +308,7 @@ module Katello
308
308
  :erratum_id => erratum_id,
309
309
  :erratum_type => current_erratum_errata_type,
310
310
  :issued => current_erratum_issued,
311
- :status => task.result
311
+ :status => task.result,
312
312
  }
313
313
 
314
314
  if include_last_reboot == 'yes'
@@ -18,8 +18,8 @@ module Katello
18
18
 
19
19
  include Katello::Concerns::FilterSensitiveData
20
20
 
21
- class_attribute :consumer_secret, :consumer_key, :ca_cert_file, :prefix, :site, :default_headers,
22
- :ssl_client_cert, :ssl_client_key
21
+ class_attribute :consumer_secret, :consumer_key, :prefix, :site, :default_headers,
22
+ :ssl_client_cert, :ssl_client_key, :ssl_ca_file
23
23
 
24
24
  attr_reader :json
25
25
 
@@ -40,7 +40,7 @@ module Katello
40
40
  post: Net::HTTP::Post,
41
41
  put: Net::HTTP::Put,
42
42
  patch: Net::HTTP::Patch,
43
- delete: Net::HTTP::Delete
43
+ delete: Net::HTTP::Delete,
44
44
  }.freeze
45
45
 
46
46
  class << self
@@ -128,7 +128,7 @@ module Katello
128
128
  :authorize_path => "",
129
129
  :access_token_path => ""}
130
130
 
131
- params[:ca_file] = self.ca_cert_file unless self.ca_cert_file.nil?
131
+ params[:ca_file] = self.ssl_ca_file unless self.ssl_ca_file.nil?
132
132
  # New OAuth consumer to setup signing the request
133
133
  consumer = OAuth::Consumer.new(self.consumer_key,
134
134
  self.consumer_secret,
@@ -145,9 +145,9 @@ module Katello
145
145
  options = {
146
146
  :headers => added_header,
147
147
  :open_timeout => SETTINGS[:katello][:rest_client_timeout],
148
- :timeout => SETTINGS[:katello][:rest_client_timeout]
148
+ :timeout => SETTINGS[:katello][:rest_client_timeout],
149
149
  }
150
- options[:ssl_ca_file] = self.ca_cert_file unless self.ca_cert_file.nil?
150
+ options[:ssl_ca_file] = self.ssl_ca_file unless self.ssl_ca_file.nil?
151
151
  options[:ssl_client_cert] = self.ssl_client_cert unless self.ssl_client_cert.nil?
152
152
  options[:ssl_client_key] = self.ssl_client_key unless self.ssl_client_key.nil?
153
153
 
@@ -16,8 +16,8 @@ module Katello
16
16
  {
17
17
  host: settings[:broker_host],
18
18
  port: settings[:broker_port],
19
- ssl: ssl_params
20
- }
19
+ ssl: ssl_params,
20
+ },
21
21
  ],
22
22
  logger: Rails.logger,
23
23
  max_reconnect_attempts: 2,
@@ -27,8 +27,8 @@ module Katello
27
27
  'accept-version': '1.2',
28
28
  'host': settings[:broker_host],
29
29
  'heart-beat': '30000,30000',
30
- 'client-id': settings[:client_id]
31
- }
30
+ 'client-id': settings[:client_id],
31
+ },
32
32
  }
33
33
 
34
34
  @queue_name = settings[:queue_name]
@@ -20,7 +20,7 @@ module Katello
20
20
  releaseVer: release_version,
21
21
  role: purpose_role,
22
22
  usage: purpose_usage,
23
- addOns: purpose_addons
23
+ addOns: purpose_addons,
24
24
  }
25
25
  response = self.post(url, params.to_json, self.default_headers)
26
26
  JSON.parse(response.body).with_indifferent_access
@@ -18,7 +18,7 @@ module Katello
18
18
  :displayName => description,
19
19
  :contentPrefix => "/#{key}/$env",
20
20
  :contentAccessMode => content_access_mode,
21
- :contentAccessModeList => 'org_environment'
21
+ :contentAccessModeList => 'org_environment',
22
22
  }
23
23
  owner_json = self.post(path, attrs.to_json, self.default_headers).body
24
24
  JSON.parse(owner_json).with_indifferent_access
@@ -86,7 +86,7 @@ module Katello
86
86
  'accountNumber' => '',
87
87
  'productId' => product_id,
88
88
  'providedProducts' => [],
89
- 'contractNumber' => ''
89
+ 'contractNumber' => '',
90
90
  }
91
91
  JSON.parse(Candlepin::Pool.create(owner_key, pool))
92
92
  end
@@ -11,7 +11,7 @@ module Katello
11
11
  self.site = "#{uri.scheme}://#{uri.host}:#{uri.port}"
12
12
  self.consumer_secret = cfg[:oauth_secret]
13
13
  self.consumer_key = cfg[:oauth_key]
14
- self.ca_cert_file = cfg[:ca_cert_file]
14
+ self.ssl_ca_file = ::Cert::Certs.backend_ca_cert_file(:candlepin)
15
15
 
16
16
  class << self
17
17
  def process_response(response)
@@ -27,7 +27,7 @@ module Katello
27
27
  organization_id: organization['id'],
28
28
  content_view_id: content_view_id,
29
29
  environment_id: lifecycle_environment_id,
30
- search: CGI.escape("content_label = #{repo_set['label']}")
30
+ search: CGI.escape("content_label = #{repo_set['label']}"),
31
31
  }
32
32
  query_params = params.map { |key, value| "#{key}=#{value}" }
33
33
 
@@ -78,7 +78,7 @@ module Katello
78
78
 
79
79
  def repository_url(content_label:, arch:, major:, minor:)
80
80
  params = {
81
- search: CGI.escape("content_label = #{content_label}")
81
+ search: CGI.escape("content_label = #{content_label}"),
82
82
  }
83
83
 
84
84
  params[:content_view_id] = content_view_id if @content_view_label
@@ -95,7 +95,7 @@ module Katello
95
95
  minor: minor,
96
96
  org_label: @organization_label,
97
97
  cv_label: @content_view_label || Katello::OrganizationCreator::DEFAULT_CONTENT_VIEW_LABEL,
98
- env_label: @lifecycle_environment_label || Katello::OrganizationCreator::DEFAULT_LIFECYCLE_ENV_LABEL
98
+ env_label: @lifecycle_environment_label || Katello::OrganizationCreator::DEFAULT_LIFECYCLE_ENV_LABEL,
99
99
  }
100
100
 
101
101
  fail _("Repository with content label: '%{content_label}'#{arch ? ', arch: \'%{arch}\'' : ''}#{minor ? ', version: \'%{minor}\'' : ''} was not found in upstream organization '%{org_label}',"\
@@ -51,7 +51,7 @@ module Katello
51
51
  @options = options
52
52
  end
53
53
 
54
- def self.create(product: nil, cdn_configuration:)
54
+ def self.create(cdn_configuration:, product: nil)
55
55
  options = {}
56
56
  if cdn_configuration.redhat_cdn?
57
57
  options[:ssl_client_cert] = OpenSSL::X509::Certificate.new(product.certificate)
@@ -3,11 +3,13 @@ module Katello
3
3
  module Discovery
4
4
  class Container < RepoDiscovery
5
5
  attr_reader :found, :crawled, :to_follow
6
+
7
+ # rubocop:disable Metrics/ParameterLists
6
8
  def initialize(url, crawled = [], found = [], to_follow = [],
7
9
  upstream_credentials_and_search = {
8
10
  upstream_username: nil,
9
11
  upstream_password: nil,
10
- search: '*'
12
+ search: '*',
11
13
  })
12
14
  @uri = uri(url)
13
15
  @upstream_username = upstream_credentials_and_search[:upstream_username].presence
@@ -94,7 +96,7 @@ module Katello
94
96
  request_params = {
95
97
  method: :get,
96
98
  headers: { accept: :json },
97
- url: "#{@uri}v1/search?q=#{@search}"
99
+ url: "#{@uri}v1/search?q=#{@search}",
98
100
  }
99
101
 
100
102
  request_params[:user] = @upstream_username if @upstream_username
@@ -107,7 +109,7 @@ module Katello
107
109
  @found << result['name']
108
110
  end
109
111
  rescue
110
- # Note: v2 endpoint does not support search
112
+ # NOTE: v2 endpoint does not support search
111
113
  request_params[:url] = "#{@uri}v2/_catalog"
112
114
  loop do
113
115
  results = RestClient::Request.execute(request_params)
@@ -5,10 +5,12 @@ module Katello
5
5
  module Discovery
6
6
  class Yum < RepoDiscovery
7
7
  attr_reader :found, :crawled, :to_follow
8
+
9
+ # rubocop:disable Metrics/ParameterLists
8
10
  def initialize(url, crawled = [], found = [], to_follow = [],
9
11
  upstream_credentials_and_search = {
10
12
  upstream_username: nil,
11
- upstream_password: nil
13
+ upstream_password: nil,
12
14
  })
13
15
  @uri = uri(url)
14
16
  @upstream_username = upstream_credentials_and_search[:upstream_username].presence
@@ -1,5 +1,3 @@
1
- require 'katello/util/data'
2
-
3
1
  module Katello
4
2
  module Resources
5
3
  require 'rest_client'
@@ -56,7 +54,6 @@ module Katello
56
54
  uri = URI.parse(content_app_url)
57
55
  self.prefix = "/pulpcore_registry/"
58
56
  self.site = "#{uri.scheme}://#{uri.host}:#{uri.port}"
59
- self.ca_cert_file = Setting[:ssl_ca_file]
60
57
  pulp_primary.pulp3_ssl_configuration(self, :net_http)
61
58
 
62
59
  self
@@ -33,9 +33,9 @@ module Katello
33
33
  end
34
34
 
35
35
  def self.repository_exist_in_backend?(repository)
36
- return false if repository.root.content_id.blank?
36
+ return false if repository.content_id.blank?
37
37
 
38
- ::Katello::Resources::Candlepin::Content.get(repository.organization.label, repository.root.content_id)
38
+ ::Katello::Resources::Candlepin::Content.get(repository.organization.label, repository.content_id)
39
39
  true
40
40
  rescue RestClient::NotFound
41
41
  false
@@ -0,0 +1,38 @@
1
+ module Katello
2
+ module Util
3
+ class FakeActivationKey < ApplicationRecord
4
+ self.table_name = 'katello_activation_keys'
5
+ end
6
+
7
+ class CVEAKMigrator # used in db/migrate/20240730163043_add_content_view_environment_activation_key.rb
8
+ def execute!
9
+ aks_with_no_cve = []
10
+ aks_with_missing_cve = []
11
+
12
+ FakeActivationKey.all.each do |ak|
13
+ next if ak.content_view_id.blank? && ak.environment_id.blank?
14
+ if ::Katello::ContentView.exists?(id: ak.content_view_id) && ::Katello::KTEnvironment.exists?(ak.environment_id)
15
+ cve = ::Katello::ContentViewEnvironment.find_by(content_view_id: ak.content_view_id, environment_id: ak.environment_id)
16
+ if cve.blank?
17
+ aks_with_no_cve << ak
18
+ end
19
+ else
20
+ aks_with_missing_cve << ak
21
+ end
22
+ end
23
+
24
+ if aks_with_missing_cve.present? || aks_with_no_cve.present?
25
+ Rails.logger.warn "Found #{aks_with_no_cve.count} activation keys whose combination of content view and lifecycle environment does not have a corresponding ContentViewEnvironment"
26
+ Rails.logger.warn "Found #{aks_with_missing_cve.count} activation keys which are missing either content_view_id or lifecycle_environment_id"
27
+ Rails.logger.info "You may want to change the content view / lifecycle environment for these activation keys manually."
28
+ end
29
+ (aks_with_no_cve + aks_with_missing_cve).each do |ak|
30
+ default_content_view = ak.organization.default_content_view
31
+ library = ak.organization.library
32
+ Rails.logger.info "Updating activation key #{ak.name} with default content_view_id and lifecycle_environment_id"
33
+ ak&.update_columns(content_view_id: default_content_view&.id, environment_id: library&.id)
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,9 @@
1
+ module Katello
2
+ module Util
3
+ module Deb
4
+ def self.parse_dependencies(deps)
5
+ deps&.split(',')&.collect { |d| d.strip }
6
+ end
7
+ end
8
+ end
9
+ end
@@ -7,25 +7,25 @@ module Katello
7
7
  [
8
8
  {
9
9
  :model => ::Katello::CapsuleLifecycleEnvironment,
10
- :fields => [:lifecycle_environment_id, :capsule_id]
10
+ :fields => [:lifecycle_environment_id, :capsule_id],
11
11
  },
12
12
  {
13
13
  :model => ::Katello::ContentViewErratumFilterRule,
14
- :fields => [:errata_id, :content_view_filter_id]
14
+ :fields => [:errata_id, :content_view_filter_id],
15
15
  },
16
16
  {
17
17
  :model => ::Katello::ContentViewModuleStreamFilterRule,
18
- :fields => [:module_stream_id, :content_view_filter_id]
18
+ :fields => [:module_stream_id, :content_view_filter_id],
19
19
  },
20
20
  {
21
21
  :model => ::Katello::ContentViewPackageGroupFilterRule,
22
- :fields => [:uuid, :content_view_filter_id]
22
+ :fields => [:uuid, :content_view_filter_id],
23
23
  },
24
24
  {
25
25
  :model =>
26
26
  ::Katello::ContentViewRepository,
27
- :fields => [:content_view_id, :repository_id]
28
- }
27
+ :fields => [:content_view_id, :repository_id],
28
+ },
29
29
  ]
30
30
  end
31
31
 
@@ -33,8 +33,8 @@ module Katello
33
33
  [
34
34
  {
35
35
  :model => ::Katello::ContentView,
36
- :fields => [:name, :organization_id]
37
- }
36
+ :fields => [:name, :organization_id],
37
+ },
38
38
  ]
39
39
  end
40
40
 
@@ -4,7 +4,7 @@ module Katello
4
4
  # hardcoded model names (uses kp_ prefix)
5
5
  def self.table_to_model_hash
6
6
  {
7
- "kt_environment" => "KTEnvironment"
7
+ "kt_environment" => "KTEnvironment",
8
8
  }
9
9
  end
10
10
 
@@ -29,7 +29,7 @@ module Katello
29
29
 
30
30
  def self.controller_path_to_model_hash
31
31
  {
32
- "katello/environments" => "Katello::KTEnvironment"
32
+ "katello/environments" => "Katello::KTEnvironment",
33
33
  }
34
34
  end
35
35
 
@@ -7,13 +7,13 @@ module Katello
7
7
  {
8
8
  "kt_name_analyzer" => {
9
9
  "type" => "custom",
10
- "tokenizer" => "keyword"
10
+ "tokenizer" => "keyword",
11
11
  },
12
12
  "autcomplete_name_analyzer" => {
13
13
  "type" => "custom",
14
14
  "tokenizer" => "keyword",
15
- "filter" => %w(standard lowercase ngram_filter)
16
- }
15
+ "filter" => %w(standard lowercase ngram_filter),
16
+ },
17
17
  }
18
18
  end
19
19
 
@@ -23,8 +23,8 @@ module Katello
23
23
  "type" => "edgeNGram",
24
24
  "side" => "front",
25
25
  "min_gram" => 1,
26
- "max_gram" => 30
27
- }
26
+ "max_gram" => 30,
27
+ },
28
28
  }
29
29
  end
30
30
 
@@ -17,9 +17,9 @@ module Katello
17
17
  :finished => [N_('Package Install Complete'), N_('Package installation: "%{package}" '), N_('%{package} (%{total} other packages) installed')],
18
18
  :error => [N_('Package Install Failed'), N_('Package install failed: "%{package}"'), N_('%{package} (%{total} other packages) install failed')],
19
19
  :cancelled => [N_('Package Install Canceled'), N_('%{package} package install canceled'), N_('%{package} (%{total} other packages) install canceled')],
20
- :timed_out => [N_('Package Install Timed Out'), N_('%{package} package install timed out'), N_('%{package} (%{total} other packages) install timed out')]
20
+ :timed_out => [N_('Package Install Timed Out'), N_('%{package} package install timed out'), N_('%{package} (%{total} other packages) install timed out')],
21
21
  },
22
- :user_message => _('Package Install scheduled by %s')
22
+ :user_message => _('Package Install scheduled by %s'),
23
23
 
24
24
  },
25
25
  :package_update => {
@@ -31,9 +31,9 @@ module Katello
31
31
  :finished => [N_('Package Update Complete'), N_('%{package} package updated'), N_('%{package} (%{total} other packages) updated')],
32
32
  :error => [N_('Package Update Failed'), N_('%{package} package update failed'), N_('%{package} (%{total} other packages) update failed')],
33
33
  :cancelled => [N_('Package Update Canceled'), N_('%{package} package update canceled'), N_('%{package} (%{total} other packages) update canceled')],
34
- :timed_out => [N_('Package Update Timed Out'), N_('%{package} package update timed out'), N_('%{package} (%{total} other packages) update timed out')]
34
+ :timed_out => [N_('Package Update Timed Out'), N_('%{package} package update timed out'), N_('%{package} (%{total} other packages) update timed out')],
35
35
  },
36
- :user_message => _('Package Update scheduled by %s')
36
+ :user_message => _('Package Update scheduled by %s'),
37
37
  },
38
38
  :package_remove => {
39
39
  :english_name => N_("Package Remove"),
@@ -44,9 +44,9 @@ module Katello
44
44
  :finished => [N_('Package Remove Complete'), N_('%{package} package removed'), N_('%{package} (%{total} other packages) removed')],
45
45
  :error => [N_('Package Remove Failed'), N_('%{package} package remove failed'), N_('%{package} (%{total} other packages) remove failed')],
46
46
  :cancelled => [N_('Package Remove Canceled'), N_('%{package} package remove canceled'), N_('%{package} (%{total} other packages) remove canceled')],
47
- :timed_out => [N_('Package Remove Timed Out'), N_('%{package} package remove timed out'), N_('%{package} (%{total} other packages) remove timed out')]
47
+ :timed_out => [N_('Package Remove Timed Out'), N_('%{package} package remove timed out'), N_('%{package} (%{total} other packages) remove timed out')],
48
48
  },
49
- :user_message => _('Package Remove scheduled by %s')
49
+ :user_message => _('Package Remove scheduled by %s'),
50
50
  },
51
51
  #package group tasks
52
52
  :package_group_install => {
@@ -58,9 +58,9 @@ module Katello
58
58
  :finished => [N_('Package Group Install Complete'), N_('%{group} package group installed'), N_('%{group} (%{total} other package groups) installed')],
59
59
  :error => [N_('Package Group Install Failed'), N_('%{group} package group install failed'), N_('%{group} (%{total} other package groups) install failed')],
60
60
  :cancelled => [N_('Package Group Install Canceled'), N_('%{group} package group install canceled'), N_('%{group} (%{total} other package groups) install canceled')],
61
- :timed_out => [N_('Package Group Install Timed Out'), N_('%{group} package group install timed out'), N_('%{group} (%{total} other package groups) install timed out')]
61
+ :timed_out => [N_('Package Group Install Timed Out'), N_('%{group} package group install timed out'), N_('%{group} (%{total} other package groups) install timed out')],
62
62
  },
63
- :user_message => _('Package Group Install scheduled by %s')
63
+ :user_message => _('Package Group Install scheduled by %s'),
64
64
  },
65
65
  :package_group_update => {
66
66
  :english_name => N_("Package Group Update"),
@@ -71,10 +71,10 @@ module Katello
71
71
  :finished => [N_('Package group update complete'), N_('%{group} package group updated'), N_('%{group} (%{total} other package groups) updated')],
72
72
  :error => [N_('Package group update failed'), N_('%{group} package group update failed'), N_('%{group} (%{total} other package groups) update failed')],
73
73
  :cancelled => [N_('Package group update canceled'), N_('%{group} package group update canceled'), N_('%{group} (%{total} other package groups) update canceled')],
74
- :timed_out => [N_('Package group update timed out'), N_('%{group} package group update timed out'), N_('%{group} (%{total} other package groups) update timed out')]
74
+ :timed_out => [N_('Package group update timed out'), N_('%{group} package group update timed out'), N_('%{group} (%{total} other package groups) update timed out')],
75
75
 
76
76
  },
77
- :user_message => _('Package Group Update scheduled by %s')
77
+ :user_message => _('Package Group Update scheduled by %s'),
78
78
  },
79
79
  :package_group_remove => {
80
80
  :english_name => N_("Package Group Remove"),
@@ -85,10 +85,10 @@ module Katello
85
85
  :finished => [N_('Package Group Remove Complete'), N_('%{group} package group removed'), N_('%{group} (%{total} other package groups) removed')],
86
86
  :error => [N_('Package Group Remove Failed'), N_('%{group} package group remove failed'), N_('%{group} (%{total} other package groups) remove failed')],
87
87
  :cancelled => [N_('Package Group Remove Canceled'), N_('%{group} package group remove canceled'), N_('%{group} (%{total} other package groups) remove canceled')],
88
- :timed_out => [N_('Package Group Remove Timed Out'), N_('%{group} package group remove timed out'), N_('%{group} (%{total} other package groups) remove timed out')]
88
+ :timed_out => [N_('Package Group Remove Timed Out'), N_('%{group} package group remove timed out'), N_('%{group} (%{total} other package groups) remove timed out')],
89
89
 
90
90
  },
91
- :user_message => _('Package Group Remove scheduled by %s')
91
+ :user_message => _('Package Group Remove scheduled by %s'),
92
92
  },
93
93
  :errata_install => {
94
94
  :english_name => N_("Errata Install"),
@@ -99,29 +99,29 @@ module Katello
99
99
  :finished => [N_('Erratum Install Complete'), N_('%{errata} erratum installed'), N_('%{errata} (%{total} other errata) installed')],
100
100
  :error => [N_('Erratum Install Failed'), N_('%{errata} erratum install failed'), N_('%{errata} (%{total} other errata) install failed')],
101
101
  :cancelled => [N_('Erratum Install Canceled'), N_('%{errata} erratum install canceled'), N_('%{errata} (%{total} other errata) install canceled')],
102
- :timed_out => [N_('Erratum Install Timed Out'), N_('%{errata} erratum install timed out'), N_('%{errata} (%{total} other errata) install timed out')]
102
+ :timed_out => [N_('Erratum Install Timed Out'), N_('%{errata} erratum install timed out'), N_('%{errata} (%{total} other errata) install timed out')],
103
103
  },
104
- :user_message => _('Errata Install scheduled by %s')
104
+ :user_message => _('Errata Install scheduled by %s'),
105
105
  },
106
106
  :candlepin_event => {
107
107
  :english_name => N_("Candlepin Event"),
108
108
  :type => :candlepin_event,
109
109
  :event_messages => {
110
110
  },
111
- :user_message => nil
111
+ :user_message => nil,
112
112
  },
113
113
  :content_view_publish => {
114
114
  :english_name => N_("content view publish"),
115
- :type => :content_view_publish
115
+ :type => :content_view_publish,
116
116
  },
117
117
  :content_view_node_publish => {
118
118
  :english_name => N_("content view node publish"),
119
- :type => :content_view_node_publish
119
+ :type => :content_view_node_publish,
120
120
  },
121
121
  :content_view_refresh => {
122
122
  :english_name => N_("content view refresh"),
123
- :type => :content_view_refresh
124
- }
123
+ :type => :content_view_refresh,
124
+ },
125
125
  }.with_indifferent_access
126
126
 
127
127
  TYPES.each_pair do |_name, value|
@@ -13,15 +13,15 @@
13
13
  #
14
14
  # ===== Examples
15
15
  #
16
- # UrlMatcher.match('/foo', ['/', '/foo', '/bar/baz']) #=> ['/foo']
17
- # UrlMatcher.match('/80/07/01', ['/:year/:month/:day']) #=> ['/80/07/01', '80', '07', '01']
16
+ # URLMatcher.match('/foo', ['/', '/foo', '/bar/baz']) #=> ['/foo']
17
+ # URLMatcher.match('/80/07/01', ['/:year/:month/:day']) #=> ['/80/07/01', '80', '07', '01']
18
18
  #
19
19
 
20
20
  require 'pathname'
21
21
 
22
22
  module Katello
23
23
  module Util
24
- module UrlMatcher
24
+ module URLMatcher
25
25
  def self.match(path, routes)
26
26
  path = Path.new(path)
27
27
  patterns = routes.map { |route| Pattern.new(Array(route).first) }
@@ -5,9 +5,10 @@ module Katello
5
5
  environment_id = record.respond_to?(:lifecycle_environment_id) ? record.lifecycle_environment_id : record.environment_id
6
6
  view = ContentView.where(:id => record.content_view_id).first
7
7
  environment = KTEnvironment.where(:id => environment_id).first
8
- unless view && environment
8
+ if view.blank? || environment.blank?
9
9
  record.errors[:base] << _("Content view environments must have both a content view and an environment")
10
10
  end
11
+
11
12
  unless view&.organization == environment&.organization
12
13
  record.errors[:base] << _("%{view_label} could not be promoted to %{environment_label} because the content view and the environment are not in the same organization!") % {:view_label => view&.label, :environment_label => environment&.label}
13
14
  end
@@ -1,7 +1,7 @@
1
1
  module Katello
2
2
  module Validators
3
- class KatelloUrlFormatValidator < ActiveModel::EachValidator
4
- include KatelloUrlHelper
3
+ class KatelloURLFormatValidator < ActiveModel::EachValidator
4
+ include KatelloURLHelper
5
5
 
6
6
  def validate_each(record, attribute, value)
7
7
  if options[:nil_allowed]
@@ -33,10 +33,7 @@ module Katello
33
33
  ::User.as(user.login) do
34
34
  @content_view = options[:content_view]
35
35
  @environment = options[:environment]
36
- @content_facets = Katello::Host::ContentFacet.in_content_views_and_environments(
37
- :lifecycle_environments => [@environment],
38
- :content_views => [@content_view]
39
- )
36
+ @content_facets = Katello::Host::ContentFacet.with_content_views(@content_view).with_environments(@environment)
40
37
  @hosts = ::Host::Managed.authorized("view_hosts").where(:id => @content_facets.pluck(:host_id))
41
38
  @errata = @content_facets.map(&:installable_errata).flatten.uniq
42
39