katello 4.7.3 → 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 (333) 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/concerns/api/v2/bulk_hosts_extensions.rb +4 -6
  14. data/app/controllers/katello/concerns/api/v2/registration_controller_extensions.rb +1 -2
  15. data/app/controllers/katello/concerns/authorization/api/v2/content_views_controller.rb +4 -1
  16. data/app/controllers/katello/concerns/content_facet_hosts_controller_extensions.rb +24 -0
  17. data/app/controllers/katello/concerns/hosts_controller_extensions.rb +3 -3
  18. data/app/helpers/katello/hosts_and_hostgroups_helper.rb +55 -24
  19. data/app/helpers/katello/katello_urls_helper.rb +0 -15
  20. data/app/helpers/katello/sync_management_helper.rb +0 -4
  21. data/app/lib/actions/candlepin/owner/destroy_imports.rb +1 -1
  22. data/app/lib/actions/katello/capsule_content/sync.rb +0 -4
  23. data/app/lib/actions/katello/capsule_content/sync_capsule.rb +1 -2
  24. data/app/lib/actions/katello/content_view/publish.rb +6 -2
  25. data/app/lib/actions/katello/content_view/remove.rb +8 -2
  26. data/app/lib/actions/katello/content_view_version/destroy.rb +1 -1
  27. data/app/lib/actions/katello/environment/destroy.rb +8 -2
  28. data/app/lib/actions/katello/host/reassign.rb +4 -2
  29. data/app/lib/actions/katello/orphan_cleanup/remove_orphans.rb +0 -1
  30. data/app/lib/actions/katello/product/destroy.rb +2 -1
  31. data/app/lib/actions/katello/repository/filtered_index_content.rb +2 -10
  32. data/app/lib/actions/katello/repository/import_upload.rb +0 -1
  33. data/app/lib/actions/katello/repository/sync.rb +0 -1
  34. data/app/lib/actions/katello/repository/update.rb +5 -3
  35. data/app/lib/actions/katello/repository/upload_files.rb +0 -1
  36. data/app/lib/actions/pulp3/abstract.rb +0 -6
  37. data/app/lib/actions/pulp3/content_view/delete_repository_references.rb +1 -2
  38. data/app/lib/actions/pulp3/content_view_version/create_syncable_export_history.rb +4 -0
  39. data/app/lib/actions/pulp3/orchestration/content_view_version/export.rb +1 -0
  40. data/app/lib/actions/pulp3/orchestration/content_view_version/export_repository.rb +7 -2
  41. data/app/lib/actions/pulp3/orchestration/content_view_version/syncable_export.rb +7 -2
  42. data/app/lib/actions/pulp3/repository/refresh_distribution.rb +1 -2
  43. data/app/lib/actions/pulp3/repository/save_distribution_references.rb +2 -2
  44. data/app/lib/katello/concerns/renderer_extensions.rb +1 -1
  45. data/app/lib/katello/event_daemon/runner.rb +12 -9
  46. data/app/lib/katello/resources/candlepin/consumer.rb +6 -6
  47. data/app/lib/katello/resources/candlepin/owner.rb +1 -1
  48. data/app/lib/katello/resources/candlepin/upstream_consumer.rb +3 -4
  49. data/app/lib/katello/resources/candlepin.rb +4 -4
  50. data/app/lib/katello/util/errata.rb +12 -10
  51. data/app/lib/katello/util/search.rb +0 -1
  52. data/app/lib/katello/validators/content_view_environment_org_validator.rb +5 -2
  53. data/app/lib/katello/validators/content_view_environment_validator.rb +1 -2
  54. data/app/lib/katello/validators/generated_content_view_validator.rb +16 -0
  55. data/app/mailers/katello/errata_mailer.rb +4 -2
  56. data/app/models/katello/alternate_content_source.rb +5 -1
  57. data/app/models/katello/concerns/content_facet_host_extensions.rb +25 -14
  58. data/app/models/katello/concerns/host_managed_extensions.rb +17 -8
  59. data/app/models/katello/concerns/redhat_extensions.rb +16 -6
  60. data/app/models/katello/concerns/smart_proxy_extensions.rb +0 -12
  61. data/app/models/katello/concerns/subscription_facet_host_extensions.rb +1 -0
  62. data/app/models/katello/content_view.rb +22 -5
  63. data/app/models/katello/content_view_environment.rb +11 -2
  64. data/app/models/katello/content_view_environment_content_facet.rb +9 -0
  65. data/app/models/katello/content_view_version.rb +10 -5
  66. data/app/models/katello/erratum.rb +6 -1
  67. data/app/models/katello/glue/candlepin/pool.rb +6 -0
  68. data/app/models/katello/glue/candlepin/product.rb +7 -1
  69. data/app/models/katello/glue/candlepin/subscription.rb +5 -0
  70. data/app/models/katello/glue/provider.rb +26 -26
  71. data/app/models/katello/host/content_facet.rb +106 -18
  72. data/app/models/katello/host/info_provider.rb +25 -21
  73. data/app/models/katello/host/subscription_facet.rb +18 -14
  74. data/app/models/katello/kt_environment.rb +12 -7
  75. data/app/models/katello/package_group.rb +0 -12
  76. data/app/models/katello/pool.rb +4 -1
  77. data/app/models/katello/product.rb +11 -1
  78. data/app/models/katello/repository.rb +11 -11
  79. data/app/models/katello/root_repository.rb +5 -4
  80. data/app/models/katello/task_status.rb +0 -18
  81. data/app/services/katello/candlepin/consumer.rb +2 -2
  82. data/app/services/katello/host/package_profile_uploader.rb +1 -1
  83. data/app/services/katello/product_content_finder.rb +11 -8
  84. data/app/services/katello/pulp3/content_view_version/export.rb +8 -65
  85. data/app/services/katello/pulp3/content_view_version/export_validation_error.rb +7 -0
  86. data/app/services/katello/pulp3/content_view_version/export_validator.rb +105 -0
  87. data/app/services/katello/pulp3/content_view_version/importable_products.rb +1 -1
  88. data/app/services/katello/pulp3/content_view_version/syncable_format_export.rb +7 -1
  89. data/app/services/katello/pulp3/erratum.rb +1 -0
  90. data/app/services/katello/pulp3/module_stream.rb +26 -11
  91. data/app/services/katello/pulp3/repository/yum.rb +2 -1
  92. data/app/services/katello/pulp3/smart_proxy_mirror_repository.rb +2 -1
  93. data/app/services/katello/registration_manager.rb +46 -26
  94. data/app/services/katello/repository_type.rb +3 -9
  95. data/app/services/katello/simple_package.rb +22 -0
  96. data/app/views/foreman/smart_proxies/_content_sync.html.erb +1 -0
  97. data/app/views/foreman/smart_proxies/_reclaim_space.html.erb +1 -0
  98. data/app/views/katello/api/v2/content_facet/base.json.rabl +23 -2
  99. data/app/views/katello/api/v2/content_facet/show.json.rabl +11 -8
  100. data/app/views/katello/api/v2/content_views/base.json.rabl +1 -1
  101. data/app/views/katello/api/v2/hosts/base.json.rabl +22 -2
  102. data/app/views/overrides/activation_keys/_host_environment_select.html.erb +2 -2
  103. data/config/initializers/monkeys.rb +0 -2
  104. data/config/routes/api/registry.rb +8 -7
  105. data/config/routes/api/v2.rb +0 -2
  106. data/config/routes.rb +3 -0
  107. data/db/migrate/20200429153103_installed_package_bad_nvrea.rb +1 -1
  108. data/db/migrate/20220228173251_remove_drpm_from_ignorable_content.rb +7 -3
  109. data/db/migrate/20220419193414_content_settings_to_dsl_category.rb +1 -1
  110. data/db/migrate/20220929204746_add_content_view_environment_content_facet.rb +52 -0
  111. data/db/migrate/20221123212341_remove_pulp_docker_registry_port_setting.rb +5 -0
  112. data/db/seeds.d/111-upgrade_tasks.rb +2 -1
  113. data/engines/bastion/app/assets/stylesheets/bastion/bastion.scss +4 -0
  114. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-details.controller.js +2 -4
  115. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-errata-modal.controller.js +0 -1
  116. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-details.controller.js +2 -4
  117. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts.html +2 -1
  118. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/apply-errata.controller.js +11 -3
  119. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/views/host-collection-hosts-list.html +1 -1
  120. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/bastion_katello.pot +8 -4
  121. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/de.po +5485 -0
  122. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/es.po +5397 -0
  123. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/fr.po +5658 -0
  124. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ja.po +5284 -0
  125. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ka.po +5231 -0
  126. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ko.po +5275 -0
  127. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/pt_BR.po +5389 -0
  128. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/zh_CN.po +5212 -0
  129. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/zh_TW.po +5145 -0
  130. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/translations.js +9 -0
  131. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/content-access-mode-banner.html +2 -2
  132. data/lib/katello/engine.rb +2 -1
  133. data/lib/katello/permission_creator.rb +2 -4
  134. data/lib/katello/permissions/registry_permissions.rb +5 -5
  135. data/lib/katello/plugin.rb +22 -14
  136. data/lib/katello/repository_types/README.md +136 -19
  137. data/lib/katello/repository_types/deb.rb +0 -1
  138. data/lib/katello/repository_types/docker.rb +0 -1
  139. data/lib/katello/repository_types/file.rb +0 -1
  140. data/lib/katello/repository_types/yum.rb +0 -4
  141. data/lib/katello/tasks/clean_candlepin_orphaned_products.rake +38 -0
  142. data/lib/katello/tasks/clean_orphaned_facets.rb +20 -0
  143. data/lib/katello/tasks/reimport.rake +1 -2
  144. data/lib/katello/tasks/repository.rake +1 -22
  145. data/lib/katello/tasks/reset.rake +1 -0
  146. data/lib/katello/tasks/upgrades/4.8/fix_incorrect_providers.rake +29 -0
  147. data/lib/katello/version.rb +1 -1
  148. data/lib/katello.rb +0 -5
  149. data/locale/bn/katello.po +69 -27
  150. data/locale/cs/katello.po +69 -27
  151. data/locale/de/katello.po +78 -36
  152. data/locale/en/katello.po +69 -27
  153. data/locale/es/katello.po +70 -28
  154. data/locale/fr/katello.po +73 -31
  155. data/locale/gu/katello.po +69 -27
  156. data/locale/hi/katello.po +69 -27
  157. data/locale/it/katello.po +69 -27
  158. data/locale/ja/katello.po +73 -31
  159. data/locale/ka/katello.po +73 -31
  160. data/locale/katello.pot +335 -262
  161. data/locale/kn/katello.po +69 -27
  162. data/locale/ko/katello.po +69 -27
  163. data/locale/mr/katello.po +69 -27
  164. data/locale/or/katello.po +69 -27
  165. data/locale/pa/katello.po +69 -27
  166. data/locale/pt/katello.po +69 -27
  167. data/locale/pt_BR/katello.po +70 -28
  168. data/locale/ru/katello.po +70 -28
  169. data/locale/ta/katello.po +69 -27
  170. data/locale/te/katello.po +69 -27
  171. data/locale/zh_CN/katello.po +73 -31
  172. data/locale/zh_TW/katello.po +70 -28
  173. data/webpack/components/Content/ContentPage.js +51 -35
  174. data/webpack/components/Content/__tests__/ContentPage.test.js +2 -4
  175. data/webpack/components/Content/__tests__/__snapshots__/ContentPage.test.js.snap +22 -3
  176. data/webpack/components/Table/EmptyStateMessage.js +14 -11
  177. data/webpack/components/Table/MainTable.js +36 -15
  178. data/webpack/components/Table/TableWrapper.js +25 -25
  179. data/webpack/components/Table/__test__/emptyStateMessage.test.js +51 -0
  180. data/webpack/components/extensions/HostDetails/Cards/ErrataOverviewCard.js +5 -4
  181. data/webpack/components/extensions/HostDetails/Cards/HostCollectionsCard/HostCollectionsModal.js +1 -1
  182. data/webpack/components/extensions/HostDetails/Cards/HostCollectionsCard/__tests__/hostCollectionsModal.test.js +1 -17
  183. data/webpack/components/extensions/HostDetails/Tabs/ErrataTab/ErrataTab.js +18 -9
  184. data/webpack/components/extensions/HostDetails/Tabs/ModuleStreamsTab/ModuleStreamsTab.js +1 -2
  185. data/webpack/components/extensions/HostDetails/Tabs/PackagesTab/PackageInstallModal.js +1 -2
  186. data/webpack/components/extensions/HostDetails/Tabs/PackagesTab/PackagesTab.js +1 -2
  187. data/webpack/components/extensions/HostDetails/Tabs/RepositorySetsTab/RepositorySetsTab.js +47 -27
  188. data/webpack/components/extensions/HostDetails/Tabs/TracesTab/TracesTab.js +1 -2
  189. data/webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js +2 -21
  190. data/webpack/components/extensions/HostDetails/Tabs/__tests__/moduleStreamsTab.test.js +1 -28
  191. data/webpack/components/extensions/HostDetails/Tabs/__tests__/packageInstallModal.test.js +1 -10
  192. data/webpack/components/extensions/HostDetails/Tabs/__tests__/packagesTab.test.js +1 -18
  193. data/webpack/components/extensions/HostDetails/Tabs/__tests__/repositorySetsTab.test.js +1 -17
  194. data/webpack/components/extensions/HostDetails/Tabs/__tests__/tracesTab.test.js +1 -15
  195. data/webpack/global_test_setup.js +1 -1
  196. data/webpack/scenes/AlternateContentSources/Create/ACSCreateWizard.js +12 -10
  197. data/webpack/scenes/AlternateContentSources/Create/Steps/ACSCredentials.js +6 -0
  198. data/webpack/scenes/AlternateContentSources/Create/Steps/ACSSmartProxies.js +1 -0
  199. data/webpack/scenes/AlternateContentSources/Create/Steps/AcsUrlPaths.js +3 -10
  200. data/webpack/scenes/AlternateContentSources/Create/Steps/NameACS.js +1 -0
  201. data/webpack/scenes/AlternateContentSources/Create/__tests__/acsCreate.test.js +3 -3
  202. data/webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditDetails.js +1 -0
  203. data/webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditURLPaths.js +12 -4
  204. data/webpack/scenes/AlternateContentSources/MainTable/ACSTable.js +7 -4
  205. data/webpack/scenes/AlternateContentSources/MainTable/__tests__/acsTable.test.js +4 -8
  206. data/webpack/scenes/AlternateContentSources/helpers.js +1 -1
  207. data/webpack/scenes/Content/Details/ContentRepositories.js +5 -4
  208. data/webpack/scenes/Content/Details/__tests__/contentDetail.test.js +1 -12
  209. data/webpack/scenes/Content/Table/ContentTable.js +2 -1
  210. data/webpack/scenes/Content/__tests__/contentTable.test.js +1 -14
  211. data/webpack/scenes/ContentViews/Delete/__tests__/contentViewDelete.test.js +1 -25
  212. data/webpack/scenes/ContentViews/Details/ComponentContentViews/ContentViewComponents.js +2 -1
  213. data/webpack/scenes/ContentViews/Details/ComponentContentViews/__tests__/contentViewComponents.test.js +44 -31
  214. data/webpack/scenes/ContentViews/Details/ContentViewDetails.js +2 -0
  215. data/webpack/scenes/ContentViews/Details/Filters/AffectedRepositories/AffectedRepositoryTable.js +6 -1
  216. data/webpack/scenes/ContentViews/Details/Filters/CVContainerImageFilterContent.js +2 -1
  217. data/webpack/scenes/ContentViews/Details/Filters/CVDebFilterContent.js +2 -1
  218. data/webpack/scenes/ContentViews/Details/Filters/CVErrataIDFilterContent.js +3 -1
  219. data/webpack/scenes/ContentViews/Details/Filters/CVModuleStreamFilterContent.js +3 -1
  220. data/webpack/scenes/ContentViews/Details/Filters/CVPackageGroupFilterContent.js +3 -1
  221. data/webpack/scenes/ContentViews/Details/Filters/CVRpmFilterContent.js +2 -1
  222. data/webpack/scenes/ContentViews/Details/Filters/ContentViewFilterDetailsHeader.js +2 -0
  223. data/webpack/scenes/ContentViews/Details/Filters/ContentViewFilters.js +2 -1
  224. data/webpack/scenes/ContentViews/Details/Filters/MatchContentModal/CVDebMatchContentModal.js +1 -1
  225. data/webpack/scenes/ContentViews/Details/Filters/MatchContentModal/CVRpmMatchContentModal.js +1 -1
  226. data/webpack/scenes/ContentViews/Details/Filters/MatchContentModal/__tests__/CVRpmMatchContentModal.test.js +35 -33
  227. data/webpack/scenes/ContentViews/Details/Filters/__tests__/CVContainerImageFilterContent.test.js +48 -45
  228. data/webpack/scenes/ContentViews/Details/Filters/__tests__/CVRpmFilterContent.test.js +58 -24
  229. data/webpack/scenes/ContentViews/Details/Filters/__tests__/ContentViewPackageGroupFilter.test.js +64 -0
  230. data/webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilterDetails.test.js +36 -20
  231. data/webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilters.test.js +40 -23
  232. data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvErrataIDFilter.test.js +0 -13
  233. data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvModuleStreamFilter.test.js +0 -13
  234. data/webpack/scenes/ContentViews/Details/Histories/ContentViewHistories.js +2 -1
  235. data/webpack/scenes/ContentViews/Details/Histories/__tests__/contentViewHistory.test.js +1 -10
  236. data/webpack/scenes/ContentViews/Details/Repositories/ContentViewRepositories.js +2 -1
  237. data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewAddRemove.test.js +1 -10
  238. data/webpack/scenes/ContentViews/Details/Versions/Compare/CVVersionCompareConfig.js +21 -9
  239. data/webpack/scenes/ContentViews/Details/Versions/Compare/CVVersionCompareTable.js +4 -0
  240. data/webpack/scenes/ContentViews/Details/Versions/Compare/__tests__/CVVersionCompare.test.js +1 -32
  241. data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersions.js +3 -1
  242. data/webpack/scenes/ContentViews/Details/Versions/Delete/__tests__/cvVersionRemove.test.js +1 -15
  243. data/webpack/scenes/ContentViews/Details/Versions/Delete/affectedActivationKeys.js +1 -1
  244. data/webpack/scenes/ContentViews/Details/Versions/Delete/affectedHosts.js +1 -2
  245. data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionDetailConfig.js +31 -9
  246. data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionDetailsTable.js +4 -0
  247. data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionDetails.test.js +30 -14
  248. data/webpack/scenes/ContentViews/Table/ContentViewsTable.js +1 -1
  249. data/webpack/scenes/ContentViews/__tests__/contentViewPage.test.js +55 -120
  250. data/webpack/scenes/ContentViews/components/WizardHeader.js +1 -1
  251. data/webpack/scenes/ContentViews/expansions/RelatedContentViewComponentsModal.js +1 -1
  252. data/webpack/scenes/ContentViews/expansions/__tests__/contentViewComponentsModal.test.js +8 -1
  253. data/webpack/scenes/ModuleStreams/ModuleStreamsPage.js +3 -9
  254. data/webpack/scenes/ModuleStreams/__tests__/__snapshots__/ModuleStreamPage.test.js.snap +7 -1
  255. data/webpack/scenes/RedHatRepositories/components/Search.js +22 -16
  256. data/webpack/scenes/RedHatRepositories/index.scss +20 -1
  257. data/webpack/scenes/SmartProxy/SmartProxyContentTable.js +12 -1
  258. data/webpack/scenes/Subscriptions/Manifest/CdnConfigurationTab/CdnTypeForm.js +1 -1
  259. data/webpack/scenes/Subscriptions/Manifest/CdnConfigurationTab/CustomCdnTypeForm.js +1 -1
  260. data/webpack/scenes/Subscriptions/SubscriptionsPage.js +21 -19
  261. data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsPage.test.js.snap +34 -1
  262. data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/SubscriptionsToolbar.js +20 -7
  263. data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/SubscriptionsToolbar.test.js +0 -1
  264. data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/__snapshots__/SubscriptionsToolbar.test.js.snap +65 -15
  265. metadata +47 -113
  266. data/app/lib/actions/katello/pulp_selector.rb +0 -24
  267. data/app/lib/actions/katello/repository/correct_checksum.rb +0 -24
  268. data/app/lib/actions/katello/repository/destroy_package_group.rb +0 -26
  269. data/app/lib/actions/katello/repository/upload_package_group.rb +0 -24
  270. data/app/lib/actions/pulp/abstract.rb +0 -37
  271. data/app/lib/actions/pulp/abstract_async_task.rb +0 -154
  272. data/app/lib/actions/pulp/abstract_async_task_group.rb +0 -94
  273. data/app/lib/actions/pulp/consumer/sync_capsule.rb +0 -45
  274. data/app/lib/actions/pulp/consumer/unassociate_units.rb +0 -20
  275. data/app/lib/actions/pulp/expect_one_task.rb +0 -11
  276. data/app/lib/actions/pulp/orchestration/orphan_cleanup/remove_orphans.rb +0 -16
  277. data/app/lib/actions/pulp/orchestration/repository/copy_all_units.rb +0 -19
  278. data/app/lib/actions/pulp/orchestration/repository/delete.rb +0 -15
  279. data/app/lib/actions/pulp/orchestration/repository/refresh.rb +0 -14
  280. data/app/lib/actions/pulp/orchestration/repository/refresh_if_needed.rb +0 -13
  281. data/app/lib/actions/pulp/orchestration/repository/refresh_repos.rb +0 -19
  282. data/app/lib/actions/pulp/orchestration/repository/remove_units.rb +0 -14
  283. data/app/lib/actions/pulp/orchestration/repository/smart_proxy_sync.rb +0 -34
  284. data/app/lib/actions/pulp/orchestration/repository/sync.rb +0 -18
  285. data/app/lib/actions/pulp/orchestration/repository/upload_content.rb +0 -37
  286. data/app/lib/actions/pulp/orphan_cleanup/remove_orphans.rb +0 -15
  287. data/app/lib/actions/pulp/orphan_cleanup/remove_unneeded_repos.rb +0 -16
  288. data/app/lib/actions/pulp/repository/abstract_copy_content.rb +0 -45
  289. data/app/lib/actions/pulp/repository/abstract_remove_content.rb +0 -32
  290. data/app/lib/actions/pulp/repository/clear.rb +0 -18
  291. data/app/lib/actions/pulp/repository/copy_all_units.rb +0 -30
  292. data/app/lib/actions/pulp/repository/copy_units.rb +0 -25
  293. data/app/lib/actions/pulp/repository/create.rb +0 -28
  294. data/app/lib/actions/pulp/repository/create_in_plan.rb +0 -15
  295. data/app/lib/actions/pulp/repository/create_upload_request.rb +0 -20
  296. data/app/lib/actions/pulp/repository/delete_upload_request.rb +0 -19
  297. data/app/lib/actions/pulp/repository/destroy.rb +0 -28
  298. data/app/lib/actions/pulp/repository/distributor_publish.rb +0 -25
  299. data/app/lib/actions/pulp/repository/download.rb +0 -16
  300. data/app/lib/actions/pulp/repository/import_upload.rb +0 -19
  301. data/app/lib/actions/pulp/repository/presenters/abstract_sync_presenter.rb +0 -47
  302. data/app/lib/actions/pulp/repository/presenters/deb_presenter.rb +0 -95
  303. data/app/lib/actions/pulp/repository/presenters/docker_presenter.rb +0 -103
  304. data/app/lib/actions/pulp/repository/presenters/file_unit_presenter.rb +0 -42
  305. data/app/lib/actions/pulp/repository/presenters/yum_presenter.rb +0 -131
  306. data/app/lib/actions/pulp/repository/refresh.rb +0 -21
  307. data/app/lib/actions/pulp/repository/regenerate_applicability.rb +0 -21
  308. data/app/lib/actions/pulp/repository/remove_distribution.rb +0 -11
  309. data/app/lib/actions/pulp/repository/remove_units.rb +0 -44
  310. data/app/lib/actions/pulp/repository/sync.rb +0 -99
  311. data/app/lib/actions/pulp/repository/upload_file.rb +0 -28
  312. data/app/lib/actions/pulp/repository_group/create.rb +0 -31
  313. data/app/lib/actions/pulp/repository_group/delete.rb +0 -17
  314. data/app/lib/actions/pulp/repository_group/export.rb +0 -51
  315. data/app/lib/katello/util/package_clause_generator.rb +0 -77
  316. data/app/models/katello/glue/pulp/pulp_errors.rb +0 -9
  317. data/app/models/katello/glue/pulp/repo.rb +0 -353
  318. data/app/models/katello/pulp_sync_status.rb +0 -165
  319. data/app/models/katello/pulp_task_status.rb +0 -63
  320. data/app/services/katello/pulp/content.rb +0 -24
  321. data/app/services/katello/pulp/importer_comparison.rb +0 -28
  322. data/app/services/katello/pulp/repository/deb.rb +0 -61
  323. data/app/services/katello/pulp/repository/docker.rb +0 -82
  324. data/app/services/katello/pulp/repository/file.rb +0 -52
  325. data/app/services/katello/pulp/repository/yum.rb +0 -205
  326. data/app/services/katello/pulp/repository.rb +0 -327
  327. data/app/services/katello/pulp/server.rb +0 -35
  328. data/app/services/katello/pulp/simple_package.rb +0 -24
  329. data/app/services/katello/pulp/smart_proxy_repository.rb +0 -52
  330. data/lib/monkeys/fix_deb_optimized_sync.rb +0 -35
  331. data/lib/monkeys/fix_pulp_container_path.rb +0 -35
  332. data/locale/zanata.xml +0 -30
  333. data/webpack/scenes/ContentViews/Details/Filters/MatchContentModal/__tests__/CVRpmMatchContentSearch.fixtures.json +0 -33
