katello 4.11.1 → 4.12.0.rc2

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 (311) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/katello/common/katello.global.js +1 -1
  3. data/app/assets/javascripts/katello/locale/bn/katello.js +76 -85
  4. data/app/assets/javascripts/katello/locale/bn_IN/katello.js +76 -85
  5. data/app/assets/javascripts/katello/locale/ca/katello.js +80 -86
  6. data/app/assets/javascripts/katello/locale/cs/katello.js +79 -85
  7. data/app/assets/javascripts/katello/locale/cs_CZ/katello.js +91 -88
  8. data/app/assets/javascripts/katello/locale/de/katello.js +97 -94
  9. data/app/assets/javascripts/katello/locale/de_AT/katello.js +76 -85
  10. data/app/assets/javascripts/katello/locale/de_DE/katello.js +76 -85
  11. data/app/assets/javascripts/katello/locale/el/katello.js +86 -86
  12. data/app/assets/javascripts/katello/locale/en/katello.js +76 -85
  13. data/app/assets/javascripts/katello/locale/en_GB/katello.js +88 -85
  14. data/app/assets/javascripts/katello/locale/en_US/katello.js +76 -85
  15. data/app/assets/javascripts/katello/locale/es/katello.js +94 -94
  16. data/app/assets/javascripts/katello/locale/et_EE/katello.js +76 -85
  17. data/app/assets/javascripts/katello/locale/fr/katello.js +97 -94
  18. data/app/assets/javascripts/katello/locale/gl/katello.js +80 -86
  19. data/app/assets/javascripts/katello/locale/gu/katello.js +76 -85
  20. data/app/assets/javascripts/katello/locale/he_IL/katello.js +76 -85
  21. data/app/assets/javascripts/katello/locale/hi/katello.js +76 -85
  22. data/app/assets/javascripts/katello/locale/id/katello.js +76 -85
  23. data/app/assets/javascripts/katello/locale/it/katello.js +89 -86
  24. data/app/assets/javascripts/katello/locale/ja/katello.js +97 -94
  25. data/app/assets/javascripts/katello/locale/ka/katello.js +92 -92
  26. data/app/assets/javascripts/katello/locale/kn/katello.js +76 -85
  27. data/app/assets/javascripts/katello/locale/ko/katello.js +91 -94
  28. data/app/assets/javascripts/katello/locale/locale/katello.js +1051 -1048
  29. data/app/assets/javascripts/katello/locale/ml_IN/katello.js +76 -85
  30. data/app/assets/javascripts/katello/locale/mr/katello.js +76 -85
  31. data/app/assets/javascripts/katello/locale/nl_NL/katello.js +76 -85
  32. data/app/assets/javascripts/katello/locale/or/katello.js +76 -85
  33. data/app/assets/javascripts/katello/locale/pa/katello.js +76 -85
  34. data/app/assets/javascripts/katello/locale/pl/katello.js +76 -85
  35. data/app/assets/javascripts/katello/locale/pl_PL/katello.js +76 -85
  36. data/app/assets/javascripts/katello/locale/pt/katello.js +76 -85
  37. data/app/assets/javascripts/katello/locale/pt_BR/katello.js +94 -94
  38. data/app/assets/javascripts/katello/locale/ro/katello.js +76 -85
  39. data/app/assets/javascripts/katello/locale/ro_RO/katello.js +76 -85
  40. data/app/assets/javascripts/katello/locale/ru/katello.js +91 -94
  41. data/app/assets/javascripts/katello/locale/sl/katello.js +76 -85
  42. data/app/assets/javascripts/katello/locale/sv_SE/katello.js +80 -86
  43. data/app/assets/javascripts/katello/locale/ta/katello.js +76 -85
  44. data/app/assets/javascripts/katello/locale/ta_IN/katello.js +76 -85
  45. data/app/assets/javascripts/katello/locale/te/katello.js +76 -85
  46. data/app/assets/javascripts/katello/locale/tr/katello.js +76 -85
  47. data/app/assets/javascripts/katello/locale/vi/katello.js +76 -85
  48. data/app/assets/javascripts/katello/locale/vi_VN/katello.js +76 -85
  49. data/app/assets/javascripts/katello/locale/zh/katello.js +76 -85
  50. data/app/assets/javascripts/katello/locale/zh_CN/katello.js +97 -94
  51. data/app/assets/javascripts/katello/locale/zh_TW/katello.js +91 -94
  52. data/app/assets/javascripts/katello/sync_management/index.js +0 -1
  53. data/app/assets/javascripts/katello/sync_management/sync_management.js +365 -308
  54. data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +1 -0
  55. data/app/controllers/katello/api/v2/content_views_controller.rb +1 -1
  56. data/app/controllers/katello/api/v2/debs_controller.rb +4 -0
  57. data/app/controllers/katello/api/v2/host_debs_controller.rb +13 -1
  58. data/app/controllers/katello/api/v2/host_subscriptions_controller.rb +13 -0
  59. data/app/controllers/katello/api/v2/organizations_controller.rb +1 -3
  60. data/app/controllers/katello/api/v2/repositories_controller.rb +2 -8
  61. data/app/controllers/katello/concerns/api/v2/registration_commands_controller_extensions.rb +0 -1
  62. data/app/controllers/katello/concerns/hosts_controller_extensions.rb +7 -3
  63. data/app/controllers/katello/concerns/organizations_controller_extensions.rb +1 -17
  64. data/app/helpers/katello/concerns/dashboard_helper_extensions.rb +0 -20
  65. data/app/lib/actions/katello/capsule_content/sync.rb +1 -1
  66. data/app/lib/actions/katello/content_view/promote.rb +1 -1
  67. data/app/lib/actions/katello/content_view/publish.rb +4 -4
  68. data/app/lib/actions/katello/content_view_version/auto_create_products.rb +4 -4
  69. data/app/lib/actions/katello/content_view_version/auto_create_redhat_repositories.rb +5 -5
  70. data/app/lib/actions/katello/content_view_version/auto_create_repositories.rb +5 -5
  71. data/app/lib/actions/katello/content_view_version/import.rb +14 -13
  72. data/app/lib/actions/katello/content_view_version/import_library.rb +4 -4
  73. data/app/lib/actions/katello/content_view_version/import_repository.rb +3 -3
  74. data/app/lib/actions/katello/content_view_version/reset_content_view_repositories_from_metadata.rb +2 -2
  75. data/app/lib/actions/katello/host/hypervisors_update.rb +0 -1
  76. data/app/lib/actions/katello/organization/manifest_delete.rb +1 -1
  77. data/app/lib/actions/katello/organization/manifest_refresh.rb +16 -16
  78. data/app/lib/actions/katello/repository/sync.rb +3 -5
  79. data/app/lib/actions/pulp3/orchestration/content_view_version/export.rb +20 -15
  80. data/app/lib/actions/pulp3/orchestration/content_view_version/export_library.rb +17 -14
  81. data/app/lib/actions/pulp3/orchestration/content_view_version/import.rb +11 -11
  82. data/app/lib/actions/pulp3/orchestration/repository/upload_content.rb +18 -13
  83. data/app/lib/actions/pulp3/repository/import_upload.rb +13 -5
  84. data/app/lib/actions/pulp3/repository/save_artifact.rb +23 -12
  85. data/app/lib/katello/api/v2/error_handling.rb +1 -1
  86. data/app/lib/katello/lazy_accessor.rb +6 -6
  87. data/app/lib/katello/resources/candlepin/owner.rb +2 -2
  88. data/app/mailers/katello/errata_mailer.rb +3 -3
  89. data/app/models/katello/concerns/host_managed_extensions.rb +74 -94
  90. data/app/models/katello/concerns/hostgroup_extensions.rb +9 -2
  91. data/app/models/katello/concerns/organization_extensions.rb +1 -1
  92. data/app/models/katello/concerns/pulp_database_unit.rb +1 -1
  93. data/app/models/katello/concerns/subscription_facet_host_extensions.rb +0 -27
  94. data/app/models/katello/content_view.rb +34 -47
  95. data/app/models/katello/content_view_version.rb +2 -0
  96. data/app/models/katello/deb.rb +8 -0
  97. data/app/models/katello/host/content_facet.rb +19 -14
  98. data/app/models/katello/host/subscription_facet.rb +0 -19
  99. data/app/models/katello/host_tracer.rb +9 -5
  100. data/app/models/katello/installed_deb.rb +13 -0
  101. data/app/models/katello/repository.rb +7 -2
  102. data/app/models/katello/trace_status.rb +6 -2
  103. data/app/overrides/add_organization_attributes.rb +0 -18
  104. data/app/presenters/katello/host_deb_presenter.rb +23 -0
  105. data/app/services/katello/candlepin/consumer.rb +0 -4
  106. data/app/services/katello/candlepin/event_handler.rb +6 -25
  107. data/app/services/katello/candlepin/message_handler.rb +1 -21
  108. data/app/services/katello/host/profiles_uploader.rb +17 -6
  109. data/app/services/katello/host_status_manager.rb +0 -22
  110. data/app/services/katello/organization_creator.rb +2 -2
  111. data/app/services/katello/pulp3/api/apt.rb +1 -1
  112. data/app/services/katello/pulp3/content_view_version/export.rb +2 -2
  113. data/app/services/katello/pulp3/content_view_version/metadata_generator.rb +1 -0
  114. data/app/services/katello/pulp3/content_view_version/metadata_map.rb +3 -0
  115. data/app/services/katello/pulp3/repository/apt.rb +16 -6
  116. data/app/services/katello/registration_manager.rb +1 -13
  117. data/app/views/katello/api/v2/content_views/base.json.rabl +0 -1
  118. data/app/views/katello/api/v2/content_views/show.json.rabl +1 -0
  119. data/app/views/katello/api/v2/host_debs/base.json.rabl +2 -0
  120. data/app/views/katello/api/v2/hosts/base.json.rabl +9 -0
  121. data/app/views/katello/api/v2/subscription_facet/base_with_root.json.rabl +0 -3
  122. data/app/views/katello/api/v2/subscription_facet/show.json.rabl +3 -0
  123. data/app/views/katello/sync_management/index.html.erb +14 -13
  124. data/app/views/overrides/activation_keys/_host_environment_select.html.erb +20 -16
  125. data/app/views/overrides/activation_keys/_host_synced_content_select.html.erb +7 -5
  126. data/app/views/overrides/organizations/_edit_override.html.erb +0 -12
  127. data/db/migrate/20131014225132_add_users_fields.rb +0 -1
  128. data/db/migrate/20150603045418_remove_user_fields.rb +0 -2
  129. data/db/migrate/20160404132250_remove_katello_from_notification_name.rb +4 -22
  130. data/db/migrate/20160505181337_rename_katello_settings.rb +2 -2
  131. data/db/migrate/20200818192230_update_system_purpose_status.rb +9 -3
  132. data/db/migrate/20240111032511_add_index_to_host_installed_packages.rb +16 -0
  133. data/db/migrate/20240123120109_remove_pulp_export_destination_setting.rb +9 -0
  134. data/db/migrate/20240207191223_remove_entitlement_mode_host_statuses.rb +30 -0
  135. data/db/seeds.d/111-upgrade_tasks.rb +2 -1
  136. data/engines/bastion/app/assets/javascripts/bastion/bastion.js +0 -2
  137. data/engines/bastion/app/views/bastion/layouts/assets.html.erb +6 -2
  138. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-repository-sets.controller.js +3 -1
  139. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-associations-content-hosts.html +2 -6
  140. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-details.html +0 -1
  141. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/bastion-katello-bootstrap.js +45 -29
  142. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts-helper.service.js +0 -10
  143. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-details.controller.js +0 -1
  144. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-info.html +2 -21
  145. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-subscriptions.html +0 -5
  146. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts.html +0 -7
  147. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/views/erratum-content-hosts.html +2 -2
  148. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/views/host-collection-add-hosts.html +2 -2
  149. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/views/host-collection-hosts-list.html +2 -2
  150. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/bastion_katello.pot +5 -5
  151. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +9 -1
  152. data/engines/bastion_katello/lib/bastion_katello/engine.rb +0 -6
  153. data/lib/katello/engine.rb +0 -3
  154. data/lib/katello/plugin.rb +3 -12
  155. data/lib/katello/tasks/rubocop.rake +0 -9
  156. data/lib/katello/tasks/unify_hosts.rake +0 -1
  157. data/lib/katello/tasks/upgrades/4.12/update_content_access_modes.rake +35 -0
  158. data/lib/katello/version.rb +1 -1
  159. data/locale/action_names.rb +12 -6
  160. data/locale/bn/katello.po +19 -28
  161. data/locale/bn_IN/katello.po +19 -28
  162. data/locale/ca/LC_MESSAGES/katello.mo +0 -0
  163. data/locale/ca/katello.po +20 -29
  164. data/locale/cs/katello.po +19 -29
  165. data/locale/cs_CZ/LC_MESSAGES/katello.mo +0 -0
  166. data/locale/cs_CZ/katello.po +20 -29
  167. data/locale/de/LC_MESSAGES/katello.mo +0 -0
  168. data/locale/de/katello.po +20 -29
  169. data/locale/de_AT/katello.po +19 -28
  170. data/locale/de_DE/katello.po +19 -28
  171. data/locale/el/LC_MESSAGES/katello.mo +0 -0
  172. data/locale/el/katello.po +20 -29
  173. data/locale/en/katello.po +19 -28
  174. data/locale/en_GB/LC_MESSAGES/katello.mo +0 -0
  175. data/locale/en_GB/katello.po +19 -28
  176. data/locale/en_US/katello.po +19 -28
  177. data/locale/es/LC_MESSAGES/katello.mo +0 -0
  178. data/locale/es/katello.po +20 -29
  179. data/locale/et_EE/katello.po +19 -28
  180. data/locale/fr/LC_MESSAGES/katello.mo +0 -0
  181. data/locale/fr/katello.po +20 -29
  182. data/locale/gl/LC_MESSAGES/katello.mo +0 -0
  183. data/locale/gl/katello.po +20 -29
  184. data/locale/gu/katello.po +19 -28
  185. data/locale/he_IL/katello.po +19 -28
  186. data/locale/hi/katello.po +19 -28
  187. data/locale/id/katello.po +19 -28
  188. data/locale/it/LC_MESSAGES/katello.mo +0 -0
  189. data/locale/it/katello.po +20 -29
  190. data/locale/ja/LC_MESSAGES/katello.mo +0 -0
  191. data/locale/ja/katello.po +20 -29
  192. data/locale/ka/LC_MESSAGES/katello.mo +0 -0
  193. data/locale/ka/katello.po +20 -29
  194. data/locale/katello.pot +363 -348
  195. data/locale/kn/katello.po +19 -28
  196. data/locale/ko/LC_MESSAGES/katello.mo +0 -0
  197. data/locale/ko/katello.po +20 -29
  198. data/locale/ml_IN/katello.po +19 -28
  199. data/locale/mr/katello.po +19 -28
  200. data/locale/nl_NL/katello.po +19 -28
  201. data/locale/or/katello.po +19 -28
  202. data/locale/pa/katello.po +19 -28
  203. data/locale/pl/katello.po +19 -28
  204. data/locale/pl_PL/katello.po +19 -28
  205. data/locale/pt/katello.po +19 -28
  206. data/locale/pt_BR/LC_MESSAGES/katello.mo +0 -0
  207. data/locale/pt_BR/katello.po +20 -29
  208. data/locale/ro/katello.po +19 -28
  209. data/locale/ro_RO/katello.po +19 -28
  210. data/locale/ru/LC_MESSAGES/katello.mo +0 -0
  211. data/locale/ru/katello.po +20 -29
  212. data/locale/sl/katello.po +19 -28
  213. data/locale/sv_SE/LC_MESSAGES/katello.mo +0 -0
  214. data/locale/sv_SE/katello.po +20 -29
  215. data/locale/ta/katello.po +19 -28
  216. data/locale/ta_IN/katello.po +19 -28
  217. data/locale/te/katello.po +19 -28
  218. data/locale/tr/katello.po +19 -28
  219. data/locale/vi/katello.po +19 -28
  220. data/locale/vi_VN/katello.po +19 -28
  221. data/locale/zh/katello.po +19 -28
  222. data/locale/zh_CN/LC_MESSAGES/katello.mo +0 -0
  223. data/locale/zh_CN/katello.po +20 -29
  224. data/locale/zh_TW/LC_MESSAGES/katello.mo +0 -0
  225. data/locale/zh_TW/katello.po +20 -29
  226. data/package.json +0 -1
  227. data/webpack/components/extensions/HostDetails/Tabs/ContentTab/SecondaryTabsRoutes.js +4 -0
  228. data/webpack/components/extensions/HostDetails/Tabs/ContentTab/constants.js +4 -1
  229. data/webpack/components/extensions/HostDetails/Tabs/DebsTab/DebInstallModal.js +250 -0
  230. data/webpack/components/extensions/HostDetails/Tabs/DebsTab/DebInstallModal.scss +3 -0
  231. data/webpack/components/extensions/HostDetails/Tabs/DebsTab/DebsTab.js +585 -0
  232. data/webpack/components/extensions/HostDetails/Tabs/DebsTab/DebsTab.scss +12 -0
  233. data/webpack/components/extensions/HostDetails/Tabs/DebsTab/HostDebsActions.js +13 -0
  234. data/webpack/components/extensions/HostDetails/Tabs/DebsTab/HostDebsConstants.js +13 -0
  235. data/webpack/components/extensions/HostDetails/Tabs/DebsTab/HostDebsSelectors.js +16 -0
  236. data/webpack/components/extensions/HostDetails/Tabs/DebsTab/InstallableDebsActions.js +17 -0
  237. data/webpack/components/extensions/HostDetails/Tabs/DebsTab/InstallableDebsConstants.js +3 -0
  238. data/webpack/components/extensions/HostDetails/Tabs/DebsTab/InstallableDebsSelectors.js +16 -0
  239. data/webpack/components/extensions/HostDetails/Tabs/ModuleStreamsTab/ModuleStreamsTab.js +1 -8
  240. data/webpack/components/extensions/HostDetails/Tabs/PackagesTab/PackagesTab.js +2 -0
  241. data/webpack/components/extensions/HostDetails/Tabs/RepositorySetsTab/RepositorySetsActions.js +2 -0
  242. data/webpack/components/extensions/HostDetails/Tabs/RepositorySetsTab/RepositorySetsTab.js +6 -19
  243. data/webpack/components/extensions/HostDetails/Tabs/TracesTab/TracesTab.js +13 -5
  244. data/webpack/components/extensions/HostDetails/Tabs/__tests__/debs.fixtures.json +31 -0
  245. data/webpack/components/extensions/HostDetails/Tabs/__tests__/debsInstallModal.test.js +226 -0
  246. data/webpack/components/extensions/HostDetails/Tabs/__tests__/debsTab.test.js +420 -0
  247. data/webpack/components/extensions/HostDetails/Tabs/__tests__/installableDebs.fixtures.json +63 -0
  248. data/webpack/components/extensions/HostDetails/Tabs/__tests__/repositorySetsTab.test.js +34 -5
  249. data/webpack/components/extensions/HostDetails/Tabs/__tests__/traces.fixtures.json +11 -1
  250. data/webpack/components/extensions/HostDetails/Tabs/__tests__/tracesTab.test.js +63 -3
  251. data/webpack/scenes/ContentViews/ContentViewsConstants.js +3 -0
  252. data/webpack/scenes/ContentViews/Delete/__tests__/affectedHosts.fixtures.json +0 -13
  253. data/webpack/scenes/ContentViews/Details/ContentViewDetailActions.js +23 -1
  254. data/webpack/scenes/ContentViews/Details/ContentViewDetailSelectors.js +19 -1
  255. data/webpack/scenes/ContentViews/Details/Versions/BulkDelete/__tests__/hosts.fixtures.json +0 -13
  256. data/webpack/scenes/ContentViews/Details/Versions/Compare/CVVersionCompareConfig.js +37 -3
  257. data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersionContent.js +10 -2
  258. data/webpack/scenes/ContentViews/Details/Versions/Delete/__tests__/cvAffectedHosts.fixture.json +0 -13
  259. data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionDetailConfig.js +31 -5
  260. data/webpack/scenes/Organizations/OrganizationSelectors.js +0 -3
  261. data/webpack/scenes/Subscriptions/Manifest/index.js +1 -4
  262. data/webpack/scenes/Subscriptions/SubscriptionsPage.js +3 -25
  263. data/webpack/scenes/Subscriptions/SubscriptionsSelectors.js +0 -3
  264. data/webpack/scenes/Subscriptions/__tests__/SubscriptionsSelectors.test.js +0 -3
  265. data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsPage.test.js.snap +0 -22
  266. data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsSelectors.test.js.snap +0 -3
  267. data/webpack/scenes/Subscriptions/index.js +1 -2
  268. metadata +48 -195
  269. data/app/controllers/katello/concerns/content_facet_hosts_controller_extensions.rb +0 -22
  270. data/app/models/katello/concerns/widget_extensions.rb +0 -23
  271. data/app/models/katello/purpose_addons_status.rb +0 -28
  272. data/app/models/katello/purpose_role_status.rb +0 -28
  273. data/app/models/katello/purpose_sla_status.rb +0 -28
  274. data/app/models/katello/purpose_status.rb +0 -71
  275. data/app/models/katello/purpose_usage_status.rb +0 -28
  276. data/app/models/katello/subscription_status.rb +0 -71
  277. data/app/services/katello/candlepin/system_purpose.rb +0 -49
  278. data/app/views/dashboard/_subscription_status_widget.html.erb +0 -37
  279. data/app/views/dashboard/_subscription_widget.html.erb +0 -85
  280. data/app/views/overrides/organizations/_index_header_override.html.erb +0 -3
  281. data/app/views/overrides/organizations/_index_row_override.html.erb +0 -3
  282. data/app/views/overrides/organizations/_step_1_override.html.erb +0 -10
  283. data/config/locales/README +0 -10
  284. data/config/locales/bn.yml +0 -182
  285. data/config/locales/compare_upstream.sh +0 -21
  286. data/config/locales/cs.yml +0 -211
  287. data/config/locales/de.yml +0 -203
  288. data/config/locales/en.yml +0 -205
  289. data/config/locales/es.yml +0 -199
  290. data/config/locales/fr.yml +0 -222
  291. data/config/locales/gu.yml +0 -181
  292. data/config/locales/hi.yml +0 -199
  293. data/config/locales/it.yml +0 -205
  294. data/config/locales/ja.yml +0 -197
  295. data/config/locales/kn.yml +0 -199
  296. data/config/locales/ko.yml +0 -197
  297. data/config/locales/mr.yml +0 -178
  298. data/config/locales/or.yml +0 -181
  299. data/config/locales/pa.yml +0 -181
  300. data/config/locales/pt-BR.yml +0 -207
  301. data/config/locales/pt.yml +0 -207
  302. data/config/locales/ru.yml +0 -257
  303. data/config/locales/ta.yml +0 -181
  304. data/config/locales/te.yml +0 -181
  305. data/config/locales/update.sh +0 -14
  306. data/config/locales/zh-CN.yml +0 -199
  307. data/config/locales/zh-TW.yml +0 -199
  308. data/engines/bastion/app/assets/javascripts/bastion/bastion-bootstrap.js +0 -17
  309. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/content-access-mode-banner.directive.js +0 -22
  310. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/content-access-mode-banner.html +0 -10
  311. data/webpack/scenes/Subscriptions/Manifest/SimpleContentAccess.js +0 -96
