katello 3.10.2 → 3.11.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 (242) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/katello/api/registry/registry_proxies_controller.rb +16 -22
  3. data/app/controllers/katello/api/v2/content_uploads_controller.rb +4 -7
  4. data/app/controllers/katello/api/v2/content_view_puppet_modules_controller.rb +4 -5
  5. data/app/controllers/katello/api/v2/content_view_versions_controller.rb +4 -4
  6. data/app/controllers/katello/api/v2/content_views_controller.rb +3 -3
  7. data/app/controllers/katello/api/v2/docker_manifests_controller.rb +1 -1
  8. data/app/controllers/katello/api/v2/errata_controller.rb +2 -2
  9. data/app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb +1 -3
  10. data/app/controllers/katello/api/v2/package_groups_controller.rb +3 -3
  11. data/app/controllers/katello/api/v2/repositories_controller.rb +5 -24
  12. data/app/controllers/katello/api/v2/repository_sets_controller.rb +1 -1
  13. data/app/controllers/katello/application_controller.rb +4 -4
  14. data/app/controllers/katello/concerns/api/v2/repository_content_controller.rb +1 -1
  15. data/app/controllers/katello/sync_management_controller.rb +1 -1
  16. data/app/helpers/katello/errata_mailer_helper.rb +1 -1
  17. data/app/helpers/katello/sync_management_helper.rb +1 -1
  18. data/app/lib/actions/candlepin/environment/add_content_to_environment.rb +18 -0
  19. data/app/lib/actions/katello/content_view_puppet_environment/clone.rb +1 -4
  20. data/app/lib/actions/katello/content_view_puppet_environment/clone_content_for_version.rb +20 -0
  21. data/app/lib/actions/katello/content_view_puppet_environment/create_for_version.rb +3 -2
  22. data/app/lib/actions/katello/content_view_version/incremental_update.rb +15 -16
  23. data/app/lib/actions/katello/host/hypervisors_update.rb +17 -6
  24. data/app/lib/actions/katello/organization/manifest_delete.rb +1 -3
  25. data/app/lib/actions/katello/organization/manifest_import.rb +1 -3
  26. data/app/lib/actions/katello/organization/manifest_refresh.rb +1 -3
  27. data/app/lib/actions/katello/provider/update.rb +1 -1
  28. data/app/lib/actions/katello/repository/check_matching_content.rb +8 -2
  29. data/app/lib/actions/katello/repository/clone_contents.rb +52 -0
  30. data/app/lib/actions/katello/repository/clone_to_environment.rb +1 -11
  31. data/app/lib/actions/katello/repository/clone_to_version.rb +19 -29
  32. data/app/lib/actions/katello/repository/create.rb +3 -4
  33. data/app/lib/actions/katello/repository/export.rb +1 -2
  34. data/app/lib/actions/katello/repository/import_upload.rb +7 -5
  35. data/app/lib/actions/katello/repository/purge_empty_content.rb +16 -0
  36. data/app/lib/actions/katello/repository/remove_content.rb +2 -2
  37. data/app/lib/actions/katello/repository/sync.rb +1 -1
  38. data/app/lib/actions/pulp/content_view_puppet_environment/copy_contents.rb +36 -0
  39. data/app/lib/actions/pulp/repository/copy_all_units.rb +27 -0
  40. data/app/lib/actions/pulp/repository/copy_units.rb +29 -0
  41. data/app/lib/actions/pulp/repository/refresh.rb +3 -7
  42. data/app/lib/actions/pulp/repository/regenerate_applicability.rb +5 -2
  43. data/app/lib/katello/concerns/renderer_extensions.rb +1 -1
  44. data/app/lib/katello/http_resource.rb +5 -1
  45. data/app/lib/katello/resources/candlepin/consumer.rb +9 -0
  46. data/app/lib/katello/resources/candlepin/content.rb +2 -3
  47. data/app/lib/katello/util/cdn_var_substitutor.rb +1 -2
  48. data/app/lib/katello/util/path_with_substitutions.rb +18 -1
  49. data/app/lib/katello/validators/content_view_puppet_module_validator.rb +2 -2
  50. data/app/lib/katello/validators/environment_docker_repositories_validator.rb +7 -5
  51. data/app/models/katello/concerns/hostgroup_extensions.rb +2 -7
  52. data/app/models/katello/concerns/organization_extensions.rb +11 -1
  53. data/app/models/katello/concerns/pulp_database_unit.rb +40 -24
  54. data/app/models/katello/concerns/redhat_extensions.rb +7 -3
  55. data/app/models/katello/content_view.rb +5 -7
  56. data/app/models/katello/content_view_docker_filter.rb +3 -3
  57. data/app/models/katello/content_view_puppet_environment.rb +1 -1
  58. data/app/models/katello/content_view_puppet_module.rb +2 -3
  59. data/app/models/katello/docker_meta_tag.rb +1 -1
  60. data/app/models/katello/docker_tag.rb +4 -6
  61. data/app/models/katello/erratum.rb +1 -1
  62. data/app/models/katello/glue/pulp/repo.rb +3 -0
  63. data/app/models/katello/glue/pulp/repos.rb +4 -0
  64. data/app/models/katello/host/info_provider.rb +2 -2
  65. data/app/models/katello/host/subscription_facet.rb +0 -1
  66. data/app/models/katello/module_stream.rb +10 -4
  67. data/app/models/katello/ostree_branch.rb +4 -2
  68. data/app/models/katello/package_group.rb +2 -2
  69. data/app/models/katello/ping.rb +1 -1
  70. data/app/models/katello/puppet_module.rb +3 -3
  71. data/app/models/katello/repository.rb +15 -2
  72. data/app/models/katello/root_repository.rb +10 -0
  73. data/app/models/katello/yum_metadata_file.rb +46 -0
  74. data/app/services/katello/abstract/pulp/content.rb +19 -0
  75. data/app/services/katello/applicable_content_helper.rb +5 -5
  76. data/app/services/katello/pulp/content.rb +17 -0
  77. data/app/services/katello/pulp/repository.rb +45 -15
  78. data/app/services/katello/pulp/repository/deb.rb +8 -0
  79. data/app/services/katello/pulp/repository/docker.rb +19 -0
  80. data/app/services/katello/pulp/repository/file.rb +10 -0
  81. data/app/services/katello/pulp/repository/ostree.rb +4 -0
  82. data/app/services/katello/pulp/repository/puppet.rb +10 -0
  83. data/app/services/katello/pulp/repository/yum.rb +73 -0
  84. data/app/services/katello/pulp/yum_metadata_file.rb +7 -0
  85. data/app/services/katello/repository_type.rb +5 -0
  86. data/app/views/dashboard/_errata_widget.html.erb +1 -1
  87. data/app/views/katello/api/v2/debs/base.json.rabl +2 -1
  88. data/app/views/katello/api/v2/docker_tags/_base.json.rabl +3 -3
  89. data/app/views/katello/api/v2/errata/show.json.rabl +2 -1
  90. data/app/views/katello/api/v2/file_units/base.json.rabl +2 -1
  91. data/app/views/katello/api/v2/module_streams/base.json.rabl +2 -1
  92. data/app/views/katello/api/v2/ostree_branches/show.json.rabl +3 -2
  93. data/app/views/katello/api/v2/package_groups/base.json.rabl +2 -1
  94. data/app/views/katello/api/v2/package_groups/show.json.rabl +1 -1
  95. data/app/views/katello/api/v2/packages/base.json.rabl +2 -1
  96. data/app/views/katello/api/v2/packages/show.json.rabl +1 -1
  97. data/app/views/katello/api/v2/puppet_modules/base.json.rabl +2 -1
  98. data/app/views/katello/api/v2/puppet_modules/show.json.rabl +1 -1
  99. data/app/views/katello/api/v2/repositories/base.json.rabl +1 -0
  100. data/app/views/katello/layouts/react.html.erb +3 -3
  101. data/db/migrate/20181219205642_create_yum_metadata_file.rb +20 -0
  102. data/db/migrate/20190107160723_units_uuid_to_backend_ident.rb +8 -0
  103. data/db/seeds.d/101-locations.rb +11 -13
  104. data/db/seeds.d/102-organizations.rb +5 -3
  105. data/db/seeds.d/111-upgrade_tasks.rb +1 -1
  106. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/bastion_katello.js +2 -0
  107. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/common/views/subscription-add-or-remove.html +1 -1
  108. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-subscriptions-modal.html +2 -2
  109. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts.module.js +2 -1
  110. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-errata.html +2 -2
  111. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-events.html +1 -1
  112. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-info.html +2 -2
  113. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-provisioning-info.html +1 -1
  114. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts.html +2 -2
  115. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/content-views.module.js +2 -1
  116. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/errata-filter-details.html +2 -2
  117. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/filter-repositories.html +2 -2
  118. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/filters.html +1 -1
  119. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/histories/views/content-view-history.html +20 -20
  120. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-deb-repositories.html +1 -1
  121. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-docker-repositories.html +1 -1
  122. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-file-repositories.html +1 -1
  123. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-ostree-repositories.html +1 -1
  124. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-repositories.html +1 -1
  125. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-versions.html +1 -1
  126. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/content-view-version-content.controller.js +1 -1
  127. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-errata.html +1 -1
  128. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-ostree-branches.html +2 -0
  129. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/views/content-views.html +1 -1
  130. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/dates/dates.module.js +50 -0
  131. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment-content-views.html +1 -1
  132. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment-details.html +0 -1
  133. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment-errata.html +2 -1
  134. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment-ostree.html +2 -0
  135. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/environments.module.js +2 -1
  136. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/views/erratum-info.html +2 -2
  137. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/errata.module.js +2 -1
  138. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/views/errata.html +1 -1
  139. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/details/views/ostree-branch-info.html +3 -0
  140. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/bulk/views/products-bulk-sync-plan-modal.html +3 -3
  141. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +6 -5
  142. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-ostree-branches.html +4 -0
  143. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/views/product-info.html +5 -4
  144. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/products.controller.js +7 -8
  145. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/views/partials/product-table-sync-status.html +5 -4
  146. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/views/subscription-info.html +3 -3
  147. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/views/manifest-details.html +2 -2
  148. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/views/manifest-import-history.html +1 -1
  149. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/subscription-start-date.html +1 -1
  150. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/subscriptions.html +1 -1
  151. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/details/views/sync-plan-info.html +1 -1
  152. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/views/sync-plans.html +2 -2
  153. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/views/task-details.html +2 -2
  154. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/views/tasks-table.html +1 -1
  155. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/views/user-tasks-table.html +1 -1
  156. data/engines/bastion_katello/lib/bastion_katello/engine.rb +6 -1
  157. data/lib/katello/engine.rb +3 -3
  158. data/lib/katello/plugin.rb +3 -3
  159. data/lib/katello/repository_types/deb.rb +1 -0
  160. data/lib/katello/repository_types/yum.rb +1 -0
  161. data/lib/katello/tasks/reimport.rake +1 -0
  162. data/lib/katello/tasks/repository.rake +1 -1
  163. data/lib/katello/tasks/upgrades/3.11/import_yum_metadata_file.rake +12 -0
  164. data/lib/katello/version.rb +1 -1
  165. data/package.json +3 -1
  166. data/webpack/__mocks__/foremanReact/components/Pagination/PaginationWrapper.js +2 -0
  167. data/webpack/__mocks__/foremanReact/components/common/EmptyState.js +8 -0
  168. data/webpack/common_index.js +6 -0
  169. data/webpack/containers/Application/config.js +3 -3
  170. data/webpack/move_to_foreman/components/common/table/components/Table.js +3 -3
  171. data/webpack/move_to_foreman/components/common/table/components/Table.test.js +2 -0
  172. data/webpack/move_to_foreman/components/common/table/components/__snapshots__/Table.test.js.snap +1 -17
  173. data/webpack/redux/actions/RedHatRepositories/helpers.js +19 -10
  174. data/webpack/scenes/ModuleStreams/Details/Profiles/__tests__/ModuleStreamDetailProfiles.test.js +2 -0
  175. data/webpack/scenes/ModuleStreams/Details/Repositories/__tests__/ModuleStreamDetailRepositories.test.js +2 -0
  176. data/webpack/scenes/ModuleStreams/Details/__tests__/ModuleStreamDetails.test.js +2 -0
  177. data/webpack/scenes/ModuleStreams/__tests__/ModuleStreamPage.test.js +1 -0
  178. data/webpack/scenes/ModuleStreams/__tests__/ModuleStreamsTable.test.js +1 -0
  179. data/webpack/scenes/RedHatRepositories/helpers.js +3 -3
  180. data/webpack/scenes/Subscriptions/Details/__tests__/__snapshots__/SubscriptionDetailProductContent.test.js.snap +1 -0
  181. data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +1 -1
  182. data/webpack/scenes/Subscriptions/Manifest/__tests__/ManageManifestModal.test.js +1 -0
  183. data/webpack/scenes/Subscriptions/Manifest/__tests__/__snapshots__/ManageManifestModal.test.js.snap +1 -1
  184. data/webpack/scenes/Subscriptions/SubscriptionActions.js +10 -0
  185. data/webpack/scenes/Subscriptions/SubscriptionConstants.js +6 -0
  186. data/webpack/scenes/Subscriptions/SubscriptionReducer.js +16 -0
  187. data/webpack/scenes/Subscriptions/SubscriptionValidations.js +3 -3
  188. data/webpack/scenes/Subscriptions/SubscriptionsPage.js +28 -25
  189. data/webpack/scenes/Subscriptions/SubscriptionsSelectors.js +6 -0
  190. data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsPage.js +0 -1
  191. data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/UpstreamSubscriptionsPage.test.js +1 -0
  192. data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/__snapshots__/UpstreamSubscriptionsPage.test.js.snap +0 -1
  193. data/webpack/scenes/Subscriptions/__tests__/SubscriptionValidations.test.js +9 -4
  194. data/webpack/scenes/Subscriptions/__tests__/SubscriptionsActions.test.js +14 -0
  195. data/webpack/scenes/Subscriptions/__tests__/SubscriptionsPage.test.js +2 -0
  196. data/webpack/scenes/Subscriptions/__tests__/SubscriptionsReducer.test.js +24 -0
  197. data/webpack/scenes/Subscriptions/__tests__/SubscriptionsSelectors.test.js +6 -0
  198. data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsActions.test.js.snap +24 -0
  199. data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsPage.test.js.snap +1 -1
  200. data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsReducer.test.js.snap +138 -0
  201. data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsSelectors.test.js.snap +6 -0
  202. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/EntitlementsInlineEditFormatter.js +8 -6
  203. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTableHelpers.js +23 -11
  204. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/EntitlementsInlineEditFormatter.test.js +14 -10
  205. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTable.fixtures.js +105 -0
  206. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTable.test.js +2 -0
  207. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTableHelpers.test.js +44 -0
  208. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/__snapshots__/EntitlementsInlineEditFormatter.test.js.snap +3 -3
  209. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/__snapshots__/SubscriptionsTable.test.js.snap +2 -222
  210. data/webpack/scenes/Subscriptions/index.js +4 -0
  211. metadata +41 -44
  212. data/app/lib/actions/katello/content_view_puppet_environment/clone_content.rb +0 -32
  213. data/app/lib/actions/katello/repository/clone_deb_content.rb +0 -70
  214. data/app/lib/actions/katello/repository/clone_docker_content.rb +0 -26
  215. data/app/lib/actions/katello/repository/clone_file_content.rb +0 -17
  216. data/app/lib/actions/katello/repository/clone_ostree_content.rb +0 -17
  217. data/app/lib/actions/katello/repository/clone_yum_content.rb +0 -105
  218. data/app/lib/actions/katello/repository/clone_yum_metadata.rb +0 -36
  219. data/app/lib/actions/pulp/repository/copy_deb.rb +0 -15
  220. data/app/lib/actions/pulp/repository/copy_deb_component.rb +0 -11
  221. data/app/lib/actions/pulp/repository/copy_deb_release.rb +0 -11
  222. data/app/lib/actions/pulp/repository/copy_distribution.rb +0 -11
  223. data/app/lib/actions/pulp/repository/copy_docker_manifest.rb +0 -11
  224. data/app/lib/actions/pulp/repository/copy_docker_tag.rb +0 -11
  225. data/app/lib/actions/pulp/repository/copy_errata.rb +0 -15
  226. data/app/lib/actions/pulp/repository/copy_files.rb +0 -11
  227. data/app/lib/actions/pulp/repository/copy_module_default.rb +0 -11
  228. data/app/lib/actions/pulp/repository/copy_module_stream.rb +0 -11
  229. data/app/lib/actions/pulp/repository/copy_ostree_branch.rb +0 -11
  230. data/app/lib/actions/pulp/repository/copy_package_group.rb +0 -11
  231. data/app/lib/actions/pulp/repository/copy_puppet_module.rb +0 -15
  232. data/app/lib/actions/pulp/repository/copy_rpm.rb +0 -15
  233. data/app/lib/actions/pulp/repository/copy_srpm.rb +0 -16
  234. data/app/lib/actions/pulp/repository/copy_yum_metadata_file.rb +0 -11
  235. data/app/lib/actions/pulp/repository/purge_empty_errata.rb +0 -19
  236. data/app/lib/actions/pulp/repository/purge_empty_package_groups.rb +0 -24
  237. data/db/migrate/20190326145039_remove_version_date_from_ostree_branch.rb +0 -5
  238. data/lib/katello/tasks/upgrades/3.10/update_gpg_key_urls.rake +0 -32
  239. data/webpack/components/PaginationRow/PaginationRow.test.js +0 -25
  240. data/webpack/components/PaginationRow/__snapshots__/PaginationRow.test.js.snap +0 -35
  241. data/webpack/components/PaginationRow/index.js +0 -94
  242. data/webpack/move_to_foreman/components/common/EmptyState/index.js +0 -68
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 60a32175969fbaf3d07e70d2d7eeaa593be7e0a43495475c777321e4c0412c9a
4
- data.tar.gz: b3bf8a7d38822fef072ce04c26759e1456d028a154eac96fb3d1583b3900c550
3
+ metadata.gz: 6a32463caf56384a932ac684b0b75d47c98ae21e6b3b3bbca2b66a4f0cf6d5c9
4
+ data.tar.gz: 708211d7fd9d19eebf438ae7656aba6425bbeab7e93118adc44480af84e48b5c
5
5
  SHA512:
