katello 4.9.2 → 4.10.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 (276) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -7
  3. data/app/assets/javascripts/katello/locale/bn/katello.js +8967 -1
  4. data/app/assets/javascripts/katello/locale/bn_IN/katello.js +8967 -0
  5. data/app/assets/javascripts/katello/locale/ca/katello.js +8967 -0
  6. data/app/assets/javascripts/katello/locale/cs/katello.js +8967 -1
  7. data/app/assets/javascripts/katello/locale/cs_CZ/katello.js +8969 -0
  8. data/app/assets/javascripts/katello/locale/de/katello.js +8991 -1
  9. data/app/assets/javascripts/katello/locale/de_AT/katello.js +8966 -0
  10. data/app/assets/javascripts/katello/locale/de_DE/katello.js +8967 -0
  11. data/app/assets/javascripts/katello/locale/el/katello.js +8967 -0
  12. data/app/assets/javascripts/katello/locale/en/katello.js +8967 -1
  13. data/app/assets/javascripts/katello/locale/en_GB/katello.js +8967 -0
  14. data/app/assets/javascripts/katello/locale/en_US/katello.js +8966 -0
  15. data/app/assets/javascripts/katello/locale/es/katello.js +8984 -1
  16. data/app/assets/javascripts/katello/locale/et_EE/katello.js +8966 -0
  17. data/app/assets/javascripts/katello/locale/fr/katello.js +9008 -1
  18. data/app/assets/javascripts/katello/locale/gl/katello.js +8967 -0
  19. data/app/assets/javascripts/katello/locale/gu/katello.js +8967 -1
  20. data/app/assets/javascripts/katello/locale/he_IL/katello.js +8967 -0
  21. data/app/assets/javascripts/katello/locale/hi/katello.js +8967 -1
  22. data/app/assets/javascripts/katello/locale/id/katello.js +8966 -0
  23. data/app/assets/javascripts/katello/locale/it/katello.js +8974 -1
  24. data/app/assets/javascripts/katello/locale/ja/katello.js +9004 -1
  25. data/app/assets/javascripts/katello/locale/ka/katello.js +8976 -1
  26. data/app/assets/javascripts/katello/locale/kn/katello.js +8967 -1
  27. data/app/assets/javascripts/katello/locale/ko/katello.js +8972 -1
  28. data/app/assets/javascripts/katello/locale/locale/katello.js +3070 -1
  29. data/app/assets/javascripts/katello/locale/ml_IN/katello.js +8966 -0
  30. data/app/assets/javascripts/katello/locale/mr/katello.js +8967 -1
  31. data/app/assets/javascripts/katello/locale/nl_NL/katello.js +8967 -0
  32. data/app/assets/javascripts/katello/locale/or/katello.js +8967 -1
  33. data/app/assets/javascripts/katello/locale/pa/katello.js +8967 -1
  34. data/app/assets/javascripts/katello/locale/pl/katello.js +8967 -0
  35. data/app/assets/javascripts/katello/locale/pl_PL/katello.js +8966 -0
  36. data/app/assets/javascripts/katello/locale/pt/katello.js +8967 -1
  37. data/app/assets/javascripts/katello/locale/pt_BR/katello.js +8984 -1
  38. data/app/assets/javascripts/katello/locale/ro/katello.js +8966 -0
  39. data/app/assets/javascripts/katello/locale/ro_RO/katello.js +8966 -0
  40. data/app/assets/javascripts/katello/locale/ru/katello.js +8973 -1
  41. data/app/assets/javascripts/katello/locale/sl/katello.js +8967 -0
  42. data/app/assets/javascripts/katello/locale/sv_SE/katello.js +8967 -0
  43. data/app/assets/javascripts/katello/locale/ta/katello.js +8967 -1
  44. data/app/assets/javascripts/katello/locale/ta_IN/katello.js +8967 -0
  45. data/app/assets/javascripts/katello/locale/te/katello.js +8967 -1
  46. data/app/assets/javascripts/katello/locale/tr/katello.js +8967 -0
  47. data/app/assets/javascripts/katello/locale/vi/katello.js +8966 -0
  48. data/app/assets/javascripts/katello/locale/vi_VN/katello.js +8966 -0
  49. data/app/assets/javascripts/katello/locale/zh/katello.js +8966 -0
  50. data/app/assets/javascripts/katello/locale/zh_CN/katello.js +9004 -1
  51. data/app/assets/javascripts/katello/locale/zh_TW/katello.js +8972 -1
  52. data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +1 -1
  53. data/app/controllers/katello/api/v2/alternate_content_sources_bulk_actions_controller.rb +22 -1
  54. data/app/controllers/katello/api/v2/api_controller.rb +0 -15
  55. data/app/controllers/katello/api/v2/content_view_versions_controller.rb +13 -4
  56. data/app/controllers/katello/api/v2/host_errata_controller.rb +0 -12
  57. data/app/controllers/katello/api/v2/host_packages_controller.rb +0 -55
  58. data/app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb +0 -77
  59. data/app/controllers/katello/api/v2/organizations_controller.rb +2 -1
  60. data/app/controllers/katello/api/v2/repositories_controller.rb +6 -10
  61. data/app/controllers/katello/api/v2/sync_controller.rb +0 -1
  62. data/app/controllers/katello/concerns/api/api_controller.rb +0 -10
  63. data/app/controllers/katello/concerns/hosts_controller_extensions.rb +1 -1
  64. data/app/lib/actions/katello/alternate_content_source/update.rb +1 -1
  65. data/app/lib/actions/katello/content_view/capsule_sync.rb +1 -1
  66. data/app/lib/actions/katello/content_view/incremental_updates.rb +3 -9
  67. data/app/lib/actions/katello/content_view_version/republish_repositories.rb +8 -2
  68. data/app/lib/actions/katello/repository/capsule_sync.rb +1 -1
  69. data/app/lib/actions/katello/repository/update_metadata_sync.rb +1 -1
  70. data/app/lib/katello/concerns/base_template_scope_extensions.rb +4 -9
  71. data/app/lib/katello/resources/cdn.rb +4 -0
  72. data/app/lib/katello/validators/alternate_content_source_products_validator.rb +1 -1
  73. data/app/models/katello/cdn_configuration.rb +4 -0
  74. data/app/models/katello/concerns/host_managed_extensions.rb +2 -1
  75. data/app/models/katello/content_view.rb +5 -1
  76. data/app/models/katello/content_view_component.rb +1 -1
  77. data/app/models/katello/content_view_version.rb +4 -0
  78. data/app/models/katello/host/content_facet.rb +4 -5
  79. data/app/models/katello/ping.rb +0 -19
  80. data/app/models/katello/repository.rb +5 -1
  81. data/app/models/katello/root_repository.rb +2 -8
  82. data/app/services/katello/applicability/applicable_content_helper.rb +2 -2
  83. data/app/services/katello/registration_manager.rb +2 -12
  84. data/app/views/foreman/job_templates/configure_host_for_new_content_source.erb +25 -0
  85. data/app/views/katello/api/v2/capsule_content/sync_status.json.rabl +1 -1
  86. data/app/views/katello/api/v2/content_facet/show.json.rabl +0 -12
  87. data/app/views/katello/api/v2/content_view_components/show.json.rabl +4 -1
  88. data/app/views/katello/api/v2/content_views/base.json.rabl +6 -2
  89. data/app/views/katello/api/v2/repositories/show.json.rabl +0 -1
  90. data/config/initializers/monkeys.rb +1 -0
  91. data/config/katello.yaml.example +0 -4
  92. data/config/routes/api/v2.rb +3 -0
  93. data/config/routes/overrides.rb +0 -11
  94. data/db/migrate/20230609155411_add_custom_cdn_auth_enabled_to_katello_cdn_configurations.rb +5 -0
  95. data/db/migrate/20230710190626_remove_relative_path_limit.rb +5 -0
  96. data/db/migrate/20230717150442_change_change_content_source_job_template_name.rb +20 -0
  97. data/db/migrate/20230828143236_remove_katello_agent_dispatch_history.rb +15 -0
  98. data/db/seeds.d/111-upgrade_tasks.rb +1 -2
  99. data/engines/bastion/app/views/bastion/layouts/assets.html.erb +1 -1
  100. data/engines/bastion_katello/README.md +2 -1
  101. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/activation-keys.controller.js +4 -2
  102. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-associations-content-hosts.html +2 -2
  103. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/views/activation-keys.html +8 -3
  104. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-errata-modal.controller.js +3 -44
  105. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-module-streams-modal.controller.js +0 -1
  106. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-packages-modal.controller.js +1 -65
  107. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-errata-modal.html +1 -3
  108. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-packages-modal.html +1 -6
  109. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-debs-applicable.controller.js +1 -1
  110. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-errata.controller.js +1 -16
  111. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-module-streams.controller.js +0 -1
  112. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-packages-actions.controller.js +0 -1
  113. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-packages-applicable.controller.js +2 -11
  114. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-packages-installed.controller.js +0 -2
  115. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-packages.controller.js +1 -39
  116. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-debs-applicable.html +2 -2
  117. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-errata.html +1 -2
  118. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-packages-actions.html +2 -3
  119. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-packages-applicable.html +4 -5
  120. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-packages-installed.html +1 -1
  121. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts.controller.js +2 -4
  122. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-details.controller.js +2 -4
  123. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-details.html +0 -1
  124. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-info.html +0 -14
  125. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts.html +0 -4
  126. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/apply-errata.controller.js +1 -2
  127. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/files/details/file-content-views.controller.js +2 -1
  128. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/files/details/views/file-content-views.html +1 -1
  129. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/bastion_katello.pot +235 -521
  130. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-packages.html +13 -2
  131. data/engines/bastion_katello/lib/bastion_katello/engine.rb +1 -3
  132. data/lib/katello/engine.rb +0 -18
  133. data/lib/katello/permission_creator.rb +1 -1
  134. data/lib/katello/plugin.rb +0 -25
  135. data/lib/katello/version.rb +1 -1
  136. data/lib/monkeys/remove_hidden_distribution.rb +383 -0
  137. data/locale/action_names.rb +3 -1
  138. data/locale/bn/katello.po +130 -39
  139. data/locale/bn_IN/katello.po +130 -39
  140. data/locale/ca/katello.po +130 -39
  141. data/locale/cs/katello.po +130 -39
  142. data/locale/cs_CZ/katello.po +130 -39
  143. data/locale/de/LC_MESSAGES/katello.mo +0 -0
  144. data/locale/de/katello.po +134 -43
  145. data/locale/de_AT/katello.po +130 -39
  146. data/locale/de_DE/katello.po +130 -39
  147. data/locale/el/katello.po +130 -39
  148. data/locale/en/katello.po +130 -39
  149. data/locale/en_GB/katello.po +130 -39
  150. data/locale/en_US/katello.po +130 -39
  151. data/locale/es/LC_MESSAGES/katello.mo +0 -0
  152. data/locale/es/katello.po +133 -42
  153. data/locale/et_EE/katello.po +130 -39
  154. data/locale/fr/LC_MESSAGES/katello.mo +0 -0
  155. data/locale/fr/katello.po +138 -47
  156. data/locale/gl/katello.po +130 -39
  157. data/locale/gu/katello.po +130 -39
  158. data/locale/he_IL/katello.po +130 -39
  159. data/locale/hi/katello.po +130 -39
  160. data/locale/id/katello.po +130 -39
  161. data/locale/it/LC_MESSAGES/katello.mo +0 -0
  162. data/locale/it/katello.po +131 -40
  163. data/locale/ja/LC_MESSAGES/katello.mo +0 -0
  164. data/locale/ja/katello.po +138 -47
  165. data/locale/ka/LC_MESSAGES/katello.mo +0 -0
  166. data/locale/ka/katello.po +131 -40
  167. data/locale/katello.pot +805 -642
  168. data/locale/kn/katello.po +130 -39
  169. data/locale/ko/LC_MESSAGES/katello.mo +0 -0
  170. data/locale/ko/katello.po +131 -40
  171. data/locale/ml_IN/katello.po +130 -39
  172. data/locale/mr/katello.po +130 -39
  173. data/locale/nl_NL/katello.po +130 -39
  174. data/locale/or/katello.po +130 -39
  175. data/locale/pa/katello.po +130 -39
  176. data/locale/pl/katello.po +130 -39
  177. data/locale/pl_PL/katello.po +130 -39
  178. data/locale/pt/katello.po +130 -39
  179. data/locale/pt_BR/LC_MESSAGES/katello.mo +0 -0
  180. data/locale/pt_BR/katello.po +133 -42
  181. data/locale/ro/katello.po +130 -39
  182. data/locale/ro_RO/katello.po +130 -39
  183. data/locale/ru/LC_MESSAGES/katello.mo +0 -0
  184. data/locale/ru/katello.po +131 -40
  185. data/locale/sl/katello.po +130 -39
  186. data/locale/sv_SE/katello.po +130 -39
  187. data/locale/ta/katello.po +130 -39
  188. data/locale/ta_IN/katello.po +130 -39
  189. data/locale/te/katello.po +130 -39
  190. data/locale/tr/katello.po +130 -39
  191. data/locale/vi/katello.po +130 -39
  192. data/locale/vi_VN/katello.po +130 -39
  193. data/locale/zh/katello.po +130 -39
  194. data/locale/zh_CN/LC_MESSAGES/katello.mo +0 -0
  195. data/locale/zh_CN/katello.po +138 -47
  196. data/locale/zh_TW/LC_MESSAGES/katello.mo +0 -0
  197. data/locale/zh_TW/katello.po +131 -40
  198. data/webpack/components/extensions/HostDetails/Cards/HostCollectionsCard/HostCollectionsModal.js +0 -5
  199. data/webpack/components/extensions/HostDetails/Tabs/ContentTab/index.js +9 -3
  200. data/webpack/components/extensions/HostDetails/Tabs/ErrataTab/ErrataTab.js +7 -58
  201. data/webpack/components/extensions/HostDetails/Tabs/ErrataTab/HostErrataActions.js +2 -11
  202. data/webpack/components/extensions/HostDetails/Tabs/PackagesTab/HostPackagesActions.js +1 -40
  203. data/webpack/components/extensions/HostDetails/Tabs/PackagesTab/HostPackagesConstants.js +0 -3
  204. data/webpack/components/extensions/HostDetails/Tabs/PackagesTab/PackageInstallModal.js +5 -40
  205. data/webpack/components/extensions/HostDetails/Tabs/PackagesTab/PackagesTab.js +6 -65
  206. data/webpack/components/extensions/HostDetails/Tabs/RepositorySetsTab/RepositorySetsTab.js +5 -4
  207. data/webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js +0 -212
  208. data/webpack/components/extensions/HostDetails/Tabs/__tests__/packageInstallModal.test.js +2 -157
  209. data/webpack/components/extensions/HostDetails/hostDetailsHelpers.js +0 -20
  210. data/webpack/containers/Application/config.js +5 -0
  211. data/webpack/scenes/ActivationKeys/Details/ActivationKeyActions.js +31 -0
  212. data/webpack/scenes/ActivationKeys/Details/ActivationKeyConstants.js +3 -0
  213. data/webpack/scenes/ActivationKeys/Details/ActivationKeyDetails.js +127 -0
  214. data/webpack/scenes/ActivationKeys/Details/ActivationKeyDetails.scss +37 -0
  215. data/webpack/scenes/ActivationKeys/Details/ActivationKeyDetailsSelectors.js +16 -0
  216. data/webpack/scenes/ActivationKeys/Details/__tests__/activationKeyDetails.test.js +117 -0
  217. data/webpack/scenes/ActivationKeys/Details/components/DeleteMenu.js +77 -0
  218. data/webpack/scenes/ActivationKeys/Details/components/DeleteModal.js +63 -0
  219. data/webpack/scenes/ActivationKeys/Details/components/EditModal.js +199 -0
  220. data/webpack/scenes/ActivationKeys/Details/index.js +3 -0
  221. data/webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditCredentials.js +10 -5
  222. data/webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditProducts.js +8 -3
  223. data/webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditSmartProxies.js +8 -3
  224. data/webpack/scenes/AlternateContentSources/Details/__tests__/ACSEdits.test.js +2 -2
  225. data/webpack/scenes/AlternateContentSources/MainTable/ACSTable.js +1 -1
  226. data/webpack/scenes/ContentViews/Details/ComponentContentViews/ComponentContentViewAddModal.js +37 -29
  227. data/webpack/scenes/ContentViews/Details/ComponentContentViews/ComponentContentViewBulkAddModal.js +53 -37
  228. data/webpack/scenes/ContentViews/Details/ComponentContentViews/ContentViewComponents.js +7 -0
  229. data/webpack/scenes/ContentViews/Details/ComponentContentViews/__tests__/contentViewComponents.fixtures.json +15 -6
  230. data/webpack/scenes/ContentViews/Details/ComponentContentViews/__tests__/contentViewComponents.test.js +6 -5
  231. data/webpack/scenes/ContentViews/Details/ComponentContentViews/__tests__/publishedContentViewDetails.fixtures.json +43 -197
  232. data/webpack/scenes/ContentViews/Details/Filters/CVErrataDateFilterContent.js +1 -1
  233. data/webpack/scenes/ContentViews/Details/Filters/Rules/Package/AddEditPackageRuleModal.js +1 -1
  234. data/webpack/scenes/ContentViews/Details/Promote/ContentViewVersionPromote.js +2 -2
  235. data/webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.fixtures.json +0 -98
  236. data/webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.test.js +103 -1
  237. data/webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersionsLatestEnvironment.fixtures.json +634 -0
  238. data/webpack/scenes/ContentViews/components/ContentViewSelect/helpers.js +1 -1
  239. data/webpack/scenes/Hosts/ChangeContentSource/actions.js +14 -12
  240. data/webpack/scenes/Hosts/ChangeContentSource/components/ContentSourceForm.js +45 -6
  241. data/webpack/scenes/Hosts/ChangeContentSource/components/ContentSourceTemplate.js +42 -7
  242. data/webpack/scenes/Hosts/ChangeContentSource/index.js +37 -10
  243. data/webpack/scenes/Hosts/ChangeContentSource/styles.scss +5 -0
  244. data/webpack/scenes/RedHatRepositories/index.scss +1 -1
  245. data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +2 -2
  246. metadata +85 -81
  247. data/app/lib/actions/katello/agent/dispatch_history_presenter.rb +0 -64
  248. data/app/lib/actions/katello/agent_action.rb +0 -120
  249. data/app/lib/actions/katello/bulk_agent_action.rb +0 -37
  250. data/app/lib/actions/katello/host/erratum/applicable_errata_install.rb +0 -44
  251. data/app/lib/actions/katello/host/erratum/install.rb +0 -38
  252. data/app/lib/actions/katello/host/package/install.rb +0 -34
  253. data/app/lib/actions/katello/host/package/remove.rb +0 -48
  254. data/app/lib/actions/katello/host/package/update.rb +0 -42
  255. data/app/lib/actions/katello/host/package_group/install.rb +0 -30
  256. data/app/lib/actions/katello/host/package_group/remove.rb +0 -30
  257. data/app/lib/katello/agent/base_message.rb +0 -41
  258. data/app/lib/katello/agent/client_message_handler.rb +0 -69
  259. data/app/lib/katello/agent/connection.rb +0 -38
  260. data/app/lib/katello/agent/install_errata_message.rb +0 -25
  261. data/app/lib/katello/agent/install_package_group_message.rb +0 -25
  262. data/app/lib/katello/agent/install_package_message.rb +0 -28
  263. data/app/lib/katello/agent/remove_package_group_message.rb +0 -25
  264. data/app/lib/katello/agent/remove_package_message.rb +0 -28
  265. data/app/lib/katello/agent/update_package_message.rb +0 -33
  266. data/app/lib/katello/event_daemon/services/agent_event_receiver.rb +0 -59
  267. data/app/lib/katello/qpid/connection.rb +0 -149
  268. data/app/lib/katello/util/default_enablement_migrator.rb +0 -183
  269. data/app/models/katello/agent/dispatch_history.rb +0 -19
  270. data/app/models/katello/events/delete_host_agent_queue.rb +0 -19
  271. data/app/services/katello/agent/dispatcher.rb +0 -60
  272. data/app/views/foreman/job_templates/change_content_source.erb +0 -18
  273. data/app/views/katello/api/v2/sync/index.json.rabl +0 -1
  274. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/common/views/katello-agent-notice.html +0 -8
  275. data/lib/katello/tasks/upgrades/4.9/update_custom_products_enablement.rake +0 -13
  276. data/webpack/components/extensions/HostDetails/common/KatelloAgentDeprecationAlert.js +0 -23