@@ -260,6 +260,7 @@ module Katello
260
260
  User.current = User.anonymous_admin
261
261
  @host.update_candlepin_associations(rhsm_params)
262
262
  update_host_registered_through(@host, request.headers)
263
+ @host.refresh_statuses([::Katello::RhelLifecycleStatus])
263
264
  render :json => {:content => _("Facts successfully updated.")}, :status => :ok
264
265
  end
265
266
 
@@ -59,7 +59,7 @@ module Katello
59
59
  param_group :search, Api::V2::ApiController
60
60
  add_scoped_search_description_for(ContentView)
61
61
  def index
62
- content_view_includes = [:activation_keys, :content_view_versions,
62
+ content_view_includes = [:activation_keys, :content_view_versions, :content_view_components,
63
63
  :environments, :organization, :repositories]
64
64
  respond(:collection => scoped_search(index_relation.distinct, :name, :asc, :includes => content_view_includes))
65
65
  end
@@ -88,9 +88,13 @@ module Katello
88
88
  def custom_index_relation(collection)
89
89
  applicable = ::Foreman::Cast.to_bool(params[:packages_restrict_applicable]) || params[:host_id]
90
90
  upgradable = ::Foreman::Cast.to_bool(params[:packages_restrict_upgradable])
91
+ not_installed = ::Foreman::Cast.to_bool(params[:packages_restrict_not_installed])
91
92
 
92
93
  if upgradable
93
94
  collection = collection.installable_for_hosts(@hosts)
95
+ elsif not_installed && params[:host_id]
96
+ host = @hosts.first
97
+ collection = Katello::Deb.apt_installable_for_host(host)
94
98
  elsif applicable
95
99
  collection = collection.applicable_to_hosts(@hosts)
96
100
  end
@@ -11,14 +11,26 @@ module Katello
11
11
 
12
12
  api :GET, "/hosts/:host_id/debs", N_("List deb packages installed on the host")
13
13
  param :host_id, :number, :required => true, :desc => N_("ID of the host")
14
+ param :include_latest_upgradable, :boolean, :desc => N_("Also include the latest upgradable package version for each host package")
15
+ param :status, String, :desc => N_("Return only packages of a particular status (upgradable or up-to-date)"), :required => false
14
16
  param_group :search, Api::V2::ApiController
17
+ add_scoped_search_description_for(Katello::InstalledDeb)
15
18
  def index
16
19
  collection = scoped_search(index_relation, :name, :asc, :resource_class => ::Katello::InstalledDeb)
20
+ collection[:results] = HostDebPresenter.with_latest(collection[:results], @host) if ::Foreman::Cast.to_bool(params[:include_latest_upgradable])
17
21
  respond_for_index(:collection => collection)
18
22
  end
19
23
 
20
24
  def index_relation
21
- @host.installed_debs
25
+ packages = @host.installed_debs
26
+ upgradable_packages = ::Katello::Deb.installable_for_hosts([@host]).select(:name)
27
+ if params[:status].present?
28
+ packages = case params[:status]
29
+ when 'up-to-date' then packages.where.not(name: upgradable_packages)
30
+ when 'upgradable' then packages.where(name: upgradable_packages)
31
+ end
32
+ end
33
+ packages
22
34
  end
23
35
 
24
36
  def resource_class
@@ -170,6 +170,7 @@ module Katello
170
170
  param :content_overrides_search, Hash, :desc => N_("Content override search parameters") do
171
171
  param_group :search, Api::V2::ApiController
172
172
  param :enabled, :bool, :desc => N_("Set true to override to enabled; Set false to override to disabled.'"), :required => false
173
+ param :limit_to_env, :bool, :desc => N_("Limit actions to content in the host's environment."), :required => false
173
174
  param :remove, :bool, :desc => N_("Set true to remove an override and reset it to 'default'"), :required => false
174
175
  end
175
176
  def content_override
@@ -232,10 +233,22 @@ module Katello
232
233
 
233
234
  def find_content_overrides
234
235
  if !params.dig(:content_overrides_search, :search).nil?
236
+
235
237
  content_labels = ::Katello::Content.joins(:product_contents)
236
238
  .where("#{Katello::ProductContent.table_name}.product_id": @host.organization.products.subscribable.enabled)
237
239
  .search_for(params[:content_overrides_search][:search])
238
240
  .pluck(:label)
241
+
242
+ if Foreman::Cast.to_bool(params.dig(:content_overrides_search, :limit_to_env))
243
+ env_content = ProductContentFinder.new(
244
+ :match_subscription => false,
245
+ :match_environment => true,
246
+ :consumable => @host.subscription_facet
247
+ ).product_content
248
+ env_content_labels = ::Katello::Content.find(env_content.pluck(:content_id)).pluck(:label)
249
+ content_labels &= env_content_labels
250
+ end
251
+
239
252
  @content_overrides = content_labels.map do |label|
240
253
  { content_label: label,
241
254
  value: Foreman::Cast.to_bool(params[:content_overrides_search][:enabled]),
@@ -80,11 +80,9 @@ module Katello
80
80
  param :organization, Hash do
81
81
  param :label, String, :required => false
82
82
  end
83
- param :simple_content_access, :bool, :desc => N_('Whether to turn on Simple Content Access for the organization.'), :required => false, :default => true, deprecated: true
84
83
  def create
85
84
  @organization = Organization.new(resource_params)
86
- sca = params.key?(:simple_content_access) ? ::Foreman::Cast.to_bool(params[:simple_content_access]) : true
87
- creator = ::Katello::OrganizationCreator.new(@organization, sca: sca)
85
+ creator = ::Katello::OrganizationCreator.new(@organization)
88
86
  creator.create!
89
87
  @organization.reload
90
88
  # @taxonomy instance variable is necessary for foreman side
@@ -343,7 +343,6 @@ Alternatively, use the 'force' parameter to regenerate metadata locally. On the
343
343
 
344
344
  api :POST, "/repositories/:id/sync", N_("Sync a repository")
345
345
  param :id, :number, :required => true, :desc => N_("repository ID")
346
- param :source_url, String, :desc => N_("temporarily override feed URL for sync"), :required => false
347
346
  param :incremental, :bool, :desc => N_("perform an incremental import"), :required => false
348
347
  param :skip_metadata_check, :bool, :desc => N_("Force sync even if no upstream changes are detected. Only used with yum or deb repositories."), :required => false
349
348
  param :validate_contents, :bool, :desc => N_("Force a sync and validate the checksums of all content. Only used with yum repositories."), :required => false
@@ -352,15 +351,10 @@ Alternatively, use the 'force' parameter to regenerate metadata locally. On the
352
351
  sync_options = {
353
352
  :skip_metadata_check => ::Foreman::Cast.to_bool(params[:skip_metadata_check]),
354
353
  :validate_contents => ::Foreman::Cast.to_bool(params[:validate_contents]),
355
- :incremental => ::Foreman::Cast.to_bool(params[:incremental]),
356
- :source_url => params[:source_url]
354
+ :incremental => ::Foreman::Cast.to_bool(params[:incremental])
357
355
  }
358
356
 
359
- if params[:source_url].present? && params[:source_url] !~ /\A#{URI::DEFAULT_PARSER.make_regexp}\z/
360
- fail HttpErrors::BadRequest, _("source URL is malformed")
361
- end
362
-
363
- if params[:source_url].blank? && @repository.url.blank?
357
+ if @repository.url.blank?
364
358
  fail HttpErrors::BadRequest, _("attempted to sync without a feed URL")
365
359
  end
366
360
 
@@ -29,7 +29,6 @@ module Katello
29
29
  param :registration_command, Hash do
30
30
  param :activation_key, String, desc: N_('Activation key for subscription-manager client, required for CentOS and Red Hat Enterprise Linux. For multiple keys use `activation_keys` param instead.'), deprecated: true
31
31
  param :activation_keys, Array, desc: N_('Activation keys for subscription-manager client, required for CentOS and Red Hat Enterprise Linux. Required only if host group has no activation keys.')
32
- param :lifecycle_environment_id, :number, required: false, desc: N_('Lifecycle environment for the host.')
33
32
  param :force, :bool, required: false, desc: N_('Clear any previous registration and run subscription-manager with --force.')
34
33
  param :ignore_subman_errors, :bool, required: false, desc: N_('Ignore subscription-manager errors for `subscription-manager register` command')
35
34
  end
@@ -20,6 +20,10 @@ module Katello
20
20
  included do
21
21
  prepend Overrides
22
22
 
23
+ def included_associations(include = [])
24
+ [:host_traces] + super
25
+ end
26
+
23
27
  def update_multiple_taxonomies(type)
24
28
  if type == :organization
25
29
  new_org_id = params.dig(type, 'id')
@@ -59,11 +63,11 @@ module Katello
59
63
  .preload(:subscription_facet, :host_statuses, :operatingsystem,
60
64
  :applicable_rpms, :content_view_environments)
61
65
  csv_response(@hosts,
62
- [:name, :subscription_status_label, 'content_facet.installable_security_errata_count',
66
+ [:name, 'content_facet.installable_security_errata_count',
63
67
  'content_facet.installable_bugfix_errata_count', 'content_facet.installable_enhancement_errata_count',
64
68
  'content_facet.upgradable_rpm_count', :operatingsystem, :content_view_environment_names,
65
69
  'subscription_facet.registered_at', 'subscription_facet.last_checkin'],
66
- ['Name', 'Subscription Status', 'Installable Updates - Security',
70
+ ['Name', 'Installable Updates - Security',
67
71
  'Installable Updates - Bug Fixes', 'Installable Updates - Enhancements',
68
72
  'Installable Updates - Package Count', 'OS', 'Content View Environments',
69
73
  'Registered', 'Last Checkin'])
@@ -91,7 +95,7 @@ module Katello
91
95
  .distinct
92
96
 
93
97
  if Katello.with_remote_execution?
94
- template_id = JobTemplate.find_by(name: 'Configure host for new content source')&.id
98
+ template_id = RemoteExecutionFeature.feature!(:katello_change_content_source).job_template_id
95
99
  job_invocation_path = new_job_invocation_path(template_id: template_id, host_ids: content_hosts.map { |h| h[:id] }) if template_id
96
100
  end
97
101
 
@@ -24,9 +24,7 @@ module Katello
24
24
  if taxonomy_class == Organization
25
25
  begin
26
26
  @taxonomy = Organization.new(resource_params)
27
- sca = ::Foreman::Cast.to_bool(params[:simple_content_access])
28
- ::Foreman::Deprecation.api_deprecation_warning(N_("Simple Content Access will be required for all organizations in Katello 4.12."))
29
- ::Katello::OrganizationCreator.new(@taxonomy, sca: sca).create!
27
+ ::Katello::OrganizationCreator.new(@taxonomy).create!
30
28
  @taxonomy.reload
31
29
  switch_taxonomy
32
30
  if @count_nil_hosts > 0
@@ -45,20 +43,6 @@ module Katello
45
43
  end
46
44
  end
47
45
 
48
- def update
49
- return if params[:simple_content_access].nil?
50
- sca_param = ::Foreman::Cast.to_bool(params[:simple_content_access])
51
- ::Foreman::Deprecation.api_deprecation_warning("Simple Content Access will be required for all organizations in Katello 4.12.")
52
- if sca_param && !@taxonomy.simple_content_access?(cached: false)
53
- # user has requested SCA enable
54
- sync_task(::Actions::Katello::Organization::SimpleContentAccess::Enable, params[:id])
55
- elsif !sca_param && @taxonomy.simple_content_access?(cached: false)
56
- # user has requested SCA disable
57
- sync_task(::Actions::Katello::Organization::SimpleContentAccess::Disable, params[:id])
58
- end
59
- super
60
- end
61
-
62
46
  included do
63
47
  prepend Overrides
64
48
  end
@@ -9,26 +9,6 @@ module Katello
9
9
  host_query.size
10
10
  end
11
11
 
12
- def partial_consumer_count
13
- host_query.search_for("subscription_status = partial").size
14
- end
15
-
16
- def valid_consumer_count
17
- host_query.search_for("subscription_status = valid").size
18
- end
19
-
20
- def invalid_consumer_count
21
- host_query.search_for("subscription_status = invalid").size
22
- end
23
-
24
- def unknown_consumer_count
25
- host_query.search_for("subscription_status = unknown or (null? subscription_uuid)").size
26
- end
27
-
28
- def unsubscribed_hypervisor_count
29
- host_query.search_for("subscription_status = unsubscribed_hypervisor").size
30
- end
31
-
32
12
  def removed_widgets
33
13
  widgets = super
34
14
 
@@ -52,7 +52,7 @@ module Actions
52
52
  notification = MailNotification[:proxy_sync_failure]
53
53
  proxy = SmartProxy.find(input.fetch(:smart_proxy, {})[:id])
54
54
  subjects = subjects(input[:options]).merge(smart_proxy: proxy)
55
- notification.users.where(disabled: [nil, false], mail_enabled: true).each do |user|
55
+ notification.users.with_enabled_email.each do |user|
56
56
  notification.deliver(subjects.merge(user: user, task: task))
57
57
  end
58
58
  end
@@ -27,7 +27,7 @@ module Actions
27
27
  def notify_on_failure(_plan)
28
28
  notification = MailNotification[:content_view_promote_failure]
29
29
  view = ::Katello::ContentView.find(input.fetch(:content_view, {})[:id])
30
- notification.users.where(disabled: [nil, false], mail_enabled: true).each do |user|
30
+ notification.users.with_enabled_email.each do |user|
31
31
  notification.deliver(user: user, content_view: view, task: task)
32
32
  end
33
33
  end
@@ -13,7 +13,7 @@ module Actions
13
13
  def plan(content_view, description = "", options = {importing: false, syncable: false}) # rubocop:disable Metrics/PerceivedComplexity
14
14
  action_subject(content_view)
15
15
 
16
- content_view.check_ready_to_publish!(options.slice(:importing, :syncable))
16
+ content_view.check_ready_to_publish!(**options.slice(:importing, :syncable))
17
17
  unless options[:importing] || options[:syncable]
18
18
  ::Katello::Util::CandlepinRepositoryChecker.check_repositories_for_publish!(content_view)
19
19
  end
@@ -57,7 +57,7 @@ module Actions
57
57
  separated_repo_map = separated_repo_mapping(repository_mapping, content_view.solve_dependencies)
58
58
 
59
59
  if options[:importing]
60
- handle_import(version, options.slice(:path, :metadata))
60
+ handle_import(version, **options.slice(:path, :metadata))
61
61
  elsif separated_repo_map[:pulp3_yum_multicopy].keys.flatten.present?
62
62
  plan_action(Repository::MultiCloneToVersion, separated_repo_map[:pulp3_yum_multicopy], version)
63
63
  end
@@ -136,7 +136,7 @@ module Actions
136
136
  def notify_on_failure(_plan)
137
137
  notification = MailNotification[:content_view_publish_failure]
138
138
  view = ::Katello::ContentView.find(input.fetch(:content_view, {})[:id])
139
- notification.users.where(disabled: [nil, false], mail_enabled: true).each do |user|
139
+ notification.users.with_enabled_email.each do |user|
140
140
  notification.deliver(user: user, content_view: view, task: task)
141
141
  end
142
142
  end
@@ -203,7 +203,7 @@ module Actions
203
203
 
204
204
  def handle_import(version, path:, metadata:)
205
205
  sequence do
206
- plan_action(::Actions::Pulp3::Orchestration::ContentViewVersion::Import, version, path: path, metadata: metadata)
206
+ plan_action(::Actions::Pulp3::Orchestration::ContentViewVersion::Import, version, { path: path, metadata: metadata })
207
207
  concurrence do
208
208
  version.importable_repositories.pluck(:id).each do |id|
209
209
  # need to force full_indexing for these version repositories
@@ -2,14 +2,14 @@ module Actions
2
2
  module Katello
3
3
  module ContentViewVersion
4
4
  class AutoCreateProducts < Actions::Base
5
- def plan(import:)
5
+ def plan(opts = {})
6
6
  helper = ::Katello::Pulp3::ContentViewVersion::ImportableProducts.
7
- new(organization: import.organization,
8
- metadata_products: import.metadata_map.products)
7
+ new(organization: opts[:import].organization,
8
+ metadata_products: opts[:import].metadata_map.products)
9
9
  helper.generate!
10
10
  concurrence do
11
11
  helper.creatable.each do |product|
12
- plan_action(::Actions::Katello::Product::Create, product[:product], import.organization)
12
+ plan_action(::Actions::Katello::Product::Create, product[:product], opts[:import].organization)
13
13
  end
14
14
  helper.updatable.each do |product|
15
15
  plan_action(::Actions::Katello::Product::Update, product[:product], product[:options])
@@ -2,12 +2,12 @@ module Actions
2
2
  module Katello
3
3
  module ContentViewVersion
4
4
  class AutoCreateRedhatRepositories < Actions::Base
5
- def plan(import:, path:)
5
+ def plan(opts = {})
6
6
  helper = ::Katello::Pulp3::ContentViewVersion::ImportableRepositories.new(
7
- organization: import.organization,
8
- metadata_repositories: import.metadata_map.repositories.select { |r| r.redhat },
9
- syncable_format: import.metadata_map.syncable_format?,
10
- path: path
7
+ organization: opts[:import].organization,
8
+ metadata_repositories: opts[:import].metadata_map.repositories.select { |r| r.redhat },
9
+ syncable_format: opts[:import].metadata_map.syncable_format?,
10
+ path: opts[:path]
11
11
  )
12
12
  helper.generate!
13
13
 
@@ -2,12 +2,12 @@ module Actions
2
2
  module Katello
3
3
  module ContentViewVersion
4
4
  class AutoCreateRepositories < Actions::Base
5
- def plan(import:, path:)
5
+ def plan(opts = {})
6
6
  helper = ::Katello::Pulp3::ContentViewVersion::ImportableRepositories.new(
7
- organization: import.organization,
8
- metadata_repositories: import.metadata_map.repositories.select { |r| !r.redhat },
9
- syncable_format: import.metadata_map.syncable_format?,
10
- path: path
7
+ organization: opts[:import].organization,
8
+ metadata_repositories: opts[:import].metadata_map.repositories.select { |r| !r.redhat },
9
+ syncable_format: opts[:import].metadata_map.syncable_format?,
10
+ path: opts[:path]
11
11
  )
12
12
  helper.generate!
13
13
 
@@ -2,45 +2,46 @@ module Actions
2
2
  module Katello
3
3
  module ContentViewVersion
4
4
  class Import < Actions::EntryAction
5
- def plan(organization:, path:, metadata:)
6
- metadata_map = ::Katello::Pulp3::ContentViewVersion::MetadataMap.new(metadata: metadata)
5
+ def plan(opts = {})
6
+ metadata_map = ::Katello::Pulp3::ContentViewVersion::MetadataMap.new(metadata: opts[:metadata])
7
7
 
8
8
  import = ::Katello::Pulp3::ContentViewVersion::Import.new(
9
- organization: organization,
9
+ organization: opts[:organization],
10
10
  metadata_map: metadata_map,
11
- path: path,
11
+ path: opts[:path],
12
12
  smart_proxy: SmartProxy.pulp_primary!
13
13
  )
14
14
 
15
15
  import.check!
16
16
 
17
17
  gpg_helper = ::Katello::Pulp3::ContentViewVersion::ImportGpgKeys.
18
- new(organization: organization,
18
+ new(organization: opts[:organization],
19
19
  metadata_gpg_keys: metadata_map.gpg_keys)
20
20
  gpg_helper.import!
21
21
 
22
22
  sequence do
23
- plan_action(AutoCreateProducts, import: import)
24
- plan_action(AutoCreateRepositories, import: import, path: path)
25
- plan_action(AutoCreateRedhatRepositories, import: import, path: path)
23
+ plan_action(AutoCreateProducts, { import: import })
24
+ plan_action(AutoCreateRepositories, { import: import, path: opts[:path] })
25
+ plan_action(AutoCreateRedhatRepositories, { import: import, path: opts[:path] })
26
26
 
27
27
  if metadata_map.syncable_format?
28
28
  plan_action(::Actions::BulkAction,
29
29
  ::Actions::Katello::Repository::Sync,
30
30
  import.intersecting_repos_library_and_metadata.exportable(format: metadata_map.format),
31
- skip_candlepin_check: true
31
+ { skip_candlepin_check: true }
32
32
  )
33
33
  end
34
34
 
35
35
  if import.content_view
36
- plan_action(ResetContentViewRepositoriesFromMetadata, import: import)
36
+ plan_action(ResetContentViewRepositoriesFromMetadata, { import: import })
37
37
  plan_action(::Actions::Katello::ContentView::Publish, import.content_view, metadata_map.content_view_version.description,
38
- path: path,
39
- metadata: metadata,
38
+ { path: opts[:path],
39
+ metadata: opts[:metadata],
40
40
  importing: !metadata_map.syncable_format?,
41
41
  syncable: metadata_map.syncable_format?,
42
42
  major: metadata_map.content_view_version.major,
43
- minor: metadata_map.content_view_version.minor)
43
+ minor: metadata_map.content_view_version.minor
44
+ })
44
45
  plan_self(content_view_id: import.content_view.id)
45
46
  end
46
47
  end
@@ -2,11 +2,11 @@ module Actions
2
2
  module Katello
3
3
  module ContentViewVersion
4
4
  class ImportLibrary < Actions::EntryAction
5
- def plan(organization, path:, metadata:)
5
+ def plan(organization, opts = {})
6
6
  action_subject(organization)
7
- plan_action(::Actions::Katello::ContentViewVersion::Import, organization: organization,
8
- path: path,
9
- metadata: metadata)
7
+ plan_action(::Actions::Katello::ContentViewVersion::Import, { organization: organization,
8
+ path: opts[:path],
9
+ metadata: opts[:metadata] })
10
10
  end
11
11
 
12
12
  def humanized_name
@@ -2,13 +2,13 @@ module Actions
2
2
  module Katello
3
3
  module ContentViewVersion
4
4
  class ImportRepository < Actions::EntryAction
5
- def plan(organization, path:, metadata:)
5
+ def plan(organization, opts = {})
6
6
  action_subject(organization)
7
7
  sequence do
8
8
  plan_action(::Actions::Katello::ContentViewVersion::Import,
9
9
  organization: organization,
10
- path: path,
11
- metadata: metadata)
10
+ path: opts[:path],
11
+ metadata: opts[:metadata])
12
12
  end
13
13
  end
14
14
 
@@ -2,8 +2,8 @@ module Actions
2
2
  module Katello
3
3
  module ContentViewVersion
4
4
  class ResetContentViewRepositoriesFromMetadata < Actions::Base
5
- def plan(import:)
6
- import.reset_content_view_repositories!
5
+ def plan(opts = {})
6
+ opts[:import].reset_content_view_repositories!
7
7
  end
8
8
  end
9
9
  end
@@ -170,7 +170,6 @@ module Actions
170
170
  host.subscription_facet.candlepin_consumer.consumer_attributes = @candlepin_attributes[uuid]
171
171
  host.subscription_facet.import_database_attributes
172
172
  host.subscription_facet.save!
173
- host.subscription_facet.update_subscription_status(@candlepin_attributes[uuid].try(:[], :entitlementStatus))
174
173
  end
175
174
  end
176
175
 
@@ -10,7 +10,7 @@ module Actions
10
10
  action_subject(organization)
11
11
 
12
12
  sequence do
13
- plan_action(Candlepin::Owner::DestroyImports, label: organization.label)
13
+ plan_action(Candlepin::Owner::DestroyImports, { label: organization.label })
14
14
 
15
15
  repositories = ::Katello::Repository.in_default_view.in_product(::Katello::Product.redhat.in_org(organization))
16
16
  repositories.each do |repo|
@@ -19,26 +19,26 @@ module Actions
19
19
  :organization_name => organization.name
20
20
  )
21
21
  upstream_update = plan_action(Candlepin::Owner::UpstreamUpdate,
22
- :organization_id => organization.id,
23
- :upstream => upstream)
22
+ { :organization_id => organization.id,
23
+ :upstream => upstream })
24
24
  export_action = plan_action(Candlepin::Owner::StartUpstreamExport,
25
- :organization_id => organization.id,
26
- :upstream => upstream,
27
- :path => path,
28
- :dependency => upstream_update.output)
25
+ { :organization_id => organization.id,
26
+ :upstream => upstream,
27
+ :path => path,
28
+ :dependency => upstream_update.output })
29
29
  retrieved_export = plan_action(Candlepin::Owner::RetrieveUpstreamExport,
30
- :export_id => export_action.output[:task]['resultData']['exportId'],
31
- :organization_id => organization.id,
32
- :upstream => upstream,
33
- :path => path,
34
- :dependency => export_action.output)
30
+ { :export_id => export_action.output[:task]['resultData']['exportId'],
31
+ :organization_id => organization.id,
32
+ :upstream => upstream,
33
+ :path => path,
34
+ :dependency => export_action.output })
35
35
  owner_import = plan_action(Candlepin::Owner::Import,
36
- :label => organization.label,
37
- :path => path,
38
- :dependency => retrieved_export.output)
36
+ { :label => organization.label,
37
+ :path => path,
38
+ :dependency => retrieved_export.output })
39
39
  import_products = plan_action(Candlepin::Owner::ImportProducts,
40
- :organization_id => organization.id,
41
- :dependency => owner_import.output)
40
+ { :organization_id => organization.id,
41
+ :dependency => owner_import.output })
42
42
  plan_action(Katello::Organization::EnvironmentContentsRefresh,
43
43
  organization)