@@ -1,154 +0,0 @@
1
- module Actions
2
- module Pulp
3
- class AbstractAsyncTask < Pulp::Abstract
4
- include Actions::Base::Polling
5
- include ::Dynflow::Action::Cancellable
6
-
7
- FINISHED_STATES = %w(finished error canceled skipped).freeze
8
-
9
- # A call report (documented http://pulp-dev-guide.readthedocs.org/en/latest/conventions/sync-v-async.html)
10
- # Looks like: {
11
- # "result": {},
12
- # "error": {},
13
- # "spawned_tasks": [{"_href": "/pulp/api/v2/tasks/7744e2df-39b9-46f0-bb10-feffa2f7014b/",
14
- # "task_id": "7744e2df-39b9-46f0-bb10-feffa2f7014b" }]
15
- # }
16
- #
17
- #
18
-
19
- # A Task (documented http://pulp-dev-guide.readthedocs.org/en/latest/integration/rest-api/dispatch/task.html#task-management)
20
- # Looks like:
21
- # {
22
- # "_href": "/pulp/api/v2/tasks/0fe4fcab-a040-11e1-a71c-00508d977dff/",
23
- # "state": "running",
24
- # "queue": "reserved_resource_worker-0@your.domain.com",
25
- # "task_id": "0fe4fcab-a040-11e1-a71c-00508d977dff",
26
- # "task_type": "pulp.server.tasks.repository.sync_with_auto_publish",
27
- # "progress_report": {}, # contents depend on the operation
28
- # "result": null,
29
- # "start_time": "2012-05-17T16:48:00Z",
30
- # "finish_time": null,
31
- # "exception": null,
32
- # "traceback": null,
33
- # "tags": [
34
- # "pulp:repository:f16",
35
- # "pulp:action:sync"
36
- # ],
37
- # "spawned_tasks": [{"href": "/pulp/api/v2/tasks/7744e2df-39b9-46f0-bb10-feffa2f7014b/",
38
- # "task_id": "7744e2df-39b9-46f0-bb10-feffa2f7014b" }],
39
- # "error": null
40
- #}
41
-
42
- def run(event = nil)
43
- # do nothing when the action is being skipped
44
- unless event == Dynflow::Action::Skip
45
- super
46
- end
47
- end
48
-
49
- def humanized_state
50
- case state
51
- when :running
52
- if self.external_task.nil?
53
- _("initiating Pulp task")
54
- else
55
- _("checking Pulp task status")
56
- end
57
- when :suspended
58
- if external_task&.all? { |task| task[:start_time].nil? }
59
- _("waiting for Pulp to start the task")
60
- else
61
- _("waiting for Pulp to finish the task")
62
- end
63
- else
64
- super
65
- end
66
- end
67
-
68
- def done?
69
- external_task&.all? { |task| task[:finish_time] || FINISHED_STATES.include?(task[:state]) }
70
- end
71
-
72
- def external_task
73
- output[:pulp_tasks]
74
- end
75
-
76
- def cancel!
77
- output[:cancelled] = true
78
- cancel
79
- self.external_task = poll_external_task
80
- # We suspend the action and the polling will take care of finding
81
- # out if the cancelling was successful
82
- suspend unless done?
83
- end
84
-
85
- def cancel
86
- output[:pulp_tasks].each do |pulp_task|
87
- task_resource.cancel(pulp_task['task_id'])
88
- #the main task may have completed, so cancel spawned tasks too
89
- pulp_task['spawned_tasks']&.each { |spawned| task_resource.cancel(spawned['task_id']) }
90
- end
91
- end
92
-
93
- def rescue_external_task(error)
94
- if error.is_a?(::Katello::Errors::PulpError)
95
- fail error
96
- else
97
- super
98
- end
99
- end
100
-
101
- private
102
-
103
- def external_task=(external_task_data)
104
- external_task_data = [] if external_task_data.nil?
105
- external_task_data = [external_task_data] if external_task_data.is_a?(Hash)
106
-
107
- new_tasks = []
108
- external_task_data.each do |task|
109
- if task['spawned_tasks'].length > 0
110
- spawned_ids = task['spawned_tasks'].map { |spawned| spawned['task_id'] }
111
- new_tasks.concat(get_new_tasks(external_task_data, spawned_ids))
112
- end
113
- end
114
-
115
- # Combine new tasks and remove call reports and ignored tasks
116
- output[:pulp_tasks] = (external_task_data + new_tasks).reject do |task|
117
- task["task_id"].nil? || (task["tags"] && (task["tags"] & ignored_tags).present?)
118
- end
119
- output[:pulp_tasks].each do |pulp_task|
120
- if (pulp_exception = ::Katello::Errors::PulpError.from_task(pulp_task))
121
- fail pulp_exception
122
- end
123
- end
124
- end
125
-
126
- def get_new_tasks(current_list, spawned_task_ids)
127
- new_tasks = (spawned_task_ids - current_list.map { |task| task['task_id'] }).map do |task_id|
128
- task_resource.poll(task_id)
129
- end
130
-
131
- if new_tasks.empty?
132
- []
133
- else
134
- spawned = new_tasks.map { |t| t['spawned_tasks'].map { |st| st['task_id'] } }.flatten
135
- new_tasks + get_new_tasks(current_list + new_tasks, spawned)
136
- end
137
- end
138
-
139
- def poll_external_task
140
- external_task.map do |task|
141
- task_resource.poll(task[:task_id])
142
- end
143
- end
144
-
145
- def task_resource
146
- pulp_resources.task
147
- end
148
-
149
- def ignored_tags
150
- []
151
- end
152
- end
153
- end
154
- end
@@ -1,94 +0,0 @@
1
- module Actions
2
- module Pulp
3
- class AbstractAsyncTaskGroup < Pulp::Abstract
4
- include Actions::Base::Polling
5
- include ::Dynflow::Action::Cancellable
6
-
7
- # A call report (documented https://github.com/pulp/pulp/blob/master/docs/dev-guide/integration/rest-api/consumer/applicability.rst#id65)
8
- # Looks like:
9
- # {
10
- # "_href": "/pulp/api/v2/task_groups/7744e2df-39b9-46f0-bb10-feffa2f7014b/",
11
- # "group_id": "7744e2df-39b9-46f0-bb10-feffa2f7014b"
12
- # }
13
- #
14
- # A TaskGroup (https://github.com/pulp/pulp/blob/master/docs/dev-guide/integration/rest-api/tasks.rst#task-group-management)
15
- # Looks like:
16
- # {
17
- # "accepted": 0,
18
- # "finished": 100,
19
- # "running": 4,
20
- # "canceled": 0,
21
- # "waiting": 2,
22
- # "skipped": 0,
23
- # "suspended": 0,
24
- # "error": 0,
25
- # "total": 106
26
- # }
27
-
28
- def run(event = nil)
29
- # do nothing when the action is being skipped
30
- unless event == Dynflow::Action::Skip
31
- super
32
- end
33
- end
34
-
35
- def cancel!
36
- cancel
37
- self.external_task = poll_external_task
38
- # We suspend the action and the polling will take care of finding
39
- # out if the cancelling was successful
40
- suspend unless done?
41
- end
42
-
43
- def cancel
44
- group = output['pulp_task_group']
45
- if group
46
- task_resource.cancel(group['id'])
47
- end
48
- rescue RestClient::ResourceNotFound
49
- nil #Pulp throws a 404 if there are no tasks in the task group https://pulp.plan.io/issues/2943
50
- end
51
-
52
- def humanized_state
53
- case state
54
- when :running
55
- if self.external_task.nil?
56
- _("initiating Pulp task")
57
- else
58
- _("checking Pulp task status")
59
- end
60
- else
61
- super
62
- end
63
- end
64
-
65
- def done?
66
- finishing_states = ["finished", "canceled", "skipped", "suspended", "error"]
67
- return false if (finishing_states - external_task.keys).present?
68
- task_resource.completed?(external_task)
69
- end
70
-
71
- def external_task
72
- output["pulp_task_group"]
73
- end
74
-
75
- private
76
-
77
- def external_task=(external_task_data)
78
- if external_task_data.key?("group_id")
79
- output["pulp_task_group"] = {"group_id" => external_task_data["group_id"]}
80
- else
81
- output["pulp_task_group"] = {"group_id" => output["pulp_task_group"]["group_id"]}.merge(external_task_data)
82
- end
83
- end
84
-
85
- def poll_external_task
86
- task_resource.summary(output["pulp_task_group"]["group_id"])
87
- end
88
-
89
- def task_resource
90
- ::Katello.pulp_server.resources.task_group
91
- end
92
- end
93
- end
94
- end
@@ -1,45 +0,0 @@
1
- module Actions
2
- module Pulp
3
- module Consumer
4
- class SyncCapsule < ::Actions::Pulp::AbstractAsyncTask
5
- include ::Actions::Helpers::SmartProxySyncHistoryHelper
6
- input_format do
7
- param :capsule_id, Integer
8
- param :repo_pulp_id, String
9
- param :repository_id, Integer
10
- param :sync_options
11
- end
12
-
13
- def plan(repository, smart_proxy, options)
14
- plan_self(:capsule_id => smart_proxy.id, :repo_pulp_id => repository.pulp_id, :repository_id => repository.id, :sync_options => options)
15
- end
16
-
17
- def humanized_name
18
- _("Synchronize capsule content")
19
- end
20
-
21
- def invoke_external_task
22
- output[:pulp_tasks] = pulp_resources.repository.sync(input[:repo_pulp_id], override_config: input[:sync_options])
23
- end
24
-
25
- def run_progress
26
- # override this method so this task's progress isn't 0.5
27
- # when it is initiated, skewing the progress bar progress
28
- self.done? ? 1 : 0.1
29
- end
30
-
31
- def rescue_strategy_for_self
32
- if output[:cancelled]
33
- Dynflow::Action::Rescue::Fail
34
- else
35
- Dynflow::Action::Rescue::Skip
36
- end
37
- end
38
-
39
- def run_progress_weight
40
- 100
41
- end
42
- end
43
- end
44
- end
45
- end
@@ -1,20 +0,0 @@
1
- module Actions
2
- module Pulp
3
- module Consumer
4
- class UnassociateUnits < ::Actions::Pulp::AbstractAsyncTask
5
- input_format do
6
- param :capsule_id, Integer
7
- param :repo_pulp_id, String
8
- end
9
-
10
- def humanized_name
11
- _("Unassociate units in repository")
12
- end
13
-
14
- def invoke_external_task
15
- pulp_resources.repository.unassociate_units(input[:repo_pulp_id])
16
- end
17
- end
18
- end
19
- end
20
- end
@@ -1,11 +0,0 @@
1
- module Actions
2
- module Pulp
3
- module ExpectOneTask
4
- def external_task=(external_task_data)
5
- external_task_data = [external_task_data] unless external_task_data.is_a?(Array)
6
- fail "Not expecting more than one task" if external_task_data.length > 1
7
- super(external_task_data)
8
- end
9
- end
10
- end
11
- end
@@ -1,16 +0,0 @@
1
- module Actions
2
- module Pulp
3
- module Orchestration
4
- module OrphanCleanup
5
- class RemoveOrphans < Pulp::Abstract
6
- def plan(proxy)
7
- sequence do
8
- plan_action(Actions::Pulp::OrphanCleanup::RemoveUnneededRepos, proxy) unless proxy.pulp_primary?
9
- plan_action(Actions::Pulp::OrphanCleanup::RemoveOrphans, proxy)
10
- end
11
- end
12
- end
13
- end
14
- end
15
- end
16
- end
@@ -1,19 +0,0 @@
1
- module Actions
2
- module Pulp
3
- module Orchestration
4
- module Repository
5
- class CopyAllUnits < Pulp::Abstract
6
- def plan(target_repo, smart_proxy, source_repos, options = {})
7
- source_repos.each do |source_repo|
8
- plan_action(Pulp::Repository::CopyAllUnits,
9
- target_repo,
10
- smart_proxy,
11
- source_repo,
12
- options)
13
- end
14
- end
15
- end
16
- end
17
- end
18
- end
19
- end
@@ -1,15 +0,0 @@
1
- module Actions
2
- module Pulp
3
- module Orchestration
4
- module Repository
5
- class Delete < Pulp::Abstract
6
- def plan(repository, _smart_proxy)
7
- sequence do
8
- plan_action(Pulp::Repository::Destroy, repository_id: repository.id)
9
- end
10
- end
11
- end
12
- end
13
- end
14
- end
15
- end
@@ -1,14 +0,0 @@
1
- module Actions
2
- module Pulp
3
- module Orchestration
4
- module Repository
5
- class Refresh < Pulp::Abstract
6
- def plan(repository, smart_proxy, options = {})
7
- options[:capsule_id] = smart_proxy.id
8
- plan_action(Actions::Pulp::Repository::Refresh, repository, options)
9
- end
10
- end
11
- end
12
- end
13
- end
14
- end
@@ -1,13 +0,0 @@
1
- module Actions
2
- module Pulp
3
- module Orchestration
4
- module Repository
5
- class RefreshIfNeeded < Pulp::Abstract
6
- def plan(repository, smart_proxy, _options = {})
7
- plan_action(Actions::Pulp::Repository::Refresh, repository, smart_proxy_id: smart_proxy.id)
8
- end
9
- end
10
- end
11
- end
12
- end
13
- end
@@ -1,19 +0,0 @@
1
- module Actions
2
- module Pulp
3
- module Orchestration
4
- module Repository
5
- class RefreshRepos < Pulp::AbstractAsyncTask
6
- include ::Actions::Katello::CapsuleContent::RefreshRepos
7
-
8
- def fetch_proxy_service(smart_proxy)
9
- ::Katello::Pulp::SmartProxyRepository.new(smart_proxy)
10
- end
11
-
12
- def act_on_repo?(repo, smart_proxy)
13
- !smart_proxy.pulp3_support?(repo)
14
- end
15
- end
16
- end
17
- end
18
- end
19
- end
@@ -1,14 +0,0 @@
1
- module Actions
2
- module Pulp
3
- module Orchestration
4
- module Repository
5
- class RemoveUnits < Pulp::Abstract
6
- def plan(repository, _smart_proxy, options)
7
- options[:repo_id] = repository.id
8
- plan_action(Actions::Pulp::Repository::RemoveUnits, options)
9
- end
10
- end
11
- end
12
- end
13
- end
14
- end
@@ -1,34 +0,0 @@
1
- module Actions
2
- module Pulp
3
- module Orchestration
4
- module Repository
5
- class SmartProxySync < Pulp::Abstract
6
- def plan(repository, smart_proxy, options)
7
- skip_metadata_check = options.fetch(:skip_metadata_check, false)
8
- sequence do
9
- if repository && ['yum', 'puppet'].exclude?(repository.content_type)
10
- # we unassociate units in non-yum/puppet repos in order to avoid version conflicts
11
- # during publish. (i.e. two versions of a unit in the same repository)
12
- plan_action(Pulp::Consumer::UnassociateUnits,
13
- capsule_id: smart_proxy.id,
14
- repo_pulp_id: repository.pulp_id)
15
- end
16
- pulp_options = { remove_missing: repository && ["deb", "puppet", "yum"].include?(repository.content_type) }
17
- pulp_options[:force_full] = true if skip_metadata_check && repository.content_type == "yum"
18
- pulp_options[:repair_sync] = true if skip_metadata_check && repository.content_type == "deb"
19
-
20
- plan_action(Pulp::Consumer::SyncCapsule,
21
- repository, smart_proxy, pulp_options)
22
- if skip_metadata_check
23
- plan_action(Katello::Repository::MetadataGenerate,
24
- repository,
25
- smart_proxy: smart_proxy,
26
- force: true)
27
- end
28
- end
29
- end
30
- end
31
- end
32
- end
33
- end
34
- end
@@ -1,18 +0,0 @@
1
- module Actions
2
- module Pulp
3
- module Orchestration
4
- module Repository
5
- class Sync < Pulp::Abstract
6
- include Actions::Helpers::OutputPropagator
7
- def plan(repository, smart_proxy, options)
8
- sequence do
9
- options.merge!(:repo_id => repository.id, :smart_proxy_id => smart_proxy.id)
10
- action_output = plan_action(Actions::Pulp::Repository::Sync, options).output
11
- plan_self(:subaction_output => action_output)
12
- end
13
- end
14
- end
15
- end
16
- end
17
- end
18
- end
@@ -1,37 +0,0 @@
1
- module Actions
2
- module Pulp
3
- module Orchestration
4
- module Repository
5
- class UploadContent < Pulp::Abstract
6
- include Actions::Helpers::OutputPropagator
7
- def plan(repository, smart_proxy, file, unit_type_id)
8
- sequence do
9
- upload_request = plan_action(Pulp::Repository::CreateUploadRequest)
10
- plan_action(Pulp::Repository::UploadFile,
11
- upload_id: upload_request.output[:upload_id],
12
- file: file[:path])
13
- plan_action(Pulp::Repository::ImportUpload,
14
- repository, smart_proxy,
15
- pulp_id: repository.pulp_id,
16
- unit_type_id: unit_type_id,
17
- unit_key: unit_key(file, repository),
18
- upload_id: upload_request.output[:upload_id])
19
- plan_action(Pulp::Repository::DeleteUploadRequest,
20
- upload_id: upload_request.output[:upload_id])
21
- plan_self(:subaction_output => nil)
22
- end
23
- end
24
-
25
- def unit_key(file, repository)
26
- return {} unless repository.file?
27
- {
28
- :checksum => Digest::SHA256.hexdigest(File.read(file[:path])),
29
- :name => file[:filename],
30
- :size => File.size(file[:path])
31
- }
32
- end
33
- end
34
- end
35
- end
36
- end
37
- end
@@ -1,15 +0,0 @@
1
- module Actions
2
- module Pulp
3
- module OrphanCleanup
4
- class RemoveOrphans < Pulp::AbstractAsyncTask
5
- def plan(proxy)
6
- plan_self(:capsule_id => proxy.id)
7
- end
8
-
9
- def invoke_external_task
10
- pulp_resources.content.remove_orphans
11
- end
12
- end
13
- end
14
- end
15
- end
@@ -1,16 +0,0 @@
1
- module Actions
2
- module Pulp
3
- module OrphanCleanup
4
- class RemoveUnneededRepos < Pulp::AbstractAsyncTask
5
- def plan(smart_proxy)
6
- plan_self(:smart_proxy_id => smart_proxy.id)
7
- end
8
-
9
- def invoke_external_task
10
- smart_proxy_service = ::Katello::Pulp::SmartProxyRepository.new(::SmartProxy.unscoped.find(input[:smart_proxy_id]))
11
- smart_proxy_service.delete_orphaned_repos
12
- end
13
- end
14
- end
15
- end
16
- end
@@ -1,45 +0,0 @@
1
- module Actions
2
- module Pulp
3
- module Repository
4
- class AbstractCopyContent < Pulp::AbstractAsyncTask
5
- input_format do
6
- param :source_pulp_id
7
- param :target_pulp_id
8
- param :clauses
9
- param :full_clauses
10
- param :override_config
11
- param :include_result
12
- end
13
-
14
- # @api override - pulp extension representing the content type to copy
15
- def content_extension
16
- fail NotImplementedError
17
- end
18
-
19
- def invoke_external_task
20
- optional = criteria
21
- optional[:override_config] = input[:override_config] if input[:override_config]
22
- content_extension.copy(input[:source_pulp_id],
23
- input[:target_pulp_id],
24
- optional)
25
- end
26
-
27
- def criteria
28
- if input[:full_clauses]
29
- input[:full_clauses]
30
- elsif input[:clauses]
31
- { filters: {:unit => input[:clauses] } }
32
- else
33
- {}
34
- end
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
- external_task_data = external_task_data.map { |task| task.except('result') } unless input[:include_result]
40
- super(external_task_data)
41
- end
42
- end
43
- end
44
- end
45
- end
@@ -1,32 +0,0 @@
1
- module Actions
2
- module Pulp
3
- module Repository
4
- class AbstractRemoveContent < Pulp::AbstractAsyncTask
5
- input_format do
6
- param :pulp_id
7
- param :clauses
8
- end
9
-
10
- def invoke_external_task
11
- pulp_extensions.repository.unassociate_units(input[:pulp_id],
12
- criteria)
13
- end
14
-
15
- # @api override - pulp extension representing the content to remove
16
- # e.g. pulp.extensions.rpm
17
- def content_extension
18
- fail NotImplementedError
19
- end
20
-
21
- def criteria
22
- { type_ids: [content_extension.content_type], filters: input[:clauses] }
23
- end
24
-
25
- def external_task=(external_task_data)
26
- external_task_data = [external_task_data] if external_task_data.is_a?(Hash)
27
- super(external_task_data.map { |task| task.except('result') })
28
- end
29
- end
30
- end
31
- end
32
- end
@@ -1,18 +0,0 @@
1
- module Actions
2
- module Pulp
3
- module Repository
4
- class Clear < Actions::Pulp::AbstractAsyncTask
5
- def plan(repo, smart_proxy)
6
- plan_self(:repo_id => repo.id, :smart_proxy_id => smart_proxy.id) unless (repo.yum? || repo.empty_in_pulp?)
7
- end
8
-
9
- def invoke_external_task
10
- repo = ::Katello::Repository.find(input[:repo_id])
11
- ::Katello::RepositoryTypeManager.find(repo.content_type).content_types.map do |type|
12
- ::SmartProxy.unscoped.find(input[:smart_proxy_id]).content_service(type).remove(repo)
13
- end
14
- end
15
- end
16
- end
17
- end
18
- end