@@ -188,7 +188,7 @@ module Katello
188
188
 
189
189
  api :PUT, "/systems/:id/enabled_repos", N_("Update the information about enabled repositories")
190
190
  desc <<-DESC
191
- Used by katello-agent to keep the information about enabled repositories up to date.
191
+ Used to keep the information about enabled repositories up to date.
192
192
  This information is then used for computing the errata available for the system.
193
193
  DESC
194
194
  param :enabled_repos, Hash, :required => true do
@@ -1,6 +1,6 @@
1
1
  module Katello
2
2
  class Api::V2::AlternateContentSourcesBulkActionsController < Api::V2::ApiController
3
- before_action :find_alternate_content_sources
3
+ before_action :find_alternate_content_sources, except: [:refresh_all_alternate_content_sources]
4
4
 
5
5
  api :PUT, '/alternate_content_sources/bulk/destroy', N_('Destroy one or more alternate content sources')
6
6
  param :ids, Array, desc: N_('List of alternate content source IDs'), required: true
@@ -34,11 +34,32 @@ module Katello
34
34
  end
35
35
  end
36
36
 
37
+ api :POST, '/alternate_content_sources/bulk/refresh_all', N_("Refresh all alternate content sources")
38
+ def refresh_all_alternate_content_sources
39
+ refreshable_alternate_content_sources = AlternateContentSource.editable
40
+ if refreshable_alternate_content_sources.empty?
41
+ msg = _("Unable to refresh any alternate content source. You either do"\
42
+ " not have the permission to refresh, or no alternate content sources exist.")
43
+ fail HttpErrors::UnprocessableEntity, msg
44
+ else
45
+ task = async_task(::Actions::BulkAction,
46
+ ::Actions::Katello::AlternateContentSource::Refresh,
47
+ refreshable_alternate_content_sources)
48
+ respond_for_async resource: task
49
+ end
50
+ end
51
+
37
52
  private