6
- metadata.gz: c60fb44171334e6ab716824ec893b35489d9ce5c6b1f2620fdd8e416b60d7b9f787a6b0311c48e50cfe9010f7aca4635d314ff7309c31d972b5071359e3f3ef6
7
- data.tar.gz: 5e2b0a41509fa090c341676c5946ff8e939b77909be7777b9185f138bb7a94a970cdf8cc4ebf2247ff28ba3568da3396c6c17c09dfcae7f91b1b4a2d71f438e8
6
+ metadata.gz: 80f6db1719414ea26a9391e4a245961a580b050c62e0f8dfa355fe9d00398e629c2b04c87e810b374af8a0328497881301e110f9b090ef48888d2f6d368df948
7
+ data.tar.gz: b9676a10313f563208e0982ecdf209886ea17d19755ffe52f42303ebed127ce42994c35bca39e3fd016e442b67edbe3f2a68340a3b58c57f7006783949a67f51
@@ -374,43 +374,37 @@ module Katello
374
374
  def upload_manifest(tar_file)
375
375
  upload_id = pulp_content.create_upload_request['upload_id']
376
376
  filename = tmp_file(tar_file)
377
- File.open(filename, 'rb') do |file|
378
- pulp_content.upload_bits(upload_id, 0, file.read)
377
+ uploads = []
379
378
 