44
44
  if manifest_update
@@ -21,13 +21,11 @@ module Actions
21
21
  def plan(repo, options = {})
22
22
  action_subject(repo)
23
23
 
24
- source_url = options.fetch(:source_url, nil)
25
24
  validate_contents = options.fetch(:validate_contents, false)
26
25
  skip_metadata_check = options.fetch(:skip_metadata_check, false) || (validate_contents && (repo.yum? || repo.deb?))
27
26
  generate_applicability = options.fetch(:generate_applicability, repo.yum? || repo.deb?)
28
27
 
29
28
  validate_repo!(repo: repo,
30
- source_url: source_url,
31
29
  skip_metadata_check: skip_metadata_check,
32
30
  skip_candlepin_check: options.fetch(:skip_candlepin_check, false))
33
31
 
@@ -82,8 +80,8 @@ module Actions
82
80
  end
83
81
  end
84
82
 
85
- def validate_repo!(repo:, source_url:, skip_metadata_check:, skip_candlepin_check:)
86
- fail ::Katello::Errors::InvalidActionOptionError, _("Unable to sync repo. This repository does not have a feed url.") if repo.url.blank? && source_url.blank?
83
+ def validate_repo!(repo:, skip_metadata_check:, skip_candlepin_check:)
84
+ fail ::Katello::Errors::InvalidActionOptionError, _("Unable to sync repo. This repository does not have a feed url.") if repo.url.blank?
87
85
  fail ::Katello::Errors::InvalidActionOptionError, _("Cannot skip metadata check on non-yum/deb repositories.") if skip_metadata_check && !repo.yum? && !repo.deb?