38
53
 
39
54
  def find_alternate_content_sources
40
55
  params.require(:ids)
41
56
  @alternate_content_sources = AlternateContentSource.readable.where(id: params[:ids])
57
+ unless params[:ids].size == @alternate_content_sources.size
58
+ missing_ids = params[:ids].map(&:to_s) - @alternate_content_sources.pluck(:id)&.map(&:to_s)
59
+ msg = "Could not find alternate content sources with id: #{missing_ids} . You either do not have required permissions"\
60
+ ", or these alternate content sources do not exist."
61
+ fail HttpErrors::UnprocessableEntity, msg
62
+ end
42
63
  end
43
64
  end
44
65
  end
@@ -38,21 +38,6 @@ module Katello
38
38
  @resource_class ||= "Katello::#{resource_name.classify}".constantize
39
39
  end
40
40
 
41
- def deprecate_katello_agent
42
- check_katello_agent_not_disabled
43
- ::Foreman::Deprecation.api_deprecation_warning("This action uses katello-agent, which is deprecated and will be removed in #{katello_agent_removal_release}.")
44
- end
45
-
46
- def check_katello_agent_not_disabled
47
- unless ::Katello.with_katello_agent?
48
- fail HttpErrors::BadRequest, _("This action uses katello-agent, which is currently disabled. Use remote execution instead.")
49
- end
50
- end
51
-
52
- def katello_agent_removal_release
53
- self.class.katello_agent_removal_release
54
- end
55
-
56
41
  def full_result_response(collection)