380
- file.rewind
379
+ File.open(filename, 'rb') do |file|
381
380
  content = file.read
382
- unit_keys = [{
381
+ pulp_content.upload_bits(upload_id, 0, content)
382
+
383
+ uploads << {
384
+ id: upload_id,
383
385
  name: filename,
384
386
  size: file.size,
385
387
  checksum: Digest::SHA256.hexdigest(content)
386
- }]
387
- unit_type_id = 'docker_manifest'
388
- task = sync_task(::Actions::Katello::Repository::ImportUpload,
389
- @repository, [upload_id], :unit_type_id => unit_type_id,
390
- :unit_keys => unit_keys,
391
- :generate_metadata => true, :sync_capsule => true)
392
- digest = task.output['upload_results'][0]['digest']
393
-
394
- File.delete(filename)
395
-
396
- digest
388
+ }
397
389
  end
390
+
391
+ File.delete(filename)
392
+ task = sync_task(::Actions::Katello::Repository::ImportUpload,
393
+ @repository, uploads, generate_metadata: true, sync_capsule: true)
394
+ task.output['upload_results'][0]['digest']
398
395
  ensure
399
396
  pulp_content.delete_upload_request(upload_id) if upload_id
400
397
  end
401
398
 
402
399
  def upload_tag(digest, tag)
