katello 4.7.6 → 4.8.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 (365) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/katello/api/registry/registry_proxies_controller.rb +6 -4
  3. data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +15 -12
  4. data/app/controllers/katello/api/v2/capsule_content_controller.rb +0 -4
  5. data/app/controllers/katello/api/v2/content_export_incrementals_controller.rb +22 -81
  6. data/app/controllers/katello/api/v2/content_exports_controller.rb +11 -80
  7. data/app/controllers/katello/api/v2/content_imports_controller.rb +1 -0
  8. data/app/controllers/katello/api/v2/exports_controller.rb +130 -0
  9. data/app/controllers/katello/api/v2/host_subscriptions_controller.rb +7 -8
  10. data/app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb +8 -4
  11. data/app/controllers/katello/api/v2/organizations_controller.rb +3 -0
  12. data/app/controllers/katello/api/v2/package_groups_controller.rb +0 -52
  13. data/app/controllers/katello/api/v2/simple_content_access_controller.rb +1 -3
  14. data/app/controllers/katello/concerns/api/v2/bulk_hosts_extensions.rb +4 -6
  15. data/app/controllers/katello/concerns/api/v2/registration_controller_extensions.rb +1 -2
  16. data/app/controllers/katello/concerns/authorization/api/v2/content_views_controller.rb +4 -1
  17. data/app/controllers/katello/concerns/content_facet_hosts_controller_extensions.rb +24 -0
  18. data/app/controllers/katello/concerns/hosts_controller_extensions.rb +3 -3
  19. data/app/helpers/katello/hosts_and_hostgroups_helper.rb +55 -24
  20. data/app/helpers/katello/katello_urls_helper.rb +0 -15
  21. data/app/helpers/katello/sync_management_helper.rb +0 -4
  22. data/app/lib/actions/candlepin/owner/destroy_imports.rb +1 -1
  23. data/app/lib/actions/katello/capsule_content/sync.rb +0 -4
  24. data/app/lib/actions/katello/capsule_content/sync_capsule.rb +1 -2
  25. data/app/lib/actions/katello/content_view/publish.rb +6 -2
  26. data/app/lib/actions/katello/content_view/remove.rb +8 -2
  27. data/app/lib/actions/katello/content_view_version/destroy.rb +1 -1
  28. data/app/lib/actions/katello/environment/destroy.rb +8 -2
  29. data/app/lib/actions/katello/host/reassign.rb +4 -2
  30. data/app/lib/actions/katello/organization/simple_content_access/enable.rb +0 -10
  31. data/app/lib/actions/katello/organization/simple_content_access/toggle.rb +2 -12
  32. data/app/lib/actions/katello/orphan_cleanup/remove_orphans.rb +0 -1
  33. data/app/lib/actions/katello/product/destroy.rb +2 -1
  34. data/app/lib/actions/katello/repository/filtered_index_content.rb +2 -10
  35. data/app/lib/actions/katello/repository/import_upload.rb +0 -1
  36. data/app/lib/actions/katello/repository/sync.rb +0 -1
  37. data/app/lib/actions/katello/repository/update.rb +5 -3
  38. data/app/lib/actions/katello/repository/upload_files.rb +0 -1
  39. data/app/lib/actions/pulp3/abstract.rb +0 -6
  40. data/app/lib/actions/pulp3/content_view/delete_repository_references.rb +1 -2
  41. data/app/lib/actions/pulp3/content_view_version/create_syncable_export_history.rb +4 -0
  42. data/app/lib/actions/pulp3/orchestration/content_view_version/export.rb +1 -0
  43. data/app/lib/actions/pulp3/orchestration/content_view_version/export_repository.rb +7 -2
  44. data/app/lib/actions/pulp3/orchestration/content_view_version/syncable_export.rb +7 -2
  45. data/app/lib/actions/pulp3/repository/refresh_distribution.rb +1 -2
  46. data/app/lib/actions/pulp3/repository/save_distribution_references.rb +2 -2
  47. data/app/lib/katello/concerns/base_template_scope_extensions.rb +1 -1
  48. data/app/lib/katello/concerns/renderer_extensions.rb +1 -1
  49. data/app/lib/katello/event_daemon/runner.rb +12 -9
  50. data/app/lib/katello/resources/candlepin/consumer.rb +6 -6
  51. data/app/lib/katello/resources/candlepin/owner.rb +1 -1
  52. data/app/lib/katello/resources/candlepin/upstream_consumer.rb +3 -4
  53. data/app/lib/katello/resources/candlepin.rb +4 -4
  54. data/app/lib/katello/util/errata.rb +12 -10
  55. data/app/lib/katello/util/search.rb +0 -1
  56. data/app/lib/katello/validators/content_view_environment_org_validator.rb +5 -2
  57. data/app/lib/katello/validators/content_view_environment_validator.rb +1 -2
  58. data/app/lib/katello/validators/generated_content_view_validator.rb +16 -0
  59. data/app/mailers/katello/errata_mailer.rb +4 -2
  60. data/app/models/katello/alternate_content_source.rb +5 -1
  61. data/app/models/katello/concerns/content_facet_host_extensions.rb +25 -14
  62. data/app/models/katello/concerns/host_managed_extensions.rb +17 -8
  63. data/app/models/katello/concerns/redhat_extensions.rb +16 -6
  64. data/app/models/katello/concerns/smart_proxy_extensions.rb +0 -12
  65. data/app/models/katello/concerns/subscription_facet_host_extensions.rb +1 -0
  66. data/app/models/katello/content_view.rb +22 -5
  67. data/app/models/katello/content_view_environment.rb +11 -2
  68. data/app/models/katello/content_view_environment_content_facet.rb +9 -0
  69. data/app/models/katello/content_view_version.rb +10 -5
  70. data/app/models/katello/erratum.rb +6 -1
  71. data/app/models/katello/glue/candlepin/pool.rb +6 -0
  72. data/app/models/katello/glue/candlepin/product.rb +7 -1
  73. data/app/models/katello/glue/candlepin/subscription.rb +5 -0
  74. data/app/models/katello/glue/provider.rb +26 -26
  75. data/app/models/katello/host/content_facet.rb +106 -18
  76. data/app/models/katello/host/info_provider.rb +25 -21
  77. data/app/models/katello/host/subscription_facet.rb +18 -14
  78. data/app/models/katello/kt_environment.rb +12 -7
  79. data/app/models/katello/package_group.rb +0 -12
  80. data/app/models/katello/pool.rb +4 -1
  81. data/app/models/katello/product.rb +11 -1
  82. data/app/models/katello/product_content.rb +0 -4
  83. data/app/models/katello/repository.rb +11 -11
  84. data/app/models/katello/root_repository.rb +4 -3
  85. data/app/models/katello/task_status.rb +0 -18
  86. data/app/services/katello/candlepin/consumer.rb +2 -2
  87. data/app/services/katello/host/package_profile_uploader.rb +1 -1
  88. data/app/services/katello/product_content_finder.rb +11 -12
  89. data/app/services/katello/pulp3/content_view_version/export.rb +8 -65
  90. data/app/services/katello/pulp3/content_view_version/export_validation_error.rb +7 -0
  91. data/app/services/katello/pulp3/content_view_version/export_validator.rb +105 -0
  92. data/app/services/katello/pulp3/content_view_version/importable_products.rb +1 -1
  93. data/app/services/katello/pulp3/content_view_version/syncable_format_export.rb +7 -1
  94. data/app/services/katello/pulp3/erratum.rb +1 -0
  95. data/app/services/katello/pulp3/module_stream.rb +26 -11
  96. data/app/services/katello/pulp3/repository/yum.rb +2 -1
  97. data/app/services/katello/pulp3/smart_proxy_mirror_repository.rb +2 -1
  98. data/app/services/katello/registration_manager.rb +46 -26
  99. data/app/services/katello/repository_type.rb +3 -9
  100. data/app/services/katello/simple_package.rb +22 -0
  101. data/app/views/foreman/smart_proxies/_content_sync.html.erb +1 -0
  102. data/app/views/foreman/smart_proxies/_reclaim_space.html.erb +1 -0
  103. data/app/views/katello/api/v2/content_facet/base.json.rabl +23 -2
  104. data/app/views/katello/api/v2/content_facet/show.json.rabl +11 -8
  105. data/app/views/katello/api/v2/content_views/base.json.rabl +1 -1
  106. data/app/views/katello/api/v2/hosts/base.json.rabl +22 -2
  107. data/app/views/overrides/activation_keys/_host_environment_select.html.erb +2 -2
  108. data/config/initializers/monkeys.rb +0 -2
  109. data/config/routes/api/registry.rb +8 -7
  110. data/config/routes/api/v2.rb +0 -2
  111. data/config/routes.rb +3 -0
  112. data/db/migrate/20200429153103_installed_package_bad_nvrea.rb +1 -1
  113. data/db/migrate/20220110223754_update_disconnected_settings.rb +4 -8
  114. data/db/migrate/20220228173251_remove_drpm_from_ignorable_content.rb +7 -3
  115. data/db/migrate/20220419193414_content_settings_to_dsl_category.rb +1 -1
  116. data/db/migrate/20220929204746_add_content_view_environment_content_facet.rb +52 -0
  117. data/db/migrate/20221123212341_remove_pulp_docker_registry_port_setting.rb +5 -0
  118. data/db/migrate/20230119003859_ensure_repo_username_password_nil_not_blank.rb +1 -1
  119. data/db/seeds.d/111-upgrade_tasks.rb +2 -1
  120. data/engines/bastion/app/assets/stylesheets/bastion/bastion.scss +4 -0
  121. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-details.controller.js +2 -4
  122. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-errata-modal.controller.js +0 -1
  123. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-details.controller.js +2 -4
  124. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts.html +2 -1
  125. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/apply-errata.controller.js +11 -3
  126. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/views/host-collection-hosts-list.html +1 -1
  127. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/bastion_katello.pot +8 -4
  128. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/de.po +5485 -0
  129. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/es.po +5397 -0
  130. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/fr.po +5658 -0
  131. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ja.po +5284 -0
  132. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ka.po +5231 -0
  133. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ko.po +5275 -0
  134. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/pt_BR.po +5389 -0
  135. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/zh_CN.po +5212 -0
  136. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/zh_TW.po +5145 -0
  137. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/translations.js +9 -0
  138. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/content-access-mode-banner.html +2 -2
  139. data/lib/katello/engine.rb +2 -1
  140. data/lib/katello/permission_creator.rb +2 -4
  141. data/lib/katello/permissions/registry_permissions.rb +5 -5
  142. data/lib/katello/plugin.rb +22 -14
  143. data/lib/katello/repository_types/README.md +136 -19
  144. data/lib/katello/repository_types/deb.rb +0 -1
  145. data/lib/katello/repository_types/docker.rb +0 -1
  146. data/lib/katello/repository_types/file.rb +0 -1
  147. data/lib/katello/repository_types/yum.rb +0 -4
  148. data/lib/katello/tasks/clean_candlepin_orphaned_products.rake +38 -0
  149. data/lib/katello/tasks/clean_orphaned_facets.rb +20 -0
  150. data/lib/katello/tasks/reimport.rake +1 -2
  151. data/lib/katello/tasks/repository.rake +1 -22
  152. data/lib/katello/tasks/reset.rake +1 -0
  153. data/lib/katello/tasks/upgrades/4.8/fix_incorrect_providers.rake +29 -0
  154. data/lib/katello/version.rb +1 -1
  155. data/lib/katello.rb +0 -5
  156. data/locale/bn/katello.po +69 -27
  157. data/locale/cs/katello.po +69 -27
  158. data/locale/de/katello.po +78 -36
  159. data/locale/en/katello.po +69 -27
  160. data/locale/es/katello.po +70 -28
  161. data/locale/fr/katello.po +73 -31
  162. data/locale/gu/katello.po +69 -27
  163. data/locale/hi/katello.po +69 -27
  164. data/locale/it/katello.po +69 -27
  165. data/locale/ja/katello.po +73 -31
  166. data/locale/ka/katello.po +73 -31
  167. data/locale/katello.pot +335 -262
  168. data/locale/kn/katello.po +69 -27
  169. data/locale/ko/katello.po +69 -27
  170. data/locale/mr/katello.po +69 -27
  171. data/locale/or/katello.po +69 -27
  172. data/locale/pa/katello.po +69 -27
  173. data/locale/pt/katello.po +69 -27
  174. data/locale/pt_BR/katello.po +70 -28
  175. data/locale/ru/katello.po +70 -28
  176. data/locale/ta/katello.po +69 -27
  177. data/locale/te/katello.po +69 -27
  178. data/locale/zh_CN/katello.po +73 -31
  179. data/locale/zh_TW/katello.po +70 -28
  180. data/webpack/components/Content/ContentPage.js +51 -35
  181. data/webpack/components/Content/__tests__/ContentPage.test.js +2 -4
  182. data/webpack/components/Content/__tests__/__snapshots__/ContentPage.test.js.snap +22 -3
  183. data/webpack/components/Table/EmptyStateMessage.js +14 -11
  184. data/webpack/components/Table/MainTable.js +36 -15
  185. data/webpack/components/Table/TableWrapper.js +25 -25
  186. data/webpack/components/Table/__test__/emptyStateMessage.test.js +51 -0
  187. data/webpack/components/extensions/HostDetails/Cards/ErrataOverviewCard.js +5 -4
  188. data/webpack/components/extensions/HostDetails/Cards/HostCollectionsCard/HostCollectionsModal.js +1 -1
  189. data/webpack/components/extensions/HostDetails/Cards/HostCollectionsCard/__tests__/hostCollectionsModal.test.js +1 -17
  190. data/webpack/components/extensions/HostDetails/Tabs/ErrataTab/ErrataTab.js +18 -9
  191. data/webpack/components/extensions/HostDetails/Tabs/ModuleStreamsTab/ModuleStreamsTab.js +1 -2
  192. data/webpack/components/extensions/HostDetails/Tabs/PackagesTab/PackageInstallModal.js +1 -2
  193. data/webpack/components/extensions/HostDetails/Tabs/PackagesTab/PackagesTab.js +1 -2
  194. data/webpack/components/extensions/HostDetails/Tabs/RepositorySetsTab/RepositorySetsTab.js +47 -27
  195. data/webpack/components/extensions/HostDetails/Tabs/TracesTab/TracesTab.js +1 -2
  196. data/webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js +2 -21
  197. data/webpack/components/extensions/HostDetails/Tabs/__tests__/moduleStreamsTab.test.js +1 -28
  198. data/webpack/components/extensions/HostDetails/Tabs/__tests__/packageInstallModal.test.js +1 -10
  199. data/webpack/components/extensions/HostDetails/Tabs/__tests__/packagesTab.test.js +1 -18
  200. data/webpack/components/extensions/HostDetails/Tabs/__tests__/repositorySetsTab.test.js +1 -17
  201. data/webpack/components/extensions/HostDetails/Tabs/__tests__/tracesTab.test.js +1 -15
  202. data/webpack/global_test_setup.js +1 -1
  203. data/webpack/scenes/AlternateContentSources/Create/ACSCreateWizard.js +12 -10
  204. data/webpack/scenes/AlternateContentSources/Create/Steps/ACSCredentials.js +6 -0
  205. data/webpack/scenes/AlternateContentSources/Create/Steps/ACSSmartProxies.js +1 -0
  206. data/webpack/scenes/AlternateContentSources/Create/Steps/AcsUrlPaths.js +3 -10
  207. data/webpack/scenes/AlternateContentSources/Create/Steps/NameACS.js +1 -0
  208. data/webpack/scenes/AlternateContentSources/Create/__tests__/acsCreate.test.js +3 -3
  209. data/webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditDetails.js +1 -0
  210. data/webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditURLPaths.js +12 -4
  211. data/webpack/scenes/AlternateContentSources/MainTable/ACSTable.js +7 -4
  212. data/webpack/scenes/AlternateContentSources/MainTable/__tests__/acsTable.test.js +4 -8
  213. data/webpack/scenes/AlternateContentSources/helpers.js +1 -1
  214. data/webpack/scenes/Content/Details/ContentRepositories.js +5 -4
  215. data/webpack/scenes/Content/Details/__tests__/contentDetail.test.js +1 -12
  216. data/webpack/scenes/Content/Table/ContentTable.js +2 -1
  217. data/webpack/scenes/Content/__tests__/contentTable.test.js +1 -14
  218. data/webpack/scenes/ContentViews/Delete/__tests__/contentViewDelete.test.js +1 -25
  219. data/webpack/scenes/ContentViews/Details/ComponentContentViews/ContentViewComponents.js +2 -1
  220. data/webpack/scenes/ContentViews/Details/ComponentContentViews/__tests__/contentViewComponents.test.js +44 -31
  221. data/webpack/scenes/ContentViews/Details/ContentViewDetails.js +2 -0
  222. data/webpack/scenes/ContentViews/Details/Filters/AffectedRepositories/AffectedRepositoryTable.js +6 -1
  223. data/webpack/scenes/ContentViews/Details/Filters/CVContainerImageFilterContent.js +2 -1
  224. data/webpack/scenes/ContentViews/Details/Filters/CVDebFilterContent.js +2 -1
  225. data/webpack/scenes/ContentViews/Details/Filters/CVErrataIDFilterContent.js +3 -1
  226. data/webpack/scenes/ContentViews/Details/Filters/CVModuleStreamFilterContent.js +3 -1
  227. data/webpack/scenes/ContentViews/Details/Filters/CVPackageGroupFilterContent.js +3 -1
  228. data/webpack/scenes/ContentViews/Details/Filters/CVRpmFilterContent.js +2 -1
  229. data/webpack/scenes/ContentViews/Details/Filters/ContentViewFilterDetailsHeader.js +2 -0
  230. data/webpack/scenes/ContentViews/Details/Filters/ContentViewFilters.js +2 -1
  231. data/webpack/scenes/ContentViews/Details/Filters/MatchContentModal/CVDebMatchContentModal.js +1 -1
  232. data/webpack/scenes/ContentViews/Details/Filters/MatchContentModal/CVRpmMatchContentModal.js +1 -1
  233. data/webpack/scenes/ContentViews/Details/Filters/MatchContentModal/__tests__/CVRpmMatchContentModal.test.js +35 -33
  234. data/webpack/scenes/ContentViews/Details/Filters/__tests__/CVContainerImageFilterContent.test.js +48 -45
  235. data/webpack/scenes/ContentViews/Details/Filters/__tests__/CVRpmFilterContent.test.js +58 -24
  236. data/webpack/scenes/ContentViews/Details/Filters/__tests__/ContentViewPackageGroupFilter.test.js +64 -0
  237. data/webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilterDetails.test.js +36 -20
  238. data/webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilters.test.js +40 -23
  239. data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvErrataIDFilter.test.js +0 -13
  240. data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvModuleStreamFilter.test.js +0 -13
  241. data/webpack/scenes/ContentViews/Details/Histories/ContentViewHistories.js +2 -1
  242. data/webpack/scenes/ContentViews/Details/Histories/__tests__/contentViewHistory.test.js +1 -10
  243. data/webpack/scenes/ContentViews/Details/Repositories/ContentViewRepositories.js +2 -1
  244. data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewAddRemove.test.js +1 -10
  245. data/webpack/scenes/ContentViews/Details/Versions/Compare/CVVersionCompareConfig.js +21 -9
  246. data/webpack/scenes/ContentViews/Details/Versions/Compare/CVVersionCompareTable.js +4 -0
  247. data/webpack/scenes/ContentViews/Details/Versions/Compare/__tests__/CVVersionCompare.test.js +1 -32
  248. data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersions.js +3 -1
  249. data/webpack/scenes/ContentViews/Details/Versions/Delete/__tests__/cvVersionRemove.test.js +1 -15
  250. data/webpack/scenes/ContentViews/Details/Versions/Delete/affectedActivationKeys.js +1 -1
  251. data/webpack/scenes/ContentViews/Details/Versions/Delete/affectedHosts.js +1 -2
  252. data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionDetailConfig.js +31 -9
  253. data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionDetailsTable.js +4 -0
  254. data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionDetails.test.js +30 -14
  255. data/webpack/scenes/ContentViews/Table/ContentViewsTable.js +1 -1
  256. data/webpack/scenes/ContentViews/__tests__/contentViewPage.test.js +55 -120
  257. data/webpack/scenes/ContentViews/components/WizardHeader.js +1 -1
  258. data/webpack/scenes/ContentViews/expansions/RelatedContentViewComponentsModal.js +1 -1
  259. data/webpack/scenes/ContentViews/expansions/__tests__/contentViewComponentsModal.test.js +8 -1
  260. data/webpack/scenes/ModuleStreams/ModuleStreamsPage.js +3 -9
  261. data/webpack/scenes/ModuleStreams/__tests__/__snapshots__/ModuleStreamPage.test.js.snap +7 -1
  262. data/webpack/scenes/RedHatRepositories/components/Search.js +22 -16
  263. data/webpack/scenes/RedHatRepositories/index.scss +20 -1
  264. data/webpack/scenes/SmartProxy/SmartProxyContentTable.js +12 -1
  265. data/webpack/scenes/Subscriptions/Manifest/CdnConfigurationTab/CdnTypeForm.js +1 -1
  266. data/webpack/scenes/Subscriptions/Manifest/CdnConfigurationTab/CustomCdnTypeForm.js +1 -1
  267. data/webpack/scenes/Subscriptions/SubscriptionsPage.js +21 -19
  268. data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsPage.test.js.snap +34 -1
  269. data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/SubscriptionsToolbar.js +20 -7
  270. data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/SubscriptionsToolbar.test.js +0 -1
  271. data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/__snapshots__/SubscriptionsToolbar.test.js.snap +65 -15
  272. metadata +49 -146
  273. data/app/lib/actions/katello/organization/simple_content_access/prepare_content_overrides.rb +0 -36
  274. data/app/lib/actions/katello/pulp_selector.rb +0 -24
  275. data/app/lib/actions/katello/repository/correct_checksum.rb +0 -24
  276. data/app/lib/actions/katello/repository/destroy_package_group.rb +0 -26
  277. data/app/lib/actions/katello/repository/upload_package_group.rb +0 -24
  278. data/app/lib/actions/pulp/abstract.rb +0 -37
  279. data/app/lib/actions/pulp/abstract_async_task.rb +0 -154
  280. data/app/lib/actions/pulp/abstract_async_task_group.rb +0 -94
  281. data/app/lib/actions/pulp/consumer/sync_capsule.rb +0 -45
  282. data/app/lib/actions/pulp/consumer/unassociate_units.rb +0 -20
  283. data/app/lib/actions/pulp/expect_one_task.rb +0 -11
  284. data/app/lib/actions/pulp/orchestration/orphan_cleanup/remove_orphans.rb +0 -16
  285. data/app/lib/actions/pulp/orchestration/repository/copy_all_units.rb +0 -19
  286. data/app/lib/actions/pulp/orchestration/repository/delete.rb +0 -15
  287. data/app/lib/actions/pulp/orchestration/repository/refresh.rb +0 -14
  288. data/app/lib/actions/pulp/orchestration/repository/refresh_if_needed.rb +0 -13
  289. data/app/lib/actions/pulp/orchestration/repository/refresh_repos.rb +0 -19
  290. data/app/lib/actions/pulp/orchestration/repository/remove_units.rb +0 -14
  291. data/app/lib/actions/pulp/orchestration/repository/smart_proxy_sync.rb +0 -34
  292. data/app/lib/actions/pulp/orchestration/repository/sync.rb +0 -18
  293. data/app/lib/actions/pulp/orchestration/repository/upload_content.rb +0 -37
  294. data/app/lib/actions/pulp/orphan_cleanup/remove_orphans.rb +0 -15
  295. data/app/lib/actions/pulp/orphan_cleanup/remove_unneeded_repos.rb +0 -16
  296. data/app/lib/actions/pulp/repository/abstract_copy_content.rb +0 -45
  297. data/app/lib/actions/pulp/repository/abstract_remove_content.rb +0 -32
  298. data/app/lib/actions/pulp/repository/clear.rb +0 -18
  299. data/app/lib/actions/pulp/repository/copy_all_units.rb +0 -30
  300. data/app/lib/actions/pulp/repository/copy_units.rb +0 -25
  301. data/app/lib/actions/pulp/repository/create.rb +0 -28
  302. data/app/lib/actions/pulp/repository/create_in_plan.rb +0 -15
  303. data/app/lib/actions/pulp/repository/create_upload_request.rb +0 -20
  304. data/app/lib/actions/pulp/repository/delete_upload_request.rb +0 -19
  305. data/app/lib/actions/pulp/repository/destroy.rb +0 -28
  306. data/app/lib/actions/pulp/repository/distributor_publish.rb +0 -25
  307. data/app/lib/actions/pulp/repository/download.rb +0 -16
  308. data/app/lib/actions/pulp/repository/import_upload.rb +0 -19
  309. data/app/lib/actions/pulp/repository/presenters/abstract_sync_presenter.rb +0 -47
  310. data/app/lib/actions/pulp/repository/presenters/deb_presenter.rb +0 -95
  311. data/app/lib/actions/pulp/repository/presenters/docker_presenter.rb +0 -103
  312. data/app/lib/actions/pulp/repository/presenters/file_unit_presenter.rb +0 -42
  313. data/app/lib/actions/pulp/repository/presenters/yum_presenter.rb +0 -131
  314. data/app/lib/actions/pulp/repository/refresh.rb +0 -21
  315. data/app/lib/actions/pulp/repository/regenerate_applicability.rb +0 -21
  316. data/app/lib/actions/pulp/repository/remove_distribution.rb +0 -11
  317. data/app/lib/actions/pulp/repository/remove_units.rb +0 -44
  318. data/app/lib/actions/pulp/repository/sync.rb +0 -99
  319. data/app/lib/actions/pulp/repository/upload_file.rb +0 -28
  320. data/app/lib/actions/pulp/repository_group/create.rb +0 -31
  321. data/app/lib/actions/pulp/repository_group/delete.rb +0 -17
  322. data/app/lib/actions/pulp/repository_group/export.rb +0 -51
  323. data/app/lib/katello/util/content_overrides_migrator.rb +0 -98
  324. data/app/lib/katello/util/package_clause_generator.rb +0 -77
  325. data/app/models/katello/glue/pulp/pulp_errors.rb +0 -9
  326. data/app/models/katello/glue/pulp/repo.rb +0 -353
  327. data/app/models/katello/pulp_sync_status.rb +0 -165
  328. data/app/models/katello/pulp_task_status.rb +0 -63
  329. data/app/services/katello/pulp/content.rb +0 -24
  330. data/app/services/katello/pulp/importer_comparison.rb +0 -28
  331. data/app/services/katello/pulp/repository/deb.rb +0 -61
  332. data/app/services/katello/pulp/repository/docker.rb +0 -82
  333. data/app/services/katello/pulp/repository/file.rb +0 -52
  334. data/app/services/katello/pulp/repository/yum.rb +0 -205
  335. data/app/services/katello/pulp/repository.rb +0 -327
  336. data/app/services/katello/pulp/server.rb +0 -35
  337. data/app/services/katello/pulp/simple_package.rb +0 -24
  338. data/app/services/katello/pulp/smart_proxy_repository.rb +0 -52
  339. data/lib/monkeys/fix_deb_optimized_sync.rb +0 -35
  340. data/lib/monkeys/fix_pulp_container_path.rb +0 -35
  341. data/locale/bn/LC_MESSAGES/katello.mo +0 -0
  342. data/locale/cs/LC_MESSAGES/katello.mo +0 -0
  343. data/locale/de/LC_MESSAGES/katello.mo +0 -0
  344. data/locale/en/LC_MESSAGES/katello.mo +0 -0
  345. data/locale/es/LC_MESSAGES/katello.mo +0 -0
  346. data/locale/fr/LC_MESSAGES/katello.mo +0 -0
  347. data/locale/gu/LC_MESSAGES/katello.mo +0 -0
  348. data/locale/hi/LC_MESSAGES/katello.mo +0 -0
  349. data/locale/it/LC_MESSAGES/katello.mo +0 -0
  350. data/locale/ja/LC_MESSAGES/katello.mo +0 -0
  351. data/locale/ka/LC_MESSAGES/katello.mo +0 -0
  352. data/locale/kn/LC_MESSAGES/katello.mo +0 -0
  353. data/locale/ko/LC_MESSAGES/katello.mo +0 -0
  354. data/locale/mr/LC_MESSAGES/katello.mo +0 -0
  355. data/locale/or/LC_MESSAGES/katello.mo +0 -0
  356. data/locale/pa/LC_MESSAGES/katello.mo +0 -0
  357. data/locale/pt/LC_MESSAGES/katello.mo +0 -0
  358. data/locale/pt_BR/LC_MESSAGES/katello.mo +0 -0
  359. data/locale/ru/LC_MESSAGES/katello.mo +0 -0
  360. data/locale/ta/LC_MESSAGES/katello.mo +0 -0
  361. data/locale/te/LC_MESSAGES/katello.mo +0 -0
  362. data/locale/zanata.xml +0 -30
  363. data/locale/zh_CN/LC_MESSAGES/katello.mo +0 -0
  364. data/locale/zh_TW/LC_MESSAGES/katello.mo +0 -0
  365. data/webpack/scenes/ContentViews/Details/Filters/MatchContentModal/__tests__/CVRpmMatchContentSearch.fixtures.json +0 -33