57
42
  { :results => collection,
58
43
  :total => collection.count,
@@ -22,6 +22,8 @@ module Katello
22
22
  param :organization_id, :number, :desc => N_("Organization identifier")
23
23
  param :include_applied_filters, :bool, :desc => N_("Whether or not to return filters applied to the content view version"), :required => false
24
24
  param :triggered_by_id, :number, :desc => N_("Filter composite versions whose publish was triggered by the specified component version"), :required => false
25
+ param :file_id, :number, :desc => N_("Filter content view versions that contain the file")
26
+ param :nondefault, :bool, :desc => N_("Filter out default content views"), :required => false
25
27
  param_group :search, Api::V2::ApiController
26
28
  add_scoped_search_description_for(ContentViewVersion)
27
29
  def index
@@ -36,10 +38,12 @@ module Katello
36
38
  versions = ContentViewVersion.readable
37
39
  versions = versions.triggered_by(params[:triggered_by_id]) if params[:triggered_by_id]
38
40
  versions = versions.with_organization_id(params[:organization_id]) if params[:organization_id]
41
+ versions = versions.non_default_view if ::Foreman::Cast.to_bool(params[:nondefault])
39
42
  versions = versions.where(:content_view_id => @view.id) if @view
40
43
  versions = versions.for_version(version_number) if version_number
41
44
  versions = versions.in_environment(@environment) if @environment
42
45
  versions = versions.component_of(params[:composite_version_id]) if params[:composite_version_id]
46
+ versions = versions.contains_file(params[:file_id]) if params[:file_id]
43
47
  versions
44
48
  end
45
49
 
@@ -78,9 +82,15 @@ module Katello
78
82
 
79
83
  api :PUT, "/content_view_versions/:id/republish_repositories", N_("Forces a republish of the version's repositories' metadata")
80
84
  param :id, :number, :desc => N_("Content view version identifier"), :required => true
81
- param :force, :bool, :desc => N_("Force metadata regeneration to proceed. (Deprecated)"), deprecated: true
85
+ param :force, :bool, :desc => N_("Force metadata regeneration to proceed. Dangerous operation when version has repositories with the 'Complete Mirroring' mirroring policy")
82
86
  def republish_repositories
83
- task = async_task(::Actions::Katello::ContentViewVersion::RepublishRepositories, @content_view_version)
87
+ mirror_complete_repos = @content_view_version.repositories.joins(:root).where(root: { mirroring_policy: ::Katello::RootRepository::MIRRORING_POLICY_COMPLETE })
88
+ if mirror_complete_repos.size > 0 && !::Foreman::Cast.to_bool(params[:force])
89
+ fail HttpErrors::BadRequest, _("Metadata republishing is dangerous on content view versions with repositories with the 'Complete Mirroring' mirroring policy.
90
+ Change the mirroring policy on these repositories: #{mirror_complete_repos.pluck(:name)} and try again.
91
+ Alternatively, use the 'force' parameter to regenerate metadata locally. New versions of the content view will continue to use upstream metadata for repositories with 'Complete Mirroring'.")
92
+ end
93
+ task = async_task(::Actions::Katello::ContentViewVersion::RepublishRepositories, @content_view_version, force: ::Foreman::Cast.to_bool(params[:force]))
84
94
  respond_for_async :resource => task
85
95
  end
86
96
 
@@ -127,8 +137,7 @@ module Katello
127
137
  validate_content(params[:add_content])
128
138
  resolve_dependencies = params.fetch(:resolve_dependencies, true)
129
139
  task = async_task(::Actions::Katello::ContentView::IncrementalUpdates, @content_view_version_environments, @composite_version_environments,
130
- params[:add_content], resolve_dependencies, hosts, params[:description],
131
- Setting[:remote_execution_by_default] && ::Katello.with_remote_execution?)
140
+ params[:add_content], resolve_dependencies, hosts, params[:description])
132
141
  respond_for_async :resource => task
133
142
  end
134
143
 
@@ -14,7 +14,6 @@ module Katello
14
14
  before_action :find_errata_ids, only: :apply
15
15
  before_action :find_environment, only: :index
16
16
  before_action :find_content_view, only: :index
17
- before_action :deprecate_katello_agent, only: :apply
18
17
 
19
18
  resource_description do
20
19
  api_version 'v2'
@@ -58,17 +57,6 @@ module Katello
58
57
  respond_for_index :collection => collection
59
58
  end
60
59
 
61
- api :PUT, "/hosts/:host_id/errata/apply", N_("Schedule errata for installation using katello-agent. %s") % katello_agent_deprecation_text, deprecated: true
62
- param :host_id, :number, :desc => N_("Host ID"), :required => true
63
- param :errata_ids, Array, :desc => N_("List of Errata ids to install. Will be removed in %s") % katello_agent_removal_release, required: true
64
-
65
- param_group :bulk_errata_ids
66
- param_group :search, Api::V2::ApiController
67
- def apply
68
- task = async_task(::Actions::Katello::Host::Erratum::Install, @host, content: @errata_ids)
69
- respond_for_async :resource => task
70
- end
71
-
72
60
  api :GET, "/hosts/:host_id/errata/:id", N_("Retrieve a single errata for a host")
73
61
  param :host_id, :number, :desc => N_("Host ID"), :required => true
74
62
  param :id, String, :desc => N_("Errata id of the erratum (RHSA-2012:108)"), :required => true
@@ -10,7 +10,6 @@ module Katello
10
10
  before_action :require_packages_only, :only => [:upgrade]
11
11
  before_action :find_editable_host_with_facet, :except => :index
12
12
  before_action :find_host, :only => :index
13
- before_action :deprecate_katello_agent, :only => [:install, :remove, :upgrade, :upgrade_all]
14
13
 
15
14
  resource_description do
16
15
  api_version 'v2'
@@ -35,60 +34,6 @@ module Katello
35
34
  respond_for_index(:collection => collection)
36
35
  end
37
36
 
38
- api :PUT, "/hosts/:host_id/packages/install", N_("Install packages remotely using katello-agent. %s") % katello_agent_deprecation_text, deprecated: true
39
- param :host_id, :number, :required => true, :desc => N_("ID of the host")
40
- param_group :packages_or_groups
41
- def install
42
- if params[:packages]
43
- packages = validate_package_list_format(params[:packages])
44
- task = async_task(::Actions::Katello::Host::Package::Install, @host, content: packages)
45
- respond_for_async :resource => task
46
- return
47
- end
48
-
49
- if params[:groups]
50
- groups = extract_group_names(params[:groups])
51
- task = async_task(::Actions::Katello::Host::PackageGroup::Install, @host, content: groups)
52
- respond_for_async :resource => task
53
- end
54
- end
55
-
56
- api :PUT, "/hosts/:host_id/packages/upgrade", N_("Update packages remotely using katello-agent. %s") % katello_agent_deprecation_text, deprecated: true
57
- param :host_id, :number, :required => true, :desc => N_("ID of the host")
58
- param :packages, Array, :desc => N_("list of packages names"), :required => true
59
- def upgrade
60
- if params[:packages]
61
- packages = validate_package_list_format(params[:packages])
62
- task = async_task(::Actions::Katello::Host::Package::Update, @host, content: packages)
63
- respond_for_async :resource => task
64
- end
65
- end
66
-
67
- api :PUT, "/hosts/:host_id/packages/upgrade_all", N_("Update packages remotely using katello-agent. %s") % katello_agent_deprecation_text, deprecated: true
68
- param :host_id, :number, :required => true, :desc => N_("ID of the host")
69
- def upgrade_all
70
- task = async_task(::Actions::Katello::Host::Package::Update, @host, content: [])
71
- respond_for_async :resource => task
72
- end
73
-
74
- api :PUT, "/hosts/:host_id/packages/remove", N_("Uninstall packages remotely using katello-agent. %s") % katello_agent_deprecation_text, deprecated: true
75
- param :host_id, :number, :required => true, :desc => N_("ID of the host")
76
- param_group :packages_or_groups
77
- def remove
78
- if params[:packages]
79
- packages = validate_package_list_format(params[:packages])
80
- task = async_task(::Actions::Katello::Host::Package::Remove, @host, content: packages)
81
- respond_for_async :resource => task
82
- return
83
- end
84
-
85
- if params[:groups]
86
- groups = extract_group_names(params[:groups])
87
- task = async_task(::Actions::Katello::Host::PackageGroup::Remove, @host, content: groups)
88
- respond_for_async :resource => task
89
- end
90
- end
91
-
92
37
  def index_relation
93
38
  packages = @host.installed_packages
94
39
  upgradable_packages = ::Katello::Rpm.installable_for_hosts([@host]).select(:name)
@@ -1,5 +1,4 @@
1
1
  module Katello
2
- # rubocop:disable Metrics/ClassLength
3
2
  class Api::V2::HostsBulkActionsController < Api::V2::ApiController
4
3
  include Concerns::Api::V2::BulkHostsExtensions
5
4
  include Katello::Concerns::Api::V2::ContentOverridesController
@@ -15,9 +14,7 @@ module Katello
15
14
  before_action :find_errata, only: [:available_incremental_updates]
16
15
  before_action :find_organization, only: [:add_subscriptions]
17
16
  before_action :find_traces, only: [:resolve_traces]
18
- before_action :deprecate_katello_agent, only: [:install_content, :update_content, :remove_content]
19
17
 
20
- before_action :validate_content_action, only: [:install_content, :update_content, :remove_content]
21
18
  before_action :validate_organization, only: [:add_subscriptions]
22
19
 
23
20
  # disable *_count fields on erratum rabl, since they perform N+1 queries
@@ -28,22 +25,6 @@ module Katello
28
25
  api_base_url "/api"
29
26
  end
30
27
 
31
- PARAM_ACTIONS = {
32
- :install_content => {
33
- :package => ::Actions::Katello::Host::Package::Install,
34
- :package_group => ::Actions::Katello::Host::PackageGroup::Install,
35
- :errata => :install_errata
36
- },
37
- :update_content => {
38
- :package => ::Actions::Katello::Host::Package::Update,
39
- :package_group => ::Actions::Katello::Host::PackageGroup::Install
40
- },
41
- :remove_content => {
42
- :package => ::Actions::Katello::Host::Package::Remove,
43
- :package_group => ::Actions::Katello::Host::PackageGroup::Remove
44
- }
45
- }.with_indifferent_access
46
-
47
28
  def_param_group :bulk_params do
48
29
  param :organization_id, :number, :required => true, :desc => N_("ID of the organization")
49
30
  param :included, Hash, :required => true, :action_aware => true do
@@ -117,37 +98,6 @@ module Katello
117
98
  :resource_class => Erratum))