403
400
  upload_id = pulp_content.create_upload_request['upload_id']
404
- unit_keys = [{
401
+ uploads = [{
402
+ id: upload_id,
405
403
  name: tag,
406
404
  digest: digest
407
405
  }]
408
- unit_type_id = 'docker_tag'
409
- sync_task(::Actions::Katello::Repository::ImportUpload,
410
- @repository, [upload_id], :unit_type_id => unit_type_id,
411
- :unit_keys => unit_keys,
412
- :generate_metadata => true, :sync_capsule => true)
413
-
406
+ sync_task(::Actions::Katello::Repository::ImportUpload, @repository, uploads,
407
+ :generate_metadata => true, :sync_capsule => true)
414
408
  tag
415
409
  ensure
416
410
  pulp_content.delete_upload_request(upload_id) if upload_id
@@ -9,7 +9,7 @@ module Katello
9
9
  api :POST, "/repositories/:repository_id/content_uploads", N_("Create an upload request")
10
10
  param :repository_id, :number, :required => true, :desc => N_("repository id")
11
11
  def create
12
- render :json => pulp_content.create_upload_request
12
+ render :json => @repository.backend_content_service(::SmartProxy.pulp_master).create_upload
13
13
  end
14
14
 
15
15
  api :PUT, "/repositories/:repository_id/content_uploads/:id", N_("Upload a chunk of the file's content")
@@ -18,7 +18,8 @@ module Katello
18
18
  param :offset, :number, :required => true, :desc => N_("The offset in the file where the content starts")
19
19
  param :content, File, :required => true, :desc => N_("The actual file contents")
20
20
  def update
21
- pulp_content.upload_bits(params[:id], params[:offset], params[:content])
21
+ @repository.backend_content_service(::SmartProxy.pulp_master)
22
+ .upload_chunk(params[:id], params[:offset], params[:content])
22
23
  head :no_content
23
24
  end
24
25
 
@@ -26,16 +27,12 @@ module Katello
26
27
  param :repository_id, :number, :required => true, :desc => N_("Repository id")
27
28
  param :id, :number, :required => true, :desc => N_("Upload request id")
28
29
  def destroy
29
- pulp_content.delete_upload_request(params[:id])
30
+ @repository.backend_content_service(::SmartProxy.pulp_master).delete_upload(params[:id])
30
31
  head :no_content
31
32
  end
32
33
 
33
34
  private
34
35
 
35
- def pulp_content
36
- Katello.pulp_server.resources.content
37
- end
38
-
39
36
  def find_repository
40
37
  @repository = Repository.find(params[:repository_id])
41
38
  end
@@ -9,7 +9,6 @@ module Katello
9
9
  param :content_view_id, :number, :desc => N_("content view identifier"), :required => true
10
10
  param :name, String, :desc => N_("name of the puppet module")
11
11
  param :author, String, :desc => N_("author of the puppet module")
12
- param :uuid, String, :desc => N_("the uuid of the puppet module to associate")
13
12
  param_group :search, ::Katello::Api::V2::ApiController
14
13
  def index
15
14
  respond(:collection => scoped_search(index_relation.distinct, :name, :asc))
@@ -21,9 +20,9 @@ module Katello
21
20
  param :name, String, :desc => N_("name of the puppet module")
22
21
  param :author, String, :desc => N_("author of the puppet module")
23
22
  param :id, String, :desc => N_("the id of the puppet module to associate")
24
- param :uuid, String, :desc => N_("the uuid of the puppet module to associate")
23
+ param :uuid, String, :desc => N_("the uuid of the puppet module to associate"), :deprecated => true
25
24
  def create
26
- params[:content_view_puppet_module][:uuid] ||= PuppetModule.find(params[:id]).try(:uuid) if params[:id]
25
+ params[:content_view_puppet_module][:uuid] ||= PuppetModule.find(params[:id]).try(:pulp_id) if params[:id]
27
26
  respond resource: ContentViewPuppetModule.create!(puppet_module_params.merge(content_view: @view))
28
27
  end
29
28
 
@@ -40,7 +39,7 @@ module Katello
40
39
  param :id, :number, :desc => N_("puppet module ID"), :required => true
41
40
  param :name, String, :desc => N_("name of the puppet module")
42
41
  param :author, String, :desc => N_("author of the puppet module")
43
- param :uuid, String, :desc => N_("the uuid of the puppet module to associate")
42
+ param :uuid, String, :desc => N_("the uuid of the puppet module to associate"), :deprecated => true
44
43
  def update
45
44
  @puppet_module.update_attributes!(puppet_module_params)
46
45
  respond :resource => @puppet_module
@@ -58,7 +57,7 @@ module Katello
58
57
  def index_relation
59
58
  puppet_modules = ContentViewPuppetModule.where(:content_view_id => @view)
60
59
  puppet_modules = puppet_modules.where(:name => params[:name]) if params[:name]
61
- puppet_modules = puppet_modules.where(:uuid => params[:uuid]) if params[:uuid]
60
+ puppet_modules = puppet_modules.where(:pulp_id => params[:uuid]) if params[:uuid]
62
61
  puppet_modules = puppet_modules.where(:author => params[:author]) if params[:author]
63
62
  puppet_modules
64
63
  end
@@ -128,10 +128,10 @@ module Katello
128
128
  param :resolve_dependencies, :bool, :desc => N_("If true, when adding the specified errata or packages, any needed dependencies will be copied as well")
129
129
  param :propagate_all_composites, :bool, :desc => N_("If true, will publish a new composite version using any specified content_view_version_id that has been promoted to a lifecycle environment")
130
130
  param :add_content, Hash do
131
- param :errata_ids, Array, :desc => "Errata ids or uuids to copy into the new versions"
132
- param :package_ids, Array, :desc => "Package ids or uuids to copy into the new versions"
133
- param :deb_ids, Array, :desc => "Deb Package ids or uuids to copy into the new versions"
134
- param :puppet_module_ids, Array, :desc => "Puppet Module ids or uuids to copy into the new versions"
131
+ param :errata_ids, Array, :desc => "Errata ids to copy into the new versions"
132
+ param :package_ids, Array, :desc => "Package ids to copy into the new versions"
133
+ param :deb_ids, Array, :desc => "Deb Package ids to copy into the new versions"
134
+ param :puppet_module_ids, Array, :desc => "Puppet Module ids to copy into the new versions"
135
135
  end
136
136
  param :update_hosts, Hash, :desc => N_("After generating the incremental update, apply the changes to the specified hosts. Only Errata are supported currently.") do
137
137
  param :included, Hash, :required => true, :action_aware => true do
@@ -130,7 +130,7 @@ module Katello
130
130
  end
131
131
  end
132
132
  end
133
- query = query.where("#{PuppetModule.table_name}.uuid NOT in (?)", current_uuids) if current_uuids.present?
133
+ query = query.where("#{PuppetModule.table_name}.pulp_id NOT in (?)", current_uuids) if current_uuids.present?
134
134
  custom_sort = ->(sort_query) { sort_query.order('author, name, sortable_version DESC') }
135
135
  sorted_records = scoped_search(query, nil, nil, :resource_class => PuppetModule, :custom_sort => custom_sort)
136
136
  if params[:name]
@@ -246,8 +246,8 @@ module Katello
246
246
  top_rec = records[0]
247
247
  latest = top_rec.dup
248
248
  latest.version = _("Always Use Latest (currently %{version})") % { version: latest.version }
249
- latest.uuid = nil
250
- module_records.delete(top_rec) if selected_latest_versions.include?(top_rec.uuid)
249
+ latest.pulp_id = nil
250
+ module_records.delete(top_rec) if selected_latest_versions.include?(top_rec.pulp_id)
251
251
  module_records.push(latest)
252
252
  end
253
253
  module_records
@@ -10,7 +10,7 @@ module Katello
10
10
  end
11
11
 
12
12
  def filter_by_content_view_filter(filter)
13
- resource_class.where(:uuid => filter.send("#{singular_resource_name}_rules").pluck(:uuid))
13
+ resource_class.where(:pulp_id => filter.send("#{singular_resource_name}_rules").pluck(:uuid))
14
14
  end
15
15
 
16
16
  def custom_index_relation(collection)
@@ -95,8 +95,8 @@ module Katello
95
95
 
96
96
  def filter_by_content_view(filter, collection)
97
97
  repos = Katello::ContentView.find(filter.content_view_id).repositories
98
- uuid = repos.map { |r| r.send("errata").pluck("uuid") }.flatten
99
- filter_by_ids(uuid, collection)
98
+ ids = repos.map { |r| r.send(:erratum_ids) }.flatten
99
+ filter_by_ids(ids, collection)
100
100
  end
101
101
 
102
102
  def filter_by_content_view_filter(filter, collection)
@@ -305,9 +305,7 @@ module Katello
305
305
 
306
306
  def content_action
307
307
  if params[:content_type] == 'errata'
308
- errata_uuids = Katello::Erratum.where(:errata_id => params[:content]).pluck(:uuid)
309
- errata_uuids += Katello::Erratum.where(:uuid => params[:content]).pluck(:uuid)
310
- task = async_task(::Actions::BulkAction, ::Actions::Katello::Host::Erratum::ApplicableErrataInstall, @hosts, errata_uuids.uniq)
308
+ task = async_task(::Actions::BulkAction, ::Actions::Katello::Host::Erratum::ApplicableErrataInstall, @hosts, params[:content].uniq)
311
309
  respond_for_async :resource => task
312
310
  else
313
311
  content = params[:content]
@@ -59,10 +59,10 @@ module Katello
59
59
  collection_ids = []
60
60
  current_ids = filter.package_group_rules.map(&:uuid)
61
61
  filter.applicable_repos.each do |repo|
62
- collection_ids.concat(repo.package_groups.map(&:uuid))
62
+ collection_ids.concat(repo.package_groups.map(&:pulp_id))
63
63
  end
64
- collection = PackageGroup.where(:uuid => collection_ids)
65
- collection = collection.where("uuid not in (?)", current_ids) unless current_ids.empty?
64
+ collection = PackageGroup.where(:pulp_id => collection_ids)
65
+ collection = collection.where("pulp_id not in (?)", current_ids) unless current_ids.empty?
66
66
  collection
67
67
  end
68
68
 
@@ -197,7 +197,7 @@ module Katello
197
197
  param_group :repo_create
198
198
  param_group :repo
199
199
  def create
200
- repo_params = filtered_repository_params
200
+ repo_params = repository_params
201
201
  unless RepositoryTypeManager.creatable_by_user?(repo_params[:content_type])
202
202
  msg = _("Invalid params provided - content_type must be one of %s") % RepositoryTypeManager.creatable_repository_types.keys.join(",")
203
203
  fail HttpErrors::UnprocessableEntity, msg
@@ -389,22 +389,11 @@ module Katello
389
389
  params[:upload_ids].each { |upload_id| uploads << {'id' => upload_id} }
390
390
  end
391
391
 
392
- upload_ids = uploads.map { |upload| upload['id'] }
393
- unit_keys = uploads.map do |upload|
394
- if @repository.file? || @repository.docker?
395
- upload.except('id')
396
- else
397
- upload.except('id').except('name')
398
- end
399
- end
400
-
401
- unit_type_id = unit_keys[0] && unit_keys[0].include?('digest') ? 'docker_tag' : @repository.unit_type_id
402
-
403
392
  begin
404
- task = send(async ? :async_task : :sync_task, ::Actions::Katello::Repository::ImportUpload,
405
- @repository, upload_ids, :unit_type_id => unit_type_id, :unit_keys => unit_keys,
406
- :generate_metadata => generate_metadata, :sync_capsule => sync_capsule)
407
- respond_for_async(resource: task)
393
+ respond_for_async(resource: send(
394
+ async ? :async_task : :sync_task,
395
+ ::Actions::Katello::Repository::ImportUpload, @repository, uploads,
396
+ generate_metadata: generate_metadata, sync_capsule: sync_capsule))
408
397
  rescue => e
409
398
  raise HttpErrors::BadRequest, e.message
410
399
  end
@@ -451,14 +440,6 @@ module Katello
451
440
  end
452
441
  end
453
442
 
454
- def filtered_repository_params
455
- params = repository_params
456
- ::Katello::RootRepository::CONTENT_ATTRIBUTE_RESTRICTIONS.each do |attribute, types|
457
- params.delete(attribute) unless types.include?(params[:content_type])
458
- end
459
- params
460
- end
461
-
462
443
  def repository_params
463
444
  keys = [:download_policy, :mirror_on_sync, :arch, :verify_ssl_on_sync, :upstream_password, :upstream_username,
464
445
  :ostree_upstream_sync_depth, :ostree_upstream_sync_policy, :ignore_global_proxy,
@@ -125,7 +125,7 @@ module Katello
125
125
  @product_content = @product.product_content_by_id(params[:id])
126
126
  else
127
127
  content = Katello::Content.find_by(:cp_content_id => params[:id], :organization_id => @organization[:id])
128
- @product_content = Katello::ProductContent.find_by(:content_id => content.id)
128
+ @product_content = Katello::ProductContent.find_by(:id => content[:id])
129
129
  end
130
130
  fail HttpErrors::NotFound, _("Couldn't find repository set with id '%s'.") % params[:id] if @product_content.nil?
131
131
  @product = @product_content.product if @product.nil?
@@ -11,7 +11,7 @@ module Katello
11
11
  helper ::ApplicationHelper
12
12
 
13
13
  before_action :set_gettext_locale
14
- helper_method :current_organization
14
+ helper_method :current_organization_object
15
15
  before_action :require_org
16
16
 
17
17
  protect_from_forgery # See ActionController::RequestForgeryProtection for details
@@ -49,7 +49,7 @@ module Katello
49
49
  'generic'
50
50
  end
51
51
 
52
- def current_organization
52
+ def current_organization_object
53
53
  if !session[:current_organization_id]
54
54
  @current_org = Organization.current
55
55
  return @current_org
@@ -72,14 +72,14 @@ module Katello
72
72
  end
73
73
  end
74
74
 
75
- def current_organization=(org)
75
+ def current_organization_object=(org)
76
76
  session[:current_organization_id] = org.try(:id)
77
77
  end
78
78
 
79
79
  private # why bother? methods below are not testable/tested
80
80
 
81
81
  def require_org
82
- unless session && current_organization
82
+ unless session && current_organization_object
83
83
  redirect_to '/select_organization?toState=' + request.path
84
84
  end
85
85
  end
@@ -151,7 +151,7 @@ module Katello
151
151
  end
152
152
 
153
153
  def filter_by_ids(ids, collection)
154
- collection.with_uuid(ids)
154
+ collection.with_identifiers(ids)
155
155
  end
156
156
 
157
157
  def find_repository
@@ -17,7 +17,7 @@ module Katello
17
17
  end
18
18
 
19
19
  def index
20
- org = current_organization
20
+ org = current_organization_object
21
21
  @products = org.library.products.readable
22
22
  redhat_products, custom_products = @products.partition(&:redhat?)
23
23
  redhat_products.sort_by { |p| p.name.downcase }
@@ -14,7 +14,7 @@ module Katello
14
14
  end
15
15
 
16
16
  def erratum_path(erratum)
17
- "#{Setting[:foreman_url]}/errata/#{erratum.uuid}"
17
+ "#{Setting[:foreman_url]}/errata/#{erratum.id}"
18
18
  end
19
19
 
20
20
  def repository_erratum_path(repository, type = nil)
@@ -25,7 +25,7 @@ module Katello
25
25
  end
26
26
 
27
27
  def any_syncable?
28
- Product.syncable? && current_organization.syncable_content?
28
+ Product.syncable? && current_organization_object.syncable_content?
29
29
  end
30
30
 
31
31
  def error_state?(status)
@@ -0,0 +1,18 @@
1
+ module Actions
2
+ module Candlepin
3
+ module Environment
4
+ class AddContentToEnvironment < Candlepin::Abstract
5
+ input_format do
6
+ param :view_env_cp_id
7
+ param :content_id
8
+ end
9
+
10
+ def run
11
+ output[:add_response] = ::Katello::Resources::Candlepin::Environment.add_content(input[:view_env_cp_id], [input[:content_id]])
12
+ rescue RestClient::Conflict
13
+ Rails.logger.info("attempted to add content ID #{input[:content_id]} to environment, but content ID already exists.")
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -25,10 +25,7 @@ module Actions
25
25
  clone = setup_puppet_environment_clone(from_version, clone)
26
26
 
27
27
  self.new_puppet_environment = clone
28
- plan_action(Pulp::Repository::CopyPuppetModule,
29
- source_pulp_id: source.pulp_id,
30
- target_pulp_id: clone.pulp_id,
31
- criteria: nil)
28
+ plan_action(Pulp::ContentViewPuppetEnvironment::CopyContents, clone, :source_content_view_puppet_environment_id => source.id)
32
29
 
33
30
  concurrence do
34
31
  plan_action(Katello::Repository::MetadataGenerate, clone) if environment
@@ -0,0 +1,20 @@
1
+ module Actions
2
+ module Katello
3
+ module ContentViewPuppetEnvironment
4
+ class CloneContentForVersion < Actions::Base
5
+ def plan(puppet_environment, modules_by_repoid)
6
+ sequence do
7
+ concurrence do
8
+ modules_by_repoid.each_pair do |repo_id, modules|
9
+ source_repo = ::Katello::Repository.find(repo_id)
10
+
11
+ plan_action(Pulp::ContentViewPuppetEnvironment::CopyContents, puppet_environment,
12
+ puppet_modules: modules, source_repository_id: source_repo.id)
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -7,13 +7,14 @@ module Actions
7
7
 
8
8
  def plan(content_view_version)
9
9
  content_view = content_view_version.content_view
10
- modules_by_repoid = content_view.computed_module_ids_by_repoid
10
+ modules_by_repoid = content_view.computed_modules_by_repoid
11
11
 
12
12
  self.new_puppet_environment = content_view.build_puppet_env(:version => content_view_version)
13
13
 
14
14
  sequence do
15
15
  plan_action(ContentViewPuppetEnvironment::Create, new_puppet_environment, true)
16
- plan_action(ContentViewPuppetEnvironment::CloneContent, new_puppet_environment, modules_by_repoid)
16
+ plan_action(ContentViewPuppetEnvironment::CloneContentForVersion, new_puppet_environment, modules_by_repoid)
17
+ plan_action(Pulp::ContentViewPuppetEnvironment::IndexContent, id: new_puppet_environment.id)
17
18
  end
18
19
  end
19
20
  end
@@ -219,10 +219,10 @@ module Actions
219
219
  copy_outputs = []
220
220
  if new_repo.content_type == ::Katello::Repository::DEB_TYPE
221
221
  unless deb_ids.blank?
222
- deb_uuids = ::Katello::Deb.with_identifiers(deb_ids).pluck(:uuid)
223
- copy_outputs << plan_copy(Pulp::Repository::CopyDeb, new_repo.library_instance, new_repo,
224
- { :filters => {:association => {'unit_id' => {'$in' => deb_uuids}}}},
225
- :recursive => true, :resolve_dependencies => dep_solve).output
222
+ copy_outputs << plan_action(Pulp::Repository::CopyUnits, new_repo.library_instance, new_repo,
223
+ ::Katello::Deb.with_identifiers(deb_ids),
224
+ recursive: true,
225
+ resolve_dependencies: dep_solve).output
226
226
  end
227
227
  end
228
228
  copy_outputs
@@ -232,17 +232,16 @@ module Actions
232
232
  copy_outputs = []
233
233
  if new_repo.content_type == ::Katello::Repository::YUM_TYPE
234
234
  unless errata_ids.blank?
235
- errata_uuids = ::Katello::Erratum.with_identifiers(errata_ids).pluck(:uuid)
236
- copy_outputs << plan_copy(Pulp::Repository::CopyErrata, new_repo.library_instance, new_repo,
237
- { :filters => {:association => {'unit_id' => {'$in' => errata_uuids}}}},
238
- :recursive => true, :resolve_dependencies => dep_solve).output
235
+ copy_outputs << plan_action(Pulp::Repository::CopyUnits, new_repo.library_instance, new_repo,
236
+ ::Katello::Erratum.with_identifiers(errata_ids),
237
+ recursive: true,
238
+ resolve_dependencies: dep_solve).output
239
239
  end
240
240
 
241
241
  unless package_ids.blank?
242
- package_uuids = ::Katello::Rpm.with_identifiers(package_ids).pluck(:uuid)
243
- copy_outputs << plan_copy(Pulp::Repository::CopyRpm, new_repo.library_instance, new_repo,
244
- { :filters => {:association => {'unit_id' => {'$in' => package_uuids}}}},
245
- :resolve_dependencies => dep_solve).output
242
+ copy_outputs << plan_action(Pulp::Repository::CopyUnits, new_repo.library_instance, new_repo,
243
+ ::Katello::Rpm.with_identifiers(package_ids),
244
+ resolve_dependencies: dep_solve).output
246
245
  end
247
246
  end
248
247
  copy_outputs
@@ -270,11 +269,11 @@ module Actions
270
269
  ::Katello::PuppetModule.with_identifiers(ids)
271
270
  end
272
271
 
273
- def copy_puppet_module(new_repo, module_id)
272
+ def copy_puppet_modules(new_repo, module_id)
274
273
  puppet_module = find_puppet_modules([module_id]).first
275
- possible_repos = puppet_module.repositories.in_organization(new_repo.organization).in_default_view
276
- plan_action(Pulp::Repository::CopyPuppetModule, :source_pulp_id => possible_repos.first.pulp_id,
277
- :target_pulp_id => new_repo.pulp_id, :clauses => {'unit_id' => puppet_module.uuid}, :include_result => true)
274
+ possible_repos = puppet_module.repositories.in_organization(new_repo.organization).in_default_vie
275
+ plan_action(Pulp::Repository::CopyUnits, possible_repos.first, new_repo,
276
+ [puppet_module])
278
277
  end
279
278
 
280
279
  def plan_copy(action_class, source_repo, target_repo, clauses = nil, override_config = nil)