88
86
  fail ::Katello::Errors::InvalidActionOptionError, _("Unable to sync repo. This repository is not a library instance repository.") unless repo.library_instance?
89
87
  ::Katello::Util::CandlepinRepositoryChecker.check_repository_for_sync!(repo) if repo.yum? && !skip_candlepin_check
@@ -102,7 +100,7 @@ module Actions
102
100
  def notify_on_failure(_plan)
103
101
  notification = MailNotification[:repository_sync_failure]
104
102
  repo = ::Katello::Repository.find(input.fetch(:repository, {})[:id])
105
- notification.users.where(disabled: [nil, false], mail_enabled: true).each do |user|
103
+ notification.users.with_enabled_email.each do |user|
106
104
  notification.deliver(user: user, repo: repo, task: task)
107
105
  end
108
106
  end
@@ -18,30 +18,35 @@ module Actions
18
18
  param :export_path, String
19
19
  end
20
20
 
21
- def plan(content_view_version:, destination_server: nil,
22
- chunk_size: nil, from_history: nil,
23
- validate_incremental: true,
24
- fail_on_missing_content: false,
25
- format: ::Katello::Pulp3::ContentViewVersion::Export::IMPORTABLE)
21
+ def plan(opts = {})
22
+ options = {
23
+ content_view_version: nil, destination_server: nil,
24
+ chunk_size: nil, from_history: nil,
25
+ validate_incremental: true,
26
+ fail_on_missing_content: false,
27
+ format: ::Katello::Pulp3::ContentViewVersion::Export::IMPORTABLE
28
+ }.merge(opts)
29
+ content_view_version = options[:content_view_version]
30
+ format = options[:format]
26
31
  smart_proxy = SmartProxy.pulp_primary!