118
99
  end
119
100
 
120
- api :PUT, "/hosts/bulk/install_content", N_("Install content on one or more hosts using katello-agent. %s") % katello_agent_deprecation_text, deprecated: true
121
- param_group :bulk_params
122
- param :content_type, String,
123
- :desc => N_("The type of content. The following types are supported: 'package', 'package_group' and 'errata'."),
124
- :required => true
125
- param :content, Array, :desc => N_("List of content (e.g. package names, package group names (Deprecated) or errata ids)")
126
- def install_content
127
- content_action
128
- end
129
-
130
- api :PUT, "/hosts/bulk/update_content", N_("Update content on one or more hosts using katello-agent. %s") % katello_agent_deprecation_text, deprecated: true
131
- param_group :bulk_params
132
- param :content_type, String,
133
- :desc => N_("The type of content. The following types are supported: 'package' and 'package_group."),
134
- :required => true
135
- param :content, Array, :desc => N_("List of content (e.g. package or package group names)"), :required => true
136
- param :update_all, :bool, :desc => N_("Updates all packages on the host(s)")
137
- def update_content
138
- content_action
139
- end
140
-
141
- api :PUT, "/hosts/bulk/remove_content", N_("Remove content on one or more hosts using katello-agent. %s") % katello_agent_deprecation_text, deprecated: true
142
- param_group :bulk_params
143
- param :content_type, String,
144
- :desc => N_("The type of content. The following types are supported: 'package' and 'package_group."),
145
- :required => true
146
- param :content, Array, :desc => N_("List of content (e.g. package or package group names)"), :required => true
147
- def remove_content
148
- content_action
149
- end
150
-
151
101
  api :PUT, "/hosts/bulk/destroy", N_("Destroy one or more hosts")