@@ -1,131 +0,0 @@
1
- module Actions
2
- module Pulp
3
- module Repository
4
- module Presenters
5
- class YumPresenter < AbstractSyncPresenter
6
- def progress
7
- if sync_task && size_total > 0
8
- size_done.to_f / size_total
9
- else
10
- 0.01
11
- end
12
- end
13
-
14
- private
15
-
16
- def humanized_details
17
- ret = []
18
- ret << _("Cancelled.") if cancelled?
19
-
20
- if pending?
21
- ret << _("Pending")
22
- elsif content_started?
23
- if items_total > 0
24
- ret << (_("New packages: %{count} (%{size}).") % {:count => count_summary, :size => size_summary})
25
- else
26
- #if there are no new packages, it could just mean that they have not started downloading yet
27
- # so only tell the user no new packages if errata have been processed
28
- if errata_details && errata_details['state'] != 'NOT_STARTED'
29
- ret << _("No new packages.")
30
- else
31
- ret << _("Processing metadata.")
32
- end
33
- end
34
- elsif metadata_in_progress?
35
- ret << _("Processing metadata")
36
- end
37
-
38
- ret << _('Yum Metadata: %s') % metadata_error if metadata_error
39
-
40
- if error_details.any?
41
- ret << n_("Failed to download %s package.", "Failed to download %s packages.",
42
- error_details.count) % error_details.count
43
- end
44
- ret.join("\n")
45
- end
46
-
47
- def count_summary
48
- if content_details[:state] == "IN_PROGRESS"
49
- "#{items_done}/#{items_total}"
50
- else
51
- items_done
52
- end
53
- end
54
-
55
- def size_summary
56
- helper = Object.new.extend(ActionView::Helpers::NumberHelper)
57
- if content_details[:state] == "IN_PROGRESS"
58
- "#{helper.number_to_human_size(size_done)}/#{helper.number_to_human_size(size_total)}"
59
- else
60
- helper.number_to_human_size(size_total)
61
- end
62
- end
63
-
64
- def task_progress
65
- sync_task[:progress_report]
66
- end
67
-
68
- def task_progress_details
69
- task_progress && task_progress[:yum_importer]
70
- end
71
-
72
- def task_details
73
- task_result_details || task_progress_details
74
- end
75
-
76
- def content_details
77
- task_details && task_details[:content]
78
- end
79
-
80
- def error_details
81
- content_details.nil? ? [] : content_details[:error_details]
82
- end
83
-
84
- def metadata_details
85
- task_details && task_details[:metadata]
86
- end
87
-
88
- def errata_details
89
- task_details && task_details[:errata]
90
- end
91
-
92
- def items_done
93
- items_total - content_details[:items_left]
94
- end
95
-
96
- def items_total
97
- content_details[:items_total].to_i
98
- end
99
-
100
- def size_done
101
- size_total - content_details[:size_left]
102
- end
103
-
104
- def size_total
105
- (content_details && content_details[:size_total]).to_i
106
- end
107
-
108
- def cancelled?
109
- task_details.nil? ? false : task_details.values.map { |item| item['state'] }.include?('CANCELLED')
110
- end
111
-
112
- def content_started?
113
- content_details && content_details[:state] != 'NOT_STARTED'
114
- end
115
-
116
- def metadata_in_progress?
117
- metadata_details && metadata_details[:state] == 'IN_PROGRESS'
118
- end
119
-
120
- def metadata_error
121
- metadata_details && metadata_details[:error]
122
- end
123
-
124
- def pending?
125
- metadata_details.nil? || metadata_details['state'] == 'NOT_RUNNING'
126
- end
127
- end
128
- end
129
- end
130
- end
131
- end
@@ -1,21 +0,0 @@
1
- module Actions
2
- module Pulp
3
- module Repository
4
- class Refresh < Pulp::AbstractAsyncTask
5
- def plan(repository, options = {})
6
- options[:capsule_id] ||= SmartProxy.default_capsule!.id
7
- plan_self(:capsule_id => options[:capsule_id], :pulp_id => repository.pulp_id)
8
- end
9
-
10
- def invoke_external_task
11
- repo = ::Katello::Repository.find_by(:pulp_id => input[:pulp_id])
12
- if repo.nil?
13
- repo = ::Katello::ContentViewPuppetEnvironment.find_by(:pulp_id => input[:pulp_id])
14
- repo = repo.nonpersisted_repository
15
- end
16
- repo.backend_service(smart_proxy(input[:capsule_id])).refresh_if_needed
17
- end
18
- end
19
- end
20
- end
21
- end
@@ -1,21 +0,0 @@
1
- module Actions
2
- module Pulp
3
- module Repository
4
- class RegenerateApplicability < Pulp::AbstractAsyncTaskGroup
5
- middleware.use Actions::Middleware::ExecuteIfContentsChanged
6
-
7
- input_format do
8
- param :repository_id
9
- param :capsule_id
10
- param :contents_changed
11
- end
12
-
13
- def invoke_external_task
14
- capsule_id = input[:capsule_id] || SmartProxy.default_capsule!.id
15
- repo = ::Katello::Repository.find(input[:repository_id])
16
- repo.backend_service(smart_proxy(capsule_id)).regenerate_applicability
17
- end
18
- end
19
- end
20
- end
21
- end
@@ -1,11 +0,0 @@
1
- module Actions
2
- module Pulp
3
- module Repository
4
- class RemoveDistribution < Pulp::Repository::AbstractRemoveContent
5
- def content_extension
6
- pulp_extensions.distribution
7
- end
8
- end
9
- end
10
- end
11
- end
@@ -1,44 +0,0 @@
1
- module Actions
2
- module Pulp
3
- module Repository
4
- class RemoveUnits < Pulp::AbstractAsyncTask
5
- input_format do
6
- param :repo_id
7
- param :content_view_puppet_environment_id
8
- param :contents
9
- param :content_unit_type
10
- end
11
-
12
- def invoke_external_task
13
- fail _("Cannot pass content units without content unit type") if (input[:contents] && !input[:content_unit_type])
14
- if input[:repo_id]
15
- repo = ::Katello::Repository.find(input[:repo_id])
16
- else
17
- repo = ::Katello::ContentViewPuppetEnvironment.find(input[:content_view_puppet_environment_id]).nonpersisted_repository
18
- end
19
- fail _("An error occurred during content removal. Could not find repository with id: %s" % input[:repo_id]) unless repo
20
- tasks = []
21
- if input[:content_unit_type]
22
- content_type = ::Katello::RepositoryTypeManager.find_content_type(input[:content_unit_type].downcase)
23
- if input[:contents]
24
- units = content_type.model_class.where(:id => input[:contents])
25
- unit_pulp_ids = units.map(&:pulp_id).sort
26
- end
27
- tasks << ::SmartProxy.pulp_primary.content_service(content_type).remove(repo, unit_pulp_ids)
28
- else
29
- repo_content_types = ::Katello::RepositoryTypeManager.find(repo.content_type).content_types
30
- repo_content_types.each do |type|
31
- tasks << ::SmartProxy.pulp_primary.content_service(type).remove(repo)
32
- end
33
- end
34
- tasks
35
- end
36
-
37
- def external_task=(external_task_data)
38
- external_task_data = [external_task_data] if external_task_data.is_a?(Hash)
39
- super(external_task_data.map { |task| task.except('result') })
40
- end
41
- end
42
- end
43
- end
44
- end
@@ -1,99 +0,0 @@
1
- module Actions
2
- module Pulp
3
- module Repository
4
- class Sync < Pulp::AbstractAsyncTask
5
- include Helpers::Presenter
6
-
7
- input_format do
8
- param :repo_id
9
- param :source_url # allow overriding the feed URL
10
- param :options # Pulp sync options
11
- end
12
-
13
- def invoke_external_task
14
- overrides = {}
15
- overrides[:feed] = input[:source_url] if input[:source_url]
16
- overrides[:validate] = !(SETTINGS[:katello][:pulp][:skip_checksum_validation])
17
- overrides.merge(input[:options]) if input[:options]
18
- repo = ::Katello::Repository.find(input[:repo_id])
19
-
20
- output[:pulp_tasks] = repo.backend_service(::SmartProxy.pulp_primary).sync(overrides)
21
- end
22
-
23
- def finalize
24
- check_error_details
25
- end
26
-
27
- def external_task=(tasks)
28
- output[:contents_changed] = contents_changed?(tasks)
29
- super
30
- end
31
-
32
- def check_error_details
33
- output[:pulp_tasks].each do |pulp_task|
34
- error_details = pulp_task.try(:[], "progress_report").try(:[], "yum_importer").try(:[], "content").try(:[], "error_details")
35
- if error_details && error_details[0]
36
- fail _("An error occurred during the sync \n%{error_message}") % {:error_message => error_details[0]}
37
- end
38
- end
39
- end
40
-
41
- def contents_changed?(tasks)
42
- if tasks.is_a?(Hash)
43
- # note: for syncs initiated by a sync plan, tasks is a hash input
44
- sync_task = tasks
45
- else
46
- sync_task = tasks.find { |task| (task['tags'] || []).include?('pulp:action:sync') }
47
- end
48
-
49
- if sync_task && sync_task['state'] == 'finished' && sync_task[:result]
50
- if sync_task['result']['added_count'] > 0 || sync_task['result']['removed_count'] > 0 || sync_task['result']['updated_count'] > 0
51
- true
52
- else
53
- repo = ::Katello::Repository.find_by(:pulp_id => sync_task['result']['repo_id'])
54
- repo ? repo.pulp_counts_differ? : true
55
- end
56
- else
57
- true #if we can't figure it out, assume something changed
58
- end
59
- end
60
-
61
- def run_progress
62
- presenter.progress
63
- end
64
-
65
- def run_progress_weight
66
- 10
67
- end
68
-
69
- def presenter
70
- repo = ::Katello::Repository.find(input['repo_id']) if input['repo_id']
71
- # For repo sync tasks older than katello 3.14, we only have pulp_id available in input.
72
- repo ||= ::Katello::Repository.where(:pulp_id => input['pulp_id']).first if input['pulp_id']
73
-
74
- if repo.try(:yum?)
75
- Presenters::YumPresenter.new(self)
76
- elsif repo.try(:file?)
77
- Presenters::FileUnitPresenter.new(self)
78
- elsif repo.try(:docker?)
79
- Presenters::DockerPresenter.new(self)
80
- elsif repo.try(:deb?)
81
- Presenters::DebPresenter.new(self)
82
- end
83
- end
84
-
85
- def rescue_strategy_for_self
86
- # There are various reasons the syncing fails, not all of them are
87
- # fatal: when fail on syncing, we continue with the task ending up
88
- # in the warning state, but not locking further syncs
89
- Dynflow::Action::Rescue::Skip
90
- end
91
-
92
- def ignored_tags
93
- # ignore background download tasks
94
- ["pulp:action:download"]
95
- end
96
- end
97
- end
98
- end
99
- end
@@ -1,28 +0,0 @@
1
- module Actions
2
- module Pulp
3
- module Repository
4
- class UploadFile < Pulp::Abstract
5
- input_format do
6
- param :upload_id
7
- param :file
8
- end
9
-
10
- def run
11
- File.open(input[:file], "rb") do |file|
12
- offset = 0
13
- while (chunk = file.read(upload_chunk_size))
14
- pulp_resources.content.upload_bits(input[:upload_id], offset, chunk)
15
- offset += upload_chunk_size
16
- end
17
- end
18
- end
19
-
20
- private
21
-
22
- def upload_chunk_size
23
- SETTINGS[:katello][:pulp][:upload_chunk_size]
24
- end
25
- end
26
- end
27
- end
28
- end
@@ -1,31 +0,0 @@
1
- module Actions
2
- module Pulp
3
- module RepositoryGroup
4
- class Create < Pulp::Abstract
5
- include Helpers::Presenter
6
-
7
- input_format do
8
- param :id
9
- param :pulp_ids
10
- end
11
-
12
- def run
13
- pulp_resources.
14
- repository_group.create(input[:id],
15
- :id => input[:id],
16
- :repo_ids => input[:pulp_ids],
17
- :display_name => "temporary group for export",
18
- :distributors => [group_export_distributor])
19
- rescue RestClient::Conflict
20
- # if we get a 409 back, a previous run likely died mid-task but it
21
- # won't hurt this run.
22
- Rails.logger.info(_("Group %{id} already created.") % {:id => input[:id]})
23
- end
24
-
25
- def group_export_distributor
26
- Runcible::Models::GroupExportDistributor.new(false, false)
27
- end
28
- end
29
- end
30
- end
31
- end
@@ -1,17 +0,0 @@
1
- module Actions
2
- module Pulp
3
- module RepositoryGroup
4
- class Delete < Pulp::Abstract
5
- include Helpers::Presenter
6
-
7
- input_format do
8
- param :id
9
- end
10
-
11
- def run
12
- pulp_resources.repository_group.delete(input[:id])
13
- end
14
- end
15
- end
16
- end
17
- end
@@ -1,51 +0,0 @@
1
- module Actions
2
- module Pulp
3
- module RepositoryGroup
4
- class Export < Pulp::AbstractAsyncTask
5
- include Helpers::Presenter
6
-
7
- input_format do
8
- param :id
9
- param :export_to_iso
10
- param :export_directory # NB: this param is only used when not exporting to ISO
11
- param :start_date
12
- param :iso_size
13
- end
14
-
15
- def invoke_external_task
16
- override_config = { :incremental_export_repomd => true }
17
-
18
- if input[:start_date]
19
- override_config[:start_date] = input[:start_date]
20
- end
21
-
22
- if input[:iso_size]
23
- override_config[:iso_size] = input[:iso_size]
24
- end
25
-
26
- unless input[:export_to_iso]
27
- override_config[:export_dir] = input[:export_directory]
28
- end
29
-
30
- optional = {:override_config => override_config}
31
-
32
- pulp_resources.
33
- repository_group.publish(input[:id], distributor_id(input[:id]), optional)
34
- end
35
-
36
- private
37
-
38
- def distributor_id(pulp_id)
39
- distributor = repo_group_distributors(pulp_id).find do |dist|
40
- dist["distributor_type_id"] == 'group_export_distributor'
41
- end
42
- distributor['id']
43
- end
44
-
45
- def repo_group_distributors(pulp_id)
46
- pulp_resources.repository_group.retrieve_distributors(pulp_id)
47
- end
48
- end
49
- end
50
- end
51
- end
@@ -1,98 +0,0 @@
1
- module Katello
2
- module Util
3
- class ContentOverridesMigrator # used in Actions::Katello::Organization::SimpleContentAccess::PrepareContentOverrides
4
- include ActionView::Helpers::TextHelper
5
-
6
- def initialize(organization:)
7
- @organization = organization
8
- end
9
-
10
- def execute_non_sca_overrides!
11
- host_errors = create_disabled_overrides_for_non_sca_org_hosts(organization: @organization)
12
- ak_errors = create_disabled_overrides_for_non_sca_org_activation_keys(organization: @organization)
13
-
14
- total_errors = host_errors + ak_errors
15
- finish_message = "Finished creating overrides in non-SCA org; #{total_errors == 0 ? "no errors" : "#{pluralize(total_errors, "error")}"}"
16
- messages = { result: finish_message, errors: total_errors }
17
- messages[:host_errors] = "Hosts - #{pluralize(host_errors, "error")} creating disabled overrides for unsubscribed content; see log messages above" if host_errors > 0
18
- messages[:ak_errors] = "Activation keys - #{pluralize(ak_errors, "error")} creating disabled overrides for unsubscribed content; see log messages above" if ak_errors > 0
19
- messages[:success_message] = "Organization may now be switched to Simple Content Access mode without any change in access to content." if total_errors == 0
20
- Rails.logger.info finish_message
21
- Rails.logger.info messages[:host_errors] if messages[:host_errors]
22
- Rails.logger.info messages[:ak_errors] if messages[:ak_errors]
23
- Rails.logger.info messages[:success_message] if messages[:success_message]
24
- messages
25
- end
26
-
27
- def create_disabled_overrides_for_non_sca(consumable:)
28
- content_finder = ::Katello::ProductContentFinder.new(
29
- match_subscription: false,
30
- match_environment: false,
31
- consumable: consumable
32
- )
33
- subscribed_content_finder = ::Katello::ProductContentFinder.new(
34
- match_subscription: true,
35
- match_environment: false,
36
- consumable: consumable
37
- )
38
- candlepin_resource = consumable.is_a?(::Katello::Host::SubscriptionFacet) ? ::Katello::Resources::Candlepin::Consumer : ::Katello::Resources::Candlepin::ActivationKey
39
- consumable_id = consumable.is_a?(::Katello::Host::SubscriptionFacet) ? consumable.uuid : consumable.cp_id
40
- repos_with_existing_overrides = candlepin_resource.content_overrides(consumable_id).map do |override|
41
- override[:contentLabel]
42
- end
43
- unsubscribed_content = content_finder.custom_content_labels - subscribed_content_finder.custom_content_labels - repos_with_existing_overrides
44
- new_overrides = unsubscribed_content.map do |repo_label|
45
- ::Katello::ContentOverride.new(
46
- repo_label,
47
- { name: "enabled", value: "0" } # Override to disabled
48
- )
49
- end
50
- return if new_overrides.blank?
51
- if consumable.is_a? ::Katello::Host::SubscriptionFacet
52
- ::Katello::Resources::Candlepin::Consumer.update_content_overrides(
53
- consumable.uuid,
54
- new_overrides.map(&:to_entitlement_hash)
55
- )
56
- else
57
- ::Katello::Resources::Candlepin::ActivationKey.update_content_overrides(
58
- consumable.cp_id,
59
- new_overrides.map(&:to_entitlement_hash)
60
- )
61
- end
62
- end
63
-
64
- def create_disabled_overrides_for_non_sca_org_hosts(organization:)
65
- errors = 0
66
- fail _("Organization must be specified") if organization.blank?
67
- return 0 if organization.simple_content_access? # subscription attachment is meaningless with SCA
68
- Rails.logger.info("Hosts - Creating disabled overrides for unsubscribed content in organization #{organization.name}")
69
- # only registered hosts with content!
70
- hosts_to_update = organization.hosts.joins(:subscription_facet).where.not("#{Katello::Host::SubscriptionFacet.table_name}.host_id" => nil)
71
- hosts_to_update.each do |host|
72
- create_disabled_overrides_for_non_sca(consumable: host.subscription_facet)
73
- rescue => e
74
- errors += 1
75
- Rails.logger.error("Failed to update host #{host.name}: #{e.message}")
76
- Rails.logger.debug e.backtrace.join("\n")
77
- end
78
- errors
79
- end
80
-
81
- def create_disabled_overrides_for_non_sca_org_activation_keys(organization:)
82
- errors = 0
83
- fail _("Organization must be specified") if organization.blank?
84
- return 0 if organization.simple_content_access? # subscription attachment is meaningless with SCA
85
- Rails.logger.info("Activation keys - Creating disabled overrides for unsubscribed content in organization #{organization.name}")
86
- aks_to_update = organization.activation_keys
87
- aks_to_update.each do |ak|
88
- create_disabled_overrides_for_non_sca(consumable: ak)
89
- rescue => e
90
- errors += 1
91
- Rails.logger.error("Failed to update activation key #{ak.name}: #{e.message}")
92
- Rails.logger.debug e.backtrace.join("\n")
93
- end
94
- errors
95
- end
96
- end
97
- end
98
- end
@@ -1,77 +0,0 @@
1
- module Katello
2
- module Util
3
- class PackageClauseGenerator
4
- include Util::FilterClauseGenerator
5
-
6
- def copy_clause
7
- clauses = super
8
- {"$and" => [{"is_modular" => false}, clauses]} unless clauses.blank?
9
- end
10
-
11
- def remove_clause
12
- clauses = super
13
- {"$and" => [{"is_modular" => false}, clauses]} unless clauses.blank?
14
- end
15
-
16
- protected
17
-
18
- def fetch_filters
19
- ContentViewFilter.yum(false)
20
- end
21
-
22
- def collect_clauses(repo, filters)
23
- [ContentViewErratumFilter, ContentViewPackageGroupFilter, ContentViewPackageFilter].collect do |filter_class|
24
- content_type_filters = filters.where(:type => filter_class.to_s)
25
- make_package_clauses(repo, content_type_filters) unless content_type_filters.empty?
26
- end
27
- end
28
-
29
- def whitelist_non_matcher_clause
30
- {"filename" => {"$not" => {"$exists" => true}}}
31
- end
32
-
33
- def whitelist_all_matcher_clause
34
- {"filename" => {"$exists" => true}}
35
- end
36
-
37
- def make_package_clauses(repo, filters)
38
- content_type = filters.first.content_type
39
- pulp_content_clauses = filters.collect do |filter|
40
- filter.generate_clauses(repo)
41
- end
42
- pulp_content_clauses.flatten!
43
- pulp_content_clauses.compact!
44
-
45
- unless pulp_content_clauses.empty?
46
- package_clauses_from_content(content_type, pulp_content_clauses)
47
- end
48
- end
49
-
50
- def package_clauses_from_content(content_type, pulp_content_clauses)
51
- case content_type
52
- when ContentViewFilter::ERRATA
53
- package_clauses_for_errata(pulp_content_clauses)
54
- when ContentViewFilter::PACKAGE_GROUP
55
- package_clauses_for_group(pulp_content_clauses)
56
- else
57
- {"$or" => pulp_content_clauses}
58
- end
59
- end
60
-
61
- # input -> [{"type"=>{"$in"=>[:bugfix, :security]}}] <- Errata Pulp Clauses
62
- # output -> {"filename" => {"$in" => {"foo.el6.noarch", "..."}}} <- Packages belonging to those errata
63
- def package_clauses_for_errata(errata_clauses = [])
64
- pkg_filenames = Katello::Erratum.list_filenames_by_clauses(@repo, errata_clauses)
65
- {'filename' => {"$in" => pkg_filenames}} unless pkg_filenames.empty?
66
- end
67
-
68
- # input -> [{"name"=>{"$in"=>["foo", "bar"]}}] <- Package group pulp clauses
69
- # output -> {"names" => {"$in" => {"foo", "..."}}} <- packages belonging to those packages
70
- def package_clauses_for_group(group_clauses = [])
71
- group_clauses = {"$or" => group_clauses}
72
- pkg_names = Katello::PackageGroup.list_by_filter_clauses(group_clauses)
73
- {'name' => {"$in" => pkg_names}} unless pkg_names.empty?
74
- end
75
- end
76
- end
77
- end
@@ -1,9 +0,0 @@
1
- module Katello
2
- module Glue
3
- module Pulp
4
- module PulpErrors
5
- class ServiceUnavailable < HttpErrors::ServiceUnavailable; end
6
- end
7
- end
8
- end
9
- end