27
- from_content_view_version = from_history&.content_view_version
32
+ from_content_view_version = options[:from_history]&.content_view_version
28
33
  export_service = ::Katello::Pulp3::ContentViewVersion::Export.create(
29
34
  smart_proxy: smart_proxy,
30
35
  content_view_version: content_view_version,
31
- destination_server: destination_server,
36
+ destination_server: options[:destination_server],
32
37
  from_content_view_version: from_content_view_version,
33
38
  format: format)
34
- export_service.validate!(fail_on_missing_content: fail_on_missing_content,
35
- validate_incremental: validate_incremental,
36
- chunk_size: chunk_size)
39
+ export_service.validate!(fail_on_missing_content: options[:fail_on_missing_content],
40
+ validate_incremental: options[:validate_incremental],
41
+ chunk_size: options[:chunk_size])
37
42
 
38
43
  if format == ::Katello::Pulp3::ContentViewVersion::Export::SYNCABLE
39
44
  sequence do
40
45
  export_output = plan_action(SyncableExport,
41
46
  content_view_version: content_view_version,
42
- from_content_view_version: from_history&.content_view_version,
47
+ from_content_view_version: options[:from_history]&.content_view_version,
43
48
  smart_proxy: smart_proxy,
44
- destination_server: destination_server).output
49
+ destination_server: options[:destination_server]).output
45
50
  plan_self(export_history_id: export_output[:export_history_id],
46
51
  export_path: export_output[:export_path])
47
52
  end
@@ -52,14 +57,14 @@ module Actions
52
57
  action_output = plan_action(::Actions::Pulp3::ContentViewVersion::CreateExporter,
53
58
  content_view_version_id: content_view_version.id,
54
59
  smart_proxy_id: smart_proxy.id,
55
- destination_server: destination_server,
60
+ destination_server: options[:destination_server],
56
61
  format: format).output
57
62
 
58
63
  plan_action(::Actions::Pulp3::ContentViewVersion::Export,
59
64
  content_view_version_id: content_view_version.id,
60
65
  smart_proxy_id: smart_proxy.id,
61
66
  exporter_data: action_output[:exporter_data],
62
- chunk_size: chunk_size,
67
+ chunk_size: options[:chunk_size],
63
68
  from_content_view_version_id: from_content_view_version&.id,
64
69
  format: format)
65
70
 
@@ -70,7 +75,7 @@ module Actions
70
75
  pulp_href: action_output[:exporter_data][:pulp_href],
71
76
  content_view_version_id: content_view_version.id,
72
77
  from_content_view_version_id: from_content_view_version&.id,
73
- destination_server: destination_server,
78
+ destination_server: options[:destination_server],
74
79
  format: format
75
80
  ).output
76
81