152
102
  param_group :bulk_params
153
103
  def destroy_hosts
@@ -384,33 +334,6 @@ module Katello
384
334
  end
385
335
  end
386
336
 
387
- def content_action
388
- if params[:content_type] == 'errata'
389
- options = {}
390
- options[:update_all] = true if ::Foreman::Cast.to_bool(params[:install_all])
391
- options[:errata_ids] = params[:content]
392
-
393
- task = async_task(::Actions::BulkAction, ::Actions::Katello::Host::Erratum::ApplicableErrataInstall, @hosts, options)
394
- respond_for_async :resource => task
395
- else
396
- content = params[:content]
397
- if params[:action] == :update_content && params[:update_all]
398
- content = []
399
- end
400
- task = async_task(Actions::Katello::BulkAgentAction, PARAM_ACTIONS[params[:action]][params[:content_type]], @hosts, content: content)
401
- respond_for_async :resource => task
402
- end
403
- end
404
-
405
- def validate_content_action
406
- fail HttpErrors::BadRequest, _("A content_type must be provided.") if params[:content_type].blank?
407
- fail HttpErrors::BadRequest, _("No content has been provided.") if params[:content].blank? && !params[:update_all]
408
-
409
- if PARAM_ACTIONS[params[:action]][params[:content_type]].nil?
410
- fail HttpErrors::BadRequest, _("Invalid content type %s") % params[:content_type]
411
- end
412
- end
413
-
414
337
  def find_environment
415
338
  @environment = KTEnvironment.editable.find(params[:environment_id])
416
339
  throw_resource_not_found(name: 'lifecycle environment', id: params[:environment_id]) unless @environment
@@ -161,9 +161,10 @@ module Katello
161
161
  param :upstream_content_view_label, String, :desc => N_("Upstream Content View Label, default: Default_Organization_View. Relevant only for 'upstream_server' type.")
162
162
  param :upstream_lifecycle_environment_label, String, :desc => N_("Upstream Lifecycle Environment, default: Library. Relevant only for 'upstream_server' type.")
163
163
  param :ssl_ca_credential_id, Integer, :desc => N_("Content Credential to use for SSL CA. Relevant only for 'upstream_server' type.")
164
+ param :custom_cdn_auth_enabled, :bool, :desc => N_("If product certificates should be used to authenticate to a custom CDN.")
164
165
  def cdn_configuration
165
166
  config_keys = [:url, :username, :password, :upstream_organization_label, :ssl_ca_credential_id, :type,
166
- :upstream_lifecycle_environment_label, :upstream_content_view_label]
167
+ :upstream_lifecycle_environment_label, :upstream_content_view_label, :custom_cdn_auth_enabled]
167
168
  config_params = params.slice(*config_keys).permit!.to_h
168
169
 
169
170
  task = sync_task(::Actions::Katello::CdnConfiguration::Update, @organization.cdn_configuration, config_params)
@@ -50,7 +50,6 @@ Pass [] to make repo available for clients regardless of OS version. Maximum len
50
50
  param :unprotected, :bool, :desc => N_("true if this repository can be published via HTTP")
51
51
  param :checksum_type, String, :desc => N_("Checksum of the repository, currently 'sha1' & 'sha256' are supported")
52
52
  param :docker_upstream_name, String, :desc => N_("Name of the upstream docker repository")
53
- param :docker_tags_whitelist, Array, :desc => N_("Comma-separated list of tags to sync for Container Image repository (Deprecated)"), :deprecated => true
54
53
  param :include_tags, Array, :desc => N_("Comma-separated list of tags to sync for a container image repository")
55
54
  param :exclude_tags, Array, :desc => N_("Comma-separated list of tags to exclude when syncing a container image repository. Default: any tag ending in \"-source\"")
56
55
  param :download_policy, ["immediate", "on_demand"], :desc => N_("download policy for yum, deb, and docker repos (either 'immediate' or 'on_demand')")
@@ -325,10 +324,11 @@ Pass [] to make repo available for clients regardless of OS version. Maximum len
325
324
 
326
325
  api :PUT, "/repositories/:id/republish", N_("Forces a republish of the specified repository, regenerating metadata and symlinks on the filesystem. Not allowed for repositories with the 'Complete Mirroring' mirroring policy.")
327
326
  param :id, :number, :desc => N_("Repository identifier"), :required => true
328
- param :force, :bool, :desc => N_("Force metadata regeneration to proceed. (Deprecated)"), deprecated: true
327
+ param :force, :bool, :desc => N_("Force metadata regeneration to proceed. Dangerous when repositories use the 'Complete Mirroring' mirroring policy")
329
328
  def republish
330
- if @repository.mirroring_policy == Katello::RootRepository::MIRRORING_POLICY_COMPLETE
331
- fail HttpErrors::BadRequest, _("Metadata republishing is not allowed on repositories with the 'Complete Mirroring' mirroring policy.")
329
+ if @repository.mirroring_policy == Katello::RootRepository::MIRRORING_POLICY_COMPLETE && !::Foreman::Cast.to_bool(params[:force])
330
+ fail HttpErrors::BadRequest, _("Metadata republishing is risky on 'Complete Mirroring' repositories. Change the mirroring policy and try again.
331
+ Alternatively, use the 'force' parameter to regenerate metadata locally. On the next sync, the upstream repository's metadata will overwrite local metadata for 'Complete Mirroring' repositories.")
332
332
  end
333
333
  task = async_task(::Actions::Katello::Repository::MetadataGenerate, @repository)
334
334
  respond_for_async :resource => task
@@ -587,7 +587,7 @@ Pass [] to make repo available for clients regardless of OS version. Maximum len
587
587
  {:os_versions => []}, :deb_releases, :deb_components, :deb_architectures, :description,
588
588
  :http_proxy_policy, :http_proxy_id, :retain_package_versions_count, {:ignorable_content => []}
589
589
  ]
