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.
- checksums.yaml +4 -4
- data/app/controllers/katello/api/registry/registry_proxies_controller.rb +16 -22
- data/app/controllers/katello/api/v2/content_uploads_controller.rb +4 -7
- data/app/controllers/katello/api/v2/content_view_puppet_modules_controller.rb +4 -5
- data/app/controllers/katello/api/v2/content_view_versions_controller.rb +4 -4
- data/app/controllers/katello/api/v2/content_views_controller.rb +3 -3
- data/app/controllers/katello/api/v2/docker_manifests_controller.rb +1 -1
- data/app/controllers/katello/api/v2/errata_controller.rb +2 -2
- data/app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb +1 -3
- data/app/controllers/katello/api/v2/package_groups_controller.rb +3 -3
- data/app/controllers/katello/api/v2/repositories_controller.rb +5 -24
- data/app/controllers/katello/api/v2/repository_sets_controller.rb +1 -1
- data/app/controllers/katello/application_controller.rb +4 -4
- data/app/controllers/katello/concerns/api/v2/repository_content_controller.rb +1 -1
- data/app/controllers/katello/sync_management_controller.rb +1 -1
- data/app/helpers/katello/errata_mailer_helper.rb +1 -1
- data/app/helpers/katello/sync_management_helper.rb +1 -1
- data/app/lib/actions/candlepin/environment/add_content_to_environment.rb +18 -0
- data/app/lib/actions/katello/content_view_puppet_environment/clone.rb +1 -4
- data/app/lib/actions/katello/content_view_puppet_environment/clone_content_for_version.rb +20 -0
- data/app/lib/actions/katello/content_view_puppet_environment/create_for_version.rb +3 -2
- data/app/lib/actions/katello/content_view_version/incremental_update.rb +15 -16
- data/app/lib/actions/katello/host/hypervisors_update.rb +17 -6
- data/app/lib/actions/katello/organization/manifest_delete.rb +1 -3
- data/app/lib/actions/katello/organization/manifest_import.rb +1 -3
- data/app/lib/actions/katello/organization/manifest_refresh.rb +1 -3
- data/app/lib/actions/katello/provider/update.rb +1 -1
- data/app/lib/actions/katello/repository/check_matching_content.rb +8 -2
- data/app/lib/actions/katello/repository/clone_contents.rb +52 -0
- data/app/lib/actions/katello/repository/clone_to_environment.rb +1 -11
- data/app/lib/actions/katello/repository/clone_to_version.rb +19 -29
- data/app/lib/actions/katello/repository/create.rb +3 -4
- data/app/lib/actions/katello/repository/export.rb +1 -2
- data/app/lib/actions/katello/repository/import_upload.rb +7 -5
- data/app/lib/actions/katello/repository/purge_empty_content.rb +16 -0
- data/app/lib/actions/katello/repository/remove_content.rb +2 -2
- data/app/lib/actions/katello/repository/sync.rb +1 -1
- data/app/lib/actions/pulp/content_view_puppet_environment/copy_contents.rb +36 -0
- data/app/lib/actions/pulp/repository/copy_all_units.rb +27 -0
- data/app/lib/actions/pulp/repository/copy_units.rb +29 -0
- data/app/lib/actions/pulp/repository/refresh.rb +3 -7
- data/app/lib/actions/pulp/repository/regenerate_applicability.rb +5 -2
- data/app/lib/katello/concerns/renderer_extensions.rb +1 -1
- data/app/lib/katello/http_resource.rb +5 -1
- data/app/lib/katello/resources/candlepin/consumer.rb +9 -0
- data/app/lib/katello/resources/candlepin/content.rb +2 -3
- data/app/lib/katello/util/cdn_var_substitutor.rb +1 -2
- data/app/lib/katello/util/path_with_substitutions.rb +18 -1
- data/app/lib/katello/validators/content_view_puppet_module_validator.rb +2 -2
- data/app/lib/katello/validators/environment_docker_repositories_validator.rb +7 -5
- data/app/models/katello/concerns/hostgroup_extensions.rb +2 -7
- data/app/models/katello/concerns/organization_extensions.rb +11 -1
- data/app/models/katello/concerns/pulp_database_unit.rb +40 -24
- data/app/models/katello/concerns/redhat_extensions.rb +7 -3
- data/app/models/katello/content_view.rb +5 -7
- data/app/models/katello/content_view_docker_filter.rb +3 -3
- data/app/models/katello/content_view_puppet_environment.rb +1 -1
- data/app/models/katello/content_view_puppet_module.rb +2 -3
- data/app/models/katello/docker_meta_tag.rb +1 -1
- data/app/models/katello/docker_tag.rb +4 -6
- data/app/models/katello/erratum.rb +1 -1
- data/app/models/katello/glue/pulp/repo.rb +3 -0
- data/app/models/katello/glue/pulp/repos.rb +4 -0
- data/app/models/katello/host/info_provider.rb +2 -2
- data/app/models/katello/host/subscription_facet.rb +0 -1
- data/app/models/katello/module_stream.rb +10 -4
- data/app/models/katello/ostree_branch.rb +4 -2
- data/app/models/katello/package_group.rb +2 -2
- data/app/models/katello/ping.rb +1 -1
- data/app/models/katello/puppet_module.rb +3 -3
- data/app/models/katello/repository.rb +15 -2
- data/app/models/katello/root_repository.rb +10 -0
- data/app/models/katello/yum_metadata_file.rb +46 -0
- data/app/services/katello/abstract/pulp/content.rb +19 -0
- data/app/services/katello/applicable_content_helper.rb +5 -5
- data/app/services/katello/pulp/content.rb +17 -0
- data/app/services/katello/pulp/repository.rb +45 -15
- data/app/services/katello/pulp/repository/deb.rb +8 -0
- data/app/services/katello/pulp/repository/docker.rb +19 -0
- data/app/services/katello/pulp/repository/file.rb +10 -0
- data/app/services/katello/pulp/repository/ostree.rb +4 -0
- data/app/services/katello/pulp/repository/puppet.rb +10 -0
- data/app/services/katello/pulp/repository/yum.rb +73 -0
- data/app/services/katello/pulp/yum_metadata_file.rb +7 -0
- data/app/services/katello/repository_type.rb +5 -0
- data/app/views/dashboard/_errata_widget.html.erb +1 -1
- data/app/views/katello/api/v2/debs/base.json.rabl +2 -1
- data/app/views/katello/api/v2/docker_tags/_base.json.rabl +3 -3
- data/app/views/katello/api/v2/errata/show.json.rabl +2 -1
- data/app/views/katello/api/v2/file_units/base.json.rabl +2 -1
- data/app/views/katello/api/v2/module_streams/base.json.rabl +2 -1
- data/app/views/katello/api/v2/ostree_branches/show.json.rabl +3 -2
- data/app/views/katello/api/v2/package_groups/base.json.rabl +2 -1
- data/app/views/katello/api/v2/package_groups/show.json.rabl +1 -1
- data/app/views/katello/api/v2/packages/base.json.rabl +2 -1
- data/app/views/katello/api/v2/packages/show.json.rabl +1 -1
- data/app/views/katello/api/v2/puppet_modules/base.json.rabl +2 -1
- data/app/views/katello/api/v2/puppet_modules/show.json.rabl +1 -1
- data/app/views/katello/api/v2/repositories/base.json.rabl +1 -0
- data/app/views/katello/layouts/react.html.erb +3 -3
- data/db/migrate/20181219205642_create_yum_metadata_file.rb +20 -0
- data/db/migrate/20190107160723_units_uuid_to_backend_ident.rb +8 -0
- data/db/seeds.d/101-locations.rb +11 -13
- data/db/seeds.d/102-organizations.rb +5 -3
- data/db/seeds.d/111-upgrade_tasks.rb +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/bastion_katello.js +2 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/common/views/subscription-add-or-remove.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-subscriptions-modal.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts.module.js +2 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-errata.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-events.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-info.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-provisioning-info.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/content-views.module.js +2 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/errata-filter-details.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/filter-repositories.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/filters.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/histories/views/content-view-history.html +20 -20
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-deb-repositories.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-docker-repositories.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-file-repositories.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-ostree-repositories.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-repositories.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-versions.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/content-view-version-content.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-errata.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-ostree-branches.html +2 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/views/content-views.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/dates/dates.module.js +50 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment-content-views.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment-details.html +0 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment-errata.html +2 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment-ostree.html +2 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/environments.module.js +2 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/views/erratum-info.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/errata.module.js +2 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/views/errata.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/details/views/ostree-branch-info.html +3 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/bulk/views/products-bulk-sync-plan-modal.html +3 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +6 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-ostree-branches.html +4 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/views/product-info.html +5 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/products.controller.js +7 -8
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/views/partials/product-table-sync-status.html +5 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/views/subscription-info.html +3 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/views/manifest-details.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/views/manifest-import-history.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/subscription-start-date.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/subscriptions.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/details/views/sync-plan-info.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/views/sync-plans.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/views/task-details.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/views/tasks-table.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/views/user-tasks-table.html +1 -1
- data/engines/bastion_katello/lib/bastion_katello/engine.rb +6 -1
- data/lib/katello/engine.rb +3 -3
- data/lib/katello/plugin.rb +3 -3
- data/lib/katello/repository_types/deb.rb +1 -0
- data/lib/katello/repository_types/yum.rb +1 -0
- data/lib/katello/tasks/reimport.rake +1 -0
- data/lib/katello/tasks/repository.rake +1 -1
- data/lib/katello/tasks/upgrades/3.11/import_yum_metadata_file.rake +12 -0
- data/lib/katello/version.rb +1 -1
- data/package.json +3 -1
- data/webpack/__mocks__/foremanReact/components/Pagination/PaginationWrapper.js +2 -0
- data/webpack/__mocks__/foremanReact/components/common/EmptyState.js +8 -0
- data/webpack/common_index.js +6 -0
- data/webpack/containers/Application/config.js +3 -3
- data/webpack/move_to_foreman/components/common/table/components/Table.js +3 -3
- data/webpack/move_to_foreman/components/common/table/components/Table.test.js +2 -0
- data/webpack/move_to_foreman/components/common/table/components/__snapshots__/Table.test.js.snap +1 -17
- data/webpack/redux/actions/RedHatRepositories/helpers.js +19 -10
- data/webpack/scenes/ModuleStreams/Details/Profiles/__tests__/ModuleStreamDetailProfiles.test.js +2 -0
- data/webpack/scenes/ModuleStreams/Details/Repositories/__tests__/ModuleStreamDetailRepositories.test.js +2 -0
- data/webpack/scenes/ModuleStreams/Details/__tests__/ModuleStreamDetails.test.js +2 -0
- data/webpack/scenes/ModuleStreams/__tests__/ModuleStreamPage.test.js +1 -0
- data/webpack/scenes/ModuleStreams/__tests__/ModuleStreamsTable.test.js +1 -0
- data/webpack/scenes/RedHatRepositories/helpers.js +3 -3
- data/webpack/scenes/Subscriptions/Details/__tests__/__snapshots__/SubscriptionDetailProductContent.test.js.snap +1 -0
- data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +1 -1
- data/webpack/scenes/Subscriptions/Manifest/__tests__/ManageManifestModal.test.js +1 -0
- data/webpack/scenes/Subscriptions/Manifest/__tests__/__snapshots__/ManageManifestModal.test.js.snap +1 -1
- data/webpack/scenes/Subscriptions/SubscriptionActions.js +10 -0
- data/webpack/scenes/Subscriptions/SubscriptionConstants.js +6 -0
- data/webpack/scenes/Subscriptions/SubscriptionReducer.js +16 -0
- data/webpack/scenes/Subscriptions/SubscriptionValidations.js +3 -3
- data/webpack/scenes/Subscriptions/SubscriptionsPage.js +28 -25
- data/webpack/scenes/Subscriptions/SubscriptionsSelectors.js +6 -0
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsPage.js +0 -1
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/UpstreamSubscriptionsPage.test.js +1 -0
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/__snapshots__/UpstreamSubscriptionsPage.test.js.snap +0 -1
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionValidations.test.js +9 -4
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionsActions.test.js +14 -0
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionsPage.test.js +2 -0
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionsReducer.test.js +24 -0
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionsSelectors.test.js +6 -0
- data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsActions.test.js.snap +24 -0
- data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsPage.test.js.snap +1 -1
- data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsReducer.test.js.snap +138 -0
- data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsSelectors.test.js.snap +6 -0
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/EntitlementsInlineEditFormatter.js +8 -6
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTableHelpers.js +23 -11
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/EntitlementsInlineEditFormatter.test.js +14 -10
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTable.fixtures.js +105 -0
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTable.test.js +2 -0
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTableHelpers.test.js +44 -0
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/__snapshots__/EntitlementsInlineEditFormatter.test.js.snap +3 -3
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/__snapshots__/SubscriptionsTable.test.js.snap +2 -222
- data/webpack/scenes/Subscriptions/index.js +4 -0
- metadata +41 -44
- data/app/lib/actions/katello/content_view_puppet_environment/clone_content.rb +0 -32
- data/app/lib/actions/katello/repository/clone_deb_content.rb +0 -70
- data/app/lib/actions/katello/repository/clone_docker_content.rb +0 -26
- data/app/lib/actions/katello/repository/clone_file_content.rb +0 -17
- data/app/lib/actions/katello/repository/clone_ostree_content.rb +0 -17
- data/app/lib/actions/katello/repository/clone_yum_content.rb +0 -105
- data/app/lib/actions/katello/repository/clone_yum_metadata.rb +0 -36
- data/app/lib/actions/pulp/repository/copy_deb.rb +0 -15
- data/app/lib/actions/pulp/repository/copy_deb_component.rb +0 -11
- data/app/lib/actions/pulp/repository/copy_deb_release.rb +0 -11
- data/app/lib/actions/pulp/repository/copy_distribution.rb +0 -11
- data/app/lib/actions/pulp/repository/copy_docker_manifest.rb +0 -11
- data/app/lib/actions/pulp/repository/copy_docker_tag.rb +0 -11
- data/app/lib/actions/pulp/repository/copy_errata.rb +0 -15
- data/app/lib/actions/pulp/repository/copy_files.rb +0 -11
- data/app/lib/actions/pulp/repository/copy_module_default.rb +0 -11
- data/app/lib/actions/pulp/repository/copy_module_stream.rb +0 -11
- data/app/lib/actions/pulp/repository/copy_ostree_branch.rb +0 -11
- data/app/lib/actions/pulp/repository/copy_package_group.rb +0 -11
- data/app/lib/actions/pulp/repository/copy_puppet_module.rb +0 -15
- data/app/lib/actions/pulp/repository/copy_rpm.rb +0 -15
- data/app/lib/actions/pulp/repository/copy_srpm.rb +0 -16
- data/app/lib/actions/pulp/repository/copy_yum_metadata_file.rb +0 -11
- data/app/lib/actions/pulp/repository/purge_empty_errata.rb +0 -19
- data/app/lib/actions/pulp/repository/purge_empty_package_groups.rb +0 -24
- data/db/migrate/20190326145039_remove_version_date_from_ostree_branch.rb +0 -5
- data/lib/katello/tasks/upgrades/3.10/update_gpg_key_urls.rake +0 -32
- data/webpack/components/PaginationRow/PaginationRow.test.js +0 -25
- data/webpack/components/PaginationRow/__snapshots__/PaginationRow.test.js.snap +0 -35
- data/webpack/components/PaginationRow/index.js +0 -94
- 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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a32463caf56384a932ac684b0b75d47c98ae21e6b3b3bbca2b66a4f0cf6d5c9
|
4
|
+
data.tar.gz: 708211d7fd9d19eebf438ae7656aba6425bbeab7e93118adc44480af84e48b5c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
378
|
-
pulp_content.upload_bits(upload_id, 0, file.read)
|
377
|
+
uploads = []
|
379
378
|
|
380
|
-
|
379
|
+
File.open(filename, 'rb') do |file|
|
381
380
|
content = file.read
|
382
|
-
|
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
|
-
|
401
|
+
uploads = [{
|
402
|
+
id: upload_id,
|
405
403
|
name: tag,
|
406
404
|
digest: digest
|
407
405
|
}]
|
408
|
-
|
409
|
-
|
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 =>
|
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
|
-
|
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
|
-
|
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(:
|
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(:
|
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
|
132
|
-
param :package_ids, Array, :desc => "Package ids
|
133
|
-
param :deb_ids, Array, :desc => "Deb Package ids
|
134
|
-
param :puppet_module_ids, Array, :desc => "Puppet Module ids
|
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}.
|
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.
|
250
|
-
module_records.delete(top_rec) if selected_latest_versions.include?(top_rec.
|
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(:
|
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
|
-
|
99
|
-
filter_by_ids(
|
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
|
-
|
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(&:
|
62
|
+
collection_ids.concat(repo.package_groups.map(&:pulp_id))
|
63
63
|
end
|
64
|
-
collection = PackageGroup.where(:
|
65
|
-
collection = collection.where("
|
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 =
|
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
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
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(:
|
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 :
|
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
|
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
|
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 &&
|
82
|
+
unless session && current_organization_object
|
83
83
|
redirect_to '/select_organization?toState=' + request.path
|
84
84
|
end
|
85
85
|
end
|
@@ -17,7 +17,7 @@ module Katello
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def index
|
20
|
-
org =
|
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 }
|
@@ -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::
|
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.
|
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::
|
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
|
-
|
223
|
-
|
224
|
-
|
225
|
-
:
|
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
|
-
|
236
|
-
|
237
|
-
|
238
|
-
:
|
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
|
-
|
243
|
-
|
244
|
-
|
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
|
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).
|
276
|
-
plan_action(Pulp::Repository::
|
277
|
-
|
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)
|