590
- keys += [{:docker_tags_whitelist => []}, {:include_tags => []}, {:exclude_tags => []}, :docker_upstream_name] if params[:action] == 'create' || @repository&.docker?
590
+ keys += [{:include_tags => []}, {:exclude_tags => []}, :docker_upstream_name] if params[:action] == 'create' || @repository&.docker?
591
591
  keys += [:ansible_collection_requirements, :ansible_collection_auth_url, :ansible_collection_auth_token] if params[:action] == 'create' || @repository&.ansible_collection?
592
592
  keys += [:label, :content_type] if params[:action] == "create"
593
593
 
@@ -627,11 +627,7 @@ Pass [] to make repo available for clients regardless of OS version. Maximum len
627
627
  :metadata_expire).to_h.with_indifferent_access)
628
628
  root.docker_upstream_name = repo_params[:docker_upstream_name] if repo_params[:docker_upstream_name]
629
629
  if root.docker?
630
- if repo_params[:docker_tags_whitelist].present?
631
- root.include_tags = repo_params.fetch(:docker_tags_whitelist, [])
632
- else
633
- root.include_tags = repo_params.fetch(:include_tags, [])
634
- end
630
+ root.include_tags = repo_params.fetch(:include_tags, [])
635
631
  end
636
632
  root.exclude_tags = repo_params.fetch(:exclude_tags, ['*-source']) if root.docker?
637
633
  root.verify_ssl_on_sync = ::Foreman::Cast.to_bool(repo_params[:verify_ssl_on_sync]) if repo_params.key?(:verify_ssl_on_sync)
@@ -4,7 +4,6 @@ module Katello
4
4
  before_action :find_object, :only => [:index]
5
5
  before_action :ensure_library, :only => [:index]
6
6
 
7
- api :GET, "/organizations/:organization_id/products/:product_id/sync", N_("Get status of repo synchronisation for given product")
8
7
  api :GET, "/repositories/:repository_id/sync", N_("Get status of synchronisation for given repository")
9
8
  def index
10
9
  respond_for_async(:resource => @obj.sync_status)
@@ -17,16 +17,6 @@ module Katello
17
17
  User.current
18
18
  end
19
19
 
20
- class_methods do
21
- def katello_agent_deprecation_text
22
- N_("WARNING: Katello-agent is deprecated and will be removed in %s. Migrate to remote execution now.") % katello_agent_removal_release
23
- end
24
-
25
- def katello_agent_removal_release
26
- N_("Katello 4.10")
27
- end
28
- end
29
-
30
20
  protected
31
21
 
32
22
  def request_from_katello_cli?
@@ -91,7 +91,7 @@ module Katello
91
91
  .distinct
92
92
 
93
93
  if Katello.with_remote_execution?
94
- template_id = JobTemplate.find_by(name: 'Change content source')&.id
94
+ template_id = JobTemplate.find_by(name: 'Configure host for new content source')&.id
95
95
  job_invocation_path = new_job_invocation_path(template_id: template_id, host_ids: content_hosts.map { |h| h[:id] }) if template_id
96
96
  end
97
97
 
@@ -71,7 +71,7 @@ module Actions
71
71
  products_to_disassociate.each do |product|
72
72
  product.repositories.library.with_type(acs.content_type).each do |repo|
73
73
  smart_proxy_acs = ::Katello::SmartProxyAlternateContentSource.find_by(alternate_content_source_id: acs.id, smart_proxy_id: smart_proxy.id, repository_id: repo.id)
74
- plan_action(Pulp3::Orchestration::AlternateContentSource::Delete, smart_proxy_acs)
74
+ plan_action(Pulp3::Orchestration::AlternateContentSource::Delete, smart_proxy_acs) if smart_proxy_acs.present?
75
75
  end
76
76
  end
77
77
  end
@@ -9,7 +9,7 @@ module Actions
9
9
  def plan(content_view, environment)
10
10
  sequence do
11
11
  concurrence do
12
- smart_proxies = SmartProxy.with_environment(environment)
12
+ smart_proxies = SmartProxy.unscoped.with_environment(environment).select { |sp| sp.authorized?(:manage_capsule_content) && sp.authorized?(:view_capsule_content) }
13
13
  unless smart_proxies.blank?
14
14
  plan_action(::Actions::BulkAction, ::Actions::Katello::CapsuleContent::Sync, smart_proxies.sort,
15
15
  :content_view_id => content_view.id, :environment_id => environment.id)
@@ -4,8 +4,7 @@ module Actions
4
4
  class IncrementalUpdates < Actions::EntryAction
5
5
  include Helpers::Presenter
6
6
 
7
- def plan(version_environments, composite_version_environments, content, dep_solve, hosts, description,
8
- use_remote_execution = false)
7
+ def plan(version_environments, composite_version_environments, content, dep_solve, hosts, description)
9
8
  old_new_version_map = {}
10
9
  output_for_version_ids = []
11
10
 
@@ -34,13 +33,8 @@ module Actions
34
33
  handle_composites(old_new_version_map, composite_version_environments, output_for_version_ids, description)
35
34
  end
36
35
 
37
- if hosts.any? && !content[:errata_ids].blank? && !use_remote_execution
38
- errata = ::Katello::Erratum.with_identifiers(content[:errata_ids])
39
- hosts = hosts.where(:id => ::Katello::Host::ContentFacet.with_applicable_errata(errata).pluck(:host_id))
40
- plan_action(::Actions::BulkAction, ::Actions::Katello::Host::Erratum::ApplicableErrataInstall, hosts, :errata_ids => content[:errata_ids])
41
- end
42
36
  plan_self(:version_outputs => output_for_version_ids, :host_ids => hosts.pluck(:id),
43
- :errata_ids => content[:errata_ids], :use_remote_execution => use_remote_execution)
37
+ :errata_ids => content[:errata_ids])
44
38
  end
45
39
  end
46
40
 
@@ -65,7 +59,7 @@ module Actions
65
59
  end
66
60
 
67
61
  def run
68
- if input[:errata_ids].present? && input[:host_ids].present? && input[:use_remote_execution]
62
+ if input[:errata_ids].present? && input[:host_ids].present?
69
63
  errata_ids = input[:errata_ids].join(',')
70
64
  errata = ::Katello::Erratum.with_identifiers(input[:errata_ids])
71
65
  hosts = ::Host.where(:id => input[:host_ids] &
@@ -2,10 +2,16 @@ module Actions
2
2
  module Katello
3
3
  module ContentViewVersion
4
4
  class RepublishRepositories < Actions::EntryAction
5
- def plan(content_view_version)
5
+ def plan(content_view_version, options = {force: false})
6
+ force = options[:force]
6
7
  action_subject(content_view_version.content_view)
7
8
  plan_self(:version_id => content_view_version.id)
8
- plan_action(::Actions::Katello::Repository::BulkMetadataGenerate, content_view_version.repositories.joins(:root).where.not(root: { mirroring_policy: ::Katello::RootRepository::MIRRORING_POLICY_COMPLETE }))
9
+ repositories = if force
10
+ content_view_version.repositories
11
+ else
12
+ content_view_version.repositories.joins(:root).where.not(root: { mirroring_policy: ::Katello::RootRepository::MIRRORING_POLICY_COMPLETE })
13
+ end
14
+ plan_action(::Actions::Katello::Repository::BulkMetadataGenerate, repositories)
9
15
  end
10
16
 
11
17
  def run
@@ -9,7 +9,7 @@ module Actions
9
9
  def plan(repo)
10
10
  if repo.node_syncable?
11
11
  concurrence do
12
- smart_proxies = ::SmartProxy.with_environment(repo.environment)
12
+ smart_proxies = ::SmartProxy.unscoped.with_environment(repo.environment).select { |sp| sp.authorized?(:manage_capsule_content) && sp.authorized?(:view_capsule_content) }
13
13
  unless smart_proxies.blank?
14
14
  plan_action(::Actions::BulkAction, ::Actions::Katello::CapsuleContent::Sync, smart_proxies,
15
15
  :repository_id => repo.id)
@@ -6,7 +6,7 @@ module Actions
6
6
  sequence do
7
7
  plan_action(Katello::Repository::MetadataGenerate, repository)
8
8
  concurrence do
9
- ::SmartProxy.with_repo(repository).each do |capsule|
9
+ (::SmartProxy.unscoped.with_repo(repository).select { |sp| sp.authorized?(:manage_capsule_content) && sp.authorized?(:view_capsule_content) })&.each do |capsule|
10
10
  next if capsule.pulp_primary?
11
11
  plan_action(Katello::CapsuleContent::Sync, capsule, repository_id: repository.id)
12
12
  end
@@ -320,17 +320,12 @@ module Katello
320
320
  Util::Package.sortable_version(version)
321
321
  end
322
322
 
323
- apipie :method, 'Returns true if Katello Agent infrastructure is enabled on the server'
324
- def katello_agent_enabled?
325
- Katello.with_katello_agent?
326
- end
327
-
328
323
  include Katello::ContentSourceHelper
329
324
 
330
325
  apipie :method, "Generate script to change a host's content source" do
331
326
  returns String
332
327
  end
333
- def change_content_source(host, ca_cert)
328
+ def configure_host_for_new_content_source(host, ca_cert)
334
329
  return missing_content_source(host) unless host.content_source
335
330
 
336
331
  prepare_ssl_cert(ca_cert) + configure_subman(host.content_source)
@@ -359,9 +354,9 @@ module Katello
359
354
  def parse_errata(task)
360
355
  task_input = get_task_input(task)
361
356
  agent_input = task_input['errata'] || task_input['content']
362
- # Pick katello agent errata if present
363
- # Otherwise pick rex errata. There are multiple template inputs, such as errata, pre_script and post_script we only need the
364
- # errata input here.
357
+ # agent_input retrieves past katello-agent tasks.
358
+ # There are multiple template inputs, such as errata, pre_script and post_script.
359
+ # We only need the errata input here.
365
360
  @_tasks_errata_cache[task.id] ||= agent_input.presence || errata_ids_from_template_invocation(task, task_input)
366
361
  end
367
362
 
@@ -67,6 +67,10 @@ module Katello
67
67
  self.new(cdn_configuration.url, options)
68
68
  elsif cdn_configuration.custom_cdn?
69
69
  options[:ssl_ca_cert] = cdn_configuration.ssl_ca
70
+ if cdn_configuration.custom_cdn_auth_enabled?
71
+ options[:ssl_client_cert] = OpenSSL::X509::Certificate.new(product.certificate)
72
+ options[:ssl_client_key] = OpenSSL::PKey::RSA.new(product.key)
73
+ end
70
74
  self.new(cdn_configuration.url, options)
71
75
  else
72
76
  options[:username] = cdn_configuration.username
@@ -7,7 +7,7 @@ module Katello
7
7
  product = ::Katello::Product.find(value)
8
8
  content_type = record.alternate_content_source.content_type
9
9
  if product.repositories.with_type(content_type).has_url.empty?
10
- record.errors[attribute] << N_("The product %{name} has no %{type} repositories with upstream URLs to add to the alternate content source.") % { name: product.name, type: content_type }
10
+ record.errors.add(attribute, _("%{name} has no %{type} repositories with upstream URLs to add to the alternate content source.") % { name: product.name, type: content_type })
11
11
  end
12
12
  end
13
13
  end
@@ -37,6 +37,10 @@ module Katello
37
37
  type == CUSTOM_CDN_TYPE
38
38
  end
39
39
 
40
+ def custom_cdn_auth_enabled?
41
+ custom_cdn_auth_enabled
42
+ end
43
+
40
44
  def redhat_cdn_url?
41
45
  Katello::Resources::CDN::CdnResource.redhat_cdn?(url)
42
46
  end
@@ -112,7 +112,6 @@ module Katello
112
112
  has_many :content_view_environments, through: :content_view_environment_content_facets
113
113
  has_many :content_views, through: :content_view_environments
114
114
  has_many :lifecycle_environments, through: :content_view_environments
115
- has_many :dispatch_histories, :class_name => "::Katello::Agent::DispatchHistory", :foreign_key => :host_id, :dependent => :delete_all
116
115
 
117
116
  has_many :host_installed_packages, :class_name => "::Katello::HostInstalledPackage", :foreign_key => :host_id, :dependent => :delete_all
118
117
  has_many :installed_packages, :class_name => "::Katello::InstalledPackage", :through => :host_installed_packages
@@ -129,6 +128,8 @@ module Katello
129
128
 
130
129
  has_many :hypervisor_pools, :class_name => '::Katello::Pool', :foreign_key => :hypervisor_id, :dependent => :nullify
131
130
 
131
+ validates :name, format: { with: Net::Validations::HOST_REGEXP, message: _("%{value} can contain only lowercase letters, numbers, dashes and dots.") }
132
+
132
133
  before_validation :correct_kickstart_repository
133
134
  after_validation :add_back_cve_errors
134
135
  after_update :clear_pending_cve_attributes
@@ -1,7 +1,7 @@
1
1
  module Katello
2
2
  # rubocop:disable Metrics/ClassLength
3
3
  class ContentView < Katello::Model
4
- audited :associations => [:repositories, :environments, :filters], :except => [:name, :label, :description]
4
+ audited :associations => [:repositories, :environments, :filters]
5
5
  has_associated_audits
6
6
  include Ext::LabelFromName
7
7
  include Katello::Authorization::ContentView
@@ -178,6 +178,10 @@ module Katello
178
178
  content_view_components.map(&:latest_version).compact.freeze
179
179
  end
180
180
 
181
+ def sorted_versions
182
+ versions.order('created_at DESC')
183
+ end
184
+
181
185
  # Adds content view components based on the input
182
186
  # [{:content_view_version_id=>1, :latest=> false}, {:content_view_id=>1, :latest=> true} ..]
183
187
  def add_components(components_to_add)
@@ -32,7 +32,7 @@ module Katello
32
32
  end
33
33
 
34
34
  def component_content_view_versions
35
- self.content_view&.versions
35
+ self.content_view&.versions&.order(created_at: :desc)
36
36
  end
37
37
 
38
38
  private