katello 4.7.6 → 4.8.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of katello might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/controllers/katello/api/registry/registry_proxies_controller.rb +6 -4
- data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +15 -12
- data/app/controllers/katello/api/v2/capsule_content_controller.rb +0 -4
- data/app/controllers/katello/api/v2/content_export_incrementals_controller.rb +22 -81
- data/app/controllers/katello/api/v2/content_exports_controller.rb +11 -80
- data/app/controllers/katello/api/v2/content_imports_controller.rb +1 -0
- data/app/controllers/katello/api/v2/exports_controller.rb +130 -0
- data/app/controllers/katello/api/v2/host_subscriptions_controller.rb +7 -8
- data/app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb +8 -4
- data/app/controllers/katello/api/v2/organizations_controller.rb +3 -0
- data/app/controllers/katello/api/v2/package_groups_controller.rb +0 -52
- data/app/controllers/katello/api/v2/simple_content_access_controller.rb +1 -3
- data/app/controllers/katello/concerns/api/v2/bulk_hosts_extensions.rb +4 -6
- data/app/controllers/katello/concerns/api/v2/registration_controller_extensions.rb +1 -2
- data/app/controllers/katello/concerns/authorization/api/v2/content_views_controller.rb +4 -1
- data/app/controllers/katello/concerns/content_facet_hosts_controller_extensions.rb +24 -0
- data/app/controllers/katello/concerns/hosts_controller_extensions.rb +3 -3
- data/app/helpers/katello/hosts_and_hostgroups_helper.rb +55 -24
- data/app/helpers/katello/katello_urls_helper.rb +0 -15
- data/app/helpers/katello/sync_management_helper.rb +0 -4
- data/app/lib/actions/candlepin/owner/destroy_imports.rb +1 -1
- data/app/lib/actions/katello/capsule_content/sync.rb +0 -4
- data/app/lib/actions/katello/capsule_content/sync_capsule.rb +1 -2
- data/app/lib/actions/katello/content_view/publish.rb +6 -2
- data/app/lib/actions/katello/content_view/remove.rb +8 -2
- data/app/lib/actions/katello/content_view_version/destroy.rb +1 -1
- data/app/lib/actions/katello/environment/destroy.rb +8 -2
- data/app/lib/actions/katello/host/reassign.rb +4 -2
- data/app/lib/actions/katello/organization/simple_content_access/enable.rb +0 -10
- data/app/lib/actions/katello/organization/simple_content_access/toggle.rb +2 -12
- data/app/lib/actions/katello/orphan_cleanup/remove_orphans.rb +0 -1
- data/app/lib/actions/katello/product/destroy.rb +2 -1
- data/app/lib/actions/katello/repository/filtered_index_content.rb +2 -10
- data/app/lib/actions/katello/repository/import_upload.rb +0 -1
- data/app/lib/actions/katello/repository/sync.rb +0 -1
- data/app/lib/actions/katello/repository/update.rb +5 -3
- data/app/lib/actions/katello/repository/upload_files.rb +0 -1
- data/app/lib/actions/pulp3/abstract.rb +0 -6
- data/app/lib/actions/pulp3/content_view/delete_repository_references.rb +1 -2
- data/app/lib/actions/pulp3/content_view_version/create_syncable_export_history.rb +4 -0
- data/app/lib/actions/pulp3/orchestration/content_view_version/export.rb +1 -0
- data/app/lib/actions/pulp3/orchestration/content_view_version/export_repository.rb +7 -2
- data/app/lib/actions/pulp3/orchestration/content_view_version/syncable_export.rb +7 -2
- data/app/lib/actions/pulp3/repository/refresh_distribution.rb +1 -2
- data/app/lib/actions/pulp3/repository/save_distribution_references.rb +2 -2
- data/app/lib/katello/concerns/base_template_scope_extensions.rb +1 -1
- data/app/lib/katello/concerns/renderer_extensions.rb +1 -1
- data/app/lib/katello/event_daemon/runner.rb +12 -9
- data/app/lib/katello/resources/candlepin/consumer.rb +6 -6
- data/app/lib/katello/resources/candlepin/owner.rb +1 -1
- data/app/lib/katello/resources/candlepin/upstream_consumer.rb +3 -4
- data/app/lib/katello/resources/candlepin.rb +4 -4
- data/app/lib/katello/util/errata.rb +12 -10
- data/app/lib/katello/util/search.rb +0 -1
- data/app/lib/katello/validators/content_view_environment_org_validator.rb +5 -2
- data/app/lib/katello/validators/content_view_environment_validator.rb +1 -2
- data/app/lib/katello/validators/generated_content_view_validator.rb +16 -0
- data/app/mailers/katello/errata_mailer.rb +4 -2
- data/app/models/katello/alternate_content_source.rb +5 -1
- data/app/models/katello/concerns/content_facet_host_extensions.rb +25 -14
- data/app/models/katello/concerns/host_managed_extensions.rb +17 -8
- data/app/models/katello/concerns/redhat_extensions.rb +16 -6
- data/app/models/katello/concerns/smart_proxy_extensions.rb +0 -12
- data/app/models/katello/concerns/subscription_facet_host_extensions.rb +1 -0
- data/app/models/katello/content_view.rb +22 -5
- data/app/models/katello/content_view_environment.rb +11 -2
- data/app/models/katello/content_view_environment_content_facet.rb +9 -0
- data/app/models/katello/content_view_version.rb +10 -5
- data/app/models/katello/erratum.rb +6 -1
- data/app/models/katello/glue/candlepin/pool.rb +6 -0
- data/app/models/katello/glue/candlepin/product.rb +7 -1
- data/app/models/katello/glue/candlepin/subscription.rb +5 -0
- data/app/models/katello/glue/provider.rb +26 -26
- data/app/models/katello/host/content_facet.rb +106 -18
- data/app/models/katello/host/info_provider.rb +25 -21
- data/app/models/katello/host/subscription_facet.rb +18 -14
- data/app/models/katello/kt_environment.rb +12 -7
- data/app/models/katello/package_group.rb +0 -12
- data/app/models/katello/pool.rb +4 -1
- data/app/models/katello/product.rb +11 -1
- data/app/models/katello/product_content.rb +0 -4
- data/app/models/katello/repository.rb +11 -11
- data/app/models/katello/root_repository.rb +4 -3
- data/app/models/katello/task_status.rb +0 -18
- data/app/services/katello/candlepin/consumer.rb +2 -2
- data/app/services/katello/host/package_profile_uploader.rb +1 -1
- data/app/services/katello/product_content_finder.rb +11 -12
- data/app/services/katello/pulp3/content_view_version/export.rb +8 -65
- data/app/services/katello/pulp3/content_view_version/export_validation_error.rb +7 -0
- data/app/services/katello/pulp3/content_view_version/export_validator.rb +105 -0
- data/app/services/katello/pulp3/content_view_version/importable_products.rb +1 -1
- data/app/services/katello/pulp3/content_view_version/syncable_format_export.rb +7 -1
- data/app/services/katello/pulp3/erratum.rb +1 -0
- data/app/services/katello/pulp3/module_stream.rb +26 -11
- data/app/services/katello/pulp3/repository/yum.rb +2 -1
- data/app/services/katello/pulp3/smart_proxy_mirror_repository.rb +2 -1
- data/app/services/katello/registration_manager.rb +46 -26
- data/app/services/katello/repository_type.rb +3 -9
- data/app/services/katello/simple_package.rb +22 -0
- data/app/views/foreman/smart_proxies/_content_sync.html.erb +1 -0
- data/app/views/foreman/smart_proxies/_reclaim_space.html.erb +1 -0
- data/app/views/katello/api/v2/content_facet/base.json.rabl +23 -2
- data/app/views/katello/api/v2/content_facet/show.json.rabl +11 -8
- data/app/views/katello/api/v2/content_views/base.json.rabl +1 -1
- data/app/views/katello/api/v2/hosts/base.json.rabl +22 -2
- data/app/views/overrides/activation_keys/_host_environment_select.html.erb +2 -2
- data/config/initializers/monkeys.rb +0 -2
- data/config/routes/api/registry.rb +8 -7
- data/config/routes/api/v2.rb +0 -2
- data/config/routes.rb +3 -0
- data/db/migrate/20200429153103_installed_package_bad_nvrea.rb +1 -1
- data/db/migrate/20220110223754_update_disconnected_settings.rb +4 -8
- data/db/migrate/20220228173251_remove_drpm_from_ignorable_content.rb +7 -3
- data/db/migrate/20220419193414_content_settings_to_dsl_category.rb +1 -1
- data/db/migrate/20220929204746_add_content_view_environment_content_facet.rb +52 -0
- data/db/migrate/20221123212341_remove_pulp_docker_registry_port_setting.rb +5 -0
- data/db/migrate/20230119003859_ensure_repo_username_password_nil_not_blank.rb +1 -1
- data/db/seeds.d/111-upgrade_tasks.rb +2 -1
- data/engines/bastion/app/assets/stylesheets/bastion/bastion.scss +4 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-details.controller.js +2 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-errata-modal.controller.js +0 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-details.controller.js +2 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts.html +2 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/apply-errata.controller.js +11 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/views/host-collection-hosts-list.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/bastion_katello.pot +8 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/de.po +5485 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/es.po +5397 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/fr.po +5658 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ja.po +5284 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ka.po +5231 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ko.po +5275 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/pt_BR.po +5389 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/zh_CN.po +5212 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/zh_TW.po +5145 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/translations.js +9 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/content-access-mode-banner.html +2 -2
- data/lib/katello/engine.rb +2 -1
- data/lib/katello/permission_creator.rb +2 -4
- data/lib/katello/permissions/registry_permissions.rb +5 -5
- data/lib/katello/plugin.rb +22 -14
- data/lib/katello/repository_types/README.md +136 -19
- data/lib/katello/repository_types/deb.rb +0 -1
- data/lib/katello/repository_types/docker.rb +0 -1
- data/lib/katello/repository_types/file.rb +0 -1
- data/lib/katello/repository_types/yum.rb +0 -4
- data/lib/katello/tasks/clean_candlepin_orphaned_products.rake +38 -0
- data/lib/katello/tasks/clean_orphaned_facets.rb +20 -0
- data/lib/katello/tasks/reimport.rake +1 -2
- data/lib/katello/tasks/repository.rake +1 -22
- data/lib/katello/tasks/reset.rake +1 -0
- data/lib/katello/tasks/upgrades/4.8/fix_incorrect_providers.rake +29 -0
- data/lib/katello/version.rb +1 -1
- data/lib/katello.rb +0 -5
- data/locale/bn/katello.po +69 -27
- data/locale/cs/katello.po +69 -27
- data/locale/de/katello.po +78 -36
- data/locale/en/katello.po +69 -27
- data/locale/es/katello.po +70 -28
- data/locale/fr/katello.po +73 -31
- data/locale/gu/katello.po +69 -27
- data/locale/hi/katello.po +69 -27
- data/locale/it/katello.po +69 -27
- data/locale/ja/katello.po +73 -31
- data/locale/ka/katello.po +73 -31
- data/locale/katello.pot +335 -262
- data/locale/kn/katello.po +69 -27
- data/locale/ko/katello.po +69 -27
- data/locale/mr/katello.po +69 -27
- data/locale/or/katello.po +69 -27
- data/locale/pa/katello.po +69 -27
- data/locale/pt/katello.po +69 -27
- data/locale/pt_BR/katello.po +70 -28
- data/locale/ru/katello.po +70 -28
- data/locale/ta/katello.po +69 -27
- data/locale/te/katello.po +69 -27
- data/locale/zh_CN/katello.po +73 -31
- data/locale/zh_TW/katello.po +70 -28
- data/webpack/components/Content/ContentPage.js +51 -35
- data/webpack/components/Content/__tests__/ContentPage.test.js +2 -4
- data/webpack/components/Content/__tests__/__snapshots__/ContentPage.test.js.snap +22 -3
- data/webpack/components/Table/EmptyStateMessage.js +14 -11
- data/webpack/components/Table/MainTable.js +36 -15
- data/webpack/components/Table/TableWrapper.js +25 -25
- data/webpack/components/Table/__test__/emptyStateMessage.test.js +51 -0
- data/webpack/components/extensions/HostDetails/Cards/ErrataOverviewCard.js +5 -4
- data/webpack/components/extensions/HostDetails/Cards/HostCollectionsCard/HostCollectionsModal.js +1 -1
- data/webpack/components/extensions/HostDetails/Cards/HostCollectionsCard/__tests__/hostCollectionsModal.test.js +1 -17
- data/webpack/components/extensions/HostDetails/Tabs/ErrataTab/ErrataTab.js +18 -9
- data/webpack/components/extensions/HostDetails/Tabs/ModuleStreamsTab/ModuleStreamsTab.js +1 -2
- data/webpack/components/extensions/HostDetails/Tabs/PackagesTab/PackageInstallModal.js +1 -2
- data/webpack/components/extensions/HostDetails/Tabs/PackagesTab/PackagesTab.js +1 -2
- data/webpack/components/extensions/HostDetails/Tabs/RepositorySetsTab/RepositorySetsTab.js +47 -27
- data/webpack/components/extensions/HostDetails/Tabs/TracesTab/TracesTab.js +1 -2
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js +2 -21
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/moduleStreamsTab.test.js +1 -28
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/packageInstallModal.test.js +1 -10
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/packagesTab.test.js +1 -18
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/repositorySetsTab.test.js +1 -17
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/tracesTab.test.js +1 -15
- data/webpack/global_test_setup.js +1 -1
- data/webpack/scenes/AlternateContentSources/Create/ACSCreateWizard.js +12 -10
- data/webpack/scenes/AlternateContentSources/Create/Steps/ACSCredentials.js +6 -0
- data/webpack/scenes/AlternateContentSources/Create/Steps/ACSSmartProxies.js +1 -0
- data/webpack/scenes/AlternateContentSources/Create/Steps/AcsUrlPaths.js +3 -10
- data/webpack/scenes/AlternateContentSources/Create/Steps/NameACS.js +1 -0
- data/webpack/scenes/AlternateContentSources/Create/__tests__/acsCreate.test.js +3 -3
- data/webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditDetails.js +1 -0
- data/webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditURLPaths.js +12 -4
- data/webpack/scenes/AlternateContentSources/MainTable/ACSTable.js +7 -4
- data/webpack/scenes/AlternateContentSources/MainTable/__tests__/acsTable.test.js +4 -8
- data/webpack/scenes/AlternateContentSources/helpers.js +1 -1
- data/webpack/scenes/Content/Details/ContentRepositories.js +5 -4
- data/webpack/scenes/Content/Details/__tests__/contentDetail.test.js +1 -12
- data/webpack/scenes/Content/Table/ContentTable.js +2 -1
- data/webpack/scenes/Content/__tests__/contentTable.test.js +1 -14
- data/webpack/scenes/ContentViews/Delete/__tests__/contentViewDelete.test.js +1 -25
- data/webpack/scenes/ContentViews/Details/ComponentContentViews/ContentViewComponents.js +2 -1
- data/webpack/scenes/ContentViews/Details/ComponentContentViews/__tests__/contentViewComponents.test.js +44 -31
- data/webpack/scenes/ContentViews/Details/ContentViewDetails.js +2 -0
- data/webpack/scenes/ContentViews/Details/Filters/AffectedRepositories/AffectedRepositoryTable.js +6 -1
- data/webpack/scenes/ContentViews/Details/Filters/CVContainerImageFilterContent.js +2 -1
- data/webpack/scenes/ContentViews/Details/Filters/CVDebFilterContent.js +2 -1
- data/webpack/scenes/ContentViews/Details/Filters/CVErrataIDFilterContent.js +3 -1
- data/webpack/scenes/ContentViews/Details/Filters/CVModuleStreamFilterContent.js +3 -1
- data/webpack/scenes/ContentViews/Details/Filters/CVPackageGroupFilterContent.js +3 -1
- data/webpack/scenes/ContentViews/Details/Filters/CVRpmFilterContent.js +2 -1
- data/webpack/scenes/ContentViews/Details/Filters/ContentViewFilterDetailsHeader.js +2 -0
- data/webpack/scenes/ContentViews/Details/Filters/ContentViewFilters.js +2 -1
- data/webpack/scenes/ContentViews/Details/Filters/MatchContentModal/CVDebMatchContentModal.js +1 -1
- data/webpack/scenes/ContentViews/Details/Filters/MatchContentModal/CVRpmMatchContentModal.js +1 -1
- data/webpack/scenes/ContentViews/Details/Filters/MatchContentModal/__tests__/CVRpmMatchContentModal.test.js +35 -33
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/CVContainerImageFilterContent.test.js +48 -45
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/CVRpmFilterContent.test.js +58 -24
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/ContentViewPackageGroupFilter.test.js +64 -0
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilterDetails.test.js +36 -20
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilters.test.js +40 -23
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvErrataIDFilter.test.js +0 -13
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvModuleStreamFilter.test.js +0 -13
- data/webpack/scenes/ContentViews/Details/Histories/ContentViewHistories.js +2 -1
- data/webpack/scenes/ContentViews/Details/Histories/__tests__/contentViewHistory.test.js +1 -10
- data/webpack/scenes/ContentViews/Details/Repositories/ContentViewRepositories.js +2 -1
- data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewAddRemove.test.js +1 -10
- data/webpack/scenes/ContentViews/Details/Versions/Compare/CVVersionCompareConfig.js +21 -9
- data/webpack/scenes/ContentViews/Details/Versions/Compare/CVVersionCompareTable.js +4 -0
- data/webpack/scenes/ContentViews/Details/Versions/Compare/__tests__/CVVersionCompare.test.js +1 -32
- data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersions.js +3 -1
- data/webpack/scenes/ContentViews/Details/Versions/Delete/__tests__/cvVersionRemove.test.js +1 -15
- data/webpack/scenes/ContentViews/Details/Versions/Delete/affectedActivationKeys.js +1 -1
- data/webpack/scenes/ContentViews/Details/Versions/Delete/affectedHosts.js +1 -2
- data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionDetailConfig.js +31 -9
- data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionDetailsTable.js +4 -0
- data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionDetails.test.js +30 -14
- data/webpack/scenes/ContentViews/Table/ContentViewsTable.js +1 -1
- data/webpack/scenes/ContentViews/__tests__/contentViewPage.test.js +55 -120
- data/webpack/scenes/ContentViews/components/WizardHeader.js +1 -1
- data/webpack/scenes/ContentViews/expansions/RelatedContentViewComponentsModal.js +1 -1
- data/webpack/scenes/ContentViews/expansions/__tests__/contentViewComponentsModal.test.js +8 -1
- data/webpack/scenes/ModuleStreams/ModuleStreamsPage.js +3 -9
- data/webpack/scenes/ModuleStreams/__tests__/__snapshots__/ModuleStreamPage.test.js.snap +7 -1
- data/webpack/scenes/RedHatRepositories/components/Search.js +22 -16
- data/webpack/scenes/RedHatRepositories/index.scss +20 -1
- data/webpack/scenes/SmartProxy/SmartProxyContentTable.js +12 -1
- data/webpack/scenes/Subscriptions/Manifest/CdnConfigurationTab/CdnTypeForm.js +1 -1
- data/webpack/scenes/Subscriptions/Manifest/CdnConfigurationTab/CustomCdnTypeForm.js +1 -1
- data/webpack/scenes/Subscriptions/SubscriptionsPage.js +21 -19
- data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsPage.test.js.snap +34 -1
- data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/SubscriptionsToolbar.js +20 -7
- data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/SubscriptionsToolbar.test.js +0 -1
- data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/__snapshots__/SubscriptionsToolbar.test.js.snap +65 -15
- metadata +49 -146
- data/app/lib/actions/katello/organization/simple_content_access/prepare_content_overrides.rb +0 -36
- data/app/lib/actions/katello/pulp_selector.rb +0 -24
- data/app/lib/actions/katello/repository/correct_checksum.rb +0 -24
- data/app/lib/actions/katello/repository/destroy_package_group.rb +0 -26
- data/app/lib/actions/katello/repository/upload_package_group.rb +0 -24
- data/app/lib/actions/pulp/abstract.rb +0 -37
- data/app/lib/actions/pulp/abstract_async_task.rb +0 -154
- data/app/lib/actions/pulp/abstract_async_task_group.rb +0 -94
- data/app/lib/actions/pulp/consumer/sync_capsule.rb +0 -45
- data/app/lib/actions/pulp/consumer/unassociate_units.rb +0 -20
- data/app/lib/actions/pulp/expect_one_task.rb +0 -11
- data/app/lib/actions/pulp/orchestration/orphan_cleanup/remove_orphans.rb +0 -16
- data/app/lib/actions/pulp/orchestration/repository/copy_all_units.rb +0 -19
- data/app/lib/actions/pulp/orchestration/repository/delete.rb +0 -15
- data/app/lib/actions/pulp/orchestration/repository/refresh.rb +0 -14
- data/app/lib/actions/pulp/orchestration/repository/refresh_if_needed.rb +0 -13
- data/app/lib/actions/pulp/orchestration/repository/refresh_repos.rb +0 -19
- data/app/lib/actions/pulp/orchestration/repository/remove_units.rb +0 -14
- data/app/lib/actions/pulp/orchestration/repository/smart_proxy_sync.rb +0 -34
- data/app/lib/actions/pulp/orchestration/repository/sync.rb +0 -18
- data/app/lib/actions/pulp/orchestration/repository/upload_content.rb +0 -37
- data/app/lib/actions/pulp/orphan_cleanup/remove_orphans.rb +0 -15
- data/app/lib/actions/pulp/orphan_cleanup/remove_unneeded_repos.rb +0 -16
- data/app/lib/actions/pulp/repository/abstract_copy_content.rb +0 -45
- data/app/lib/actions/pulp/repository/abstract_remove_content.rb +0 -32
- data/app/lib/actions/pulp/repository/clear.rb +0 -18
- data/app/lib/actions/pulp/repository/copy_all_units.rb +0 -30
- data/app/lib/actions/pulp/repository/copy_units.rb +0 -25
- data/app/lib/actions/pulp/repository/create.rb +0 -28
- data/app/lib/actions/pulp/repository/create_in_plan.rb +0 -15
- data/app/lib/actions/pulp/repository/create_upload_request.rb +0 -20
- data/app/lib/actions/pulp/repository/delete_upload_request.rb +0 -19
- data/app/lib/actions/pulp/repository/destroy.rb +0 -28
- data/app/lib/actions/pulp/repository/distributor_publish.rb +0 -25
- data/app/lib/actions/pulp/repository/download.rb +0 -16
- data/app/lib/actions/pulp/repository/import_upload.rb +0 -19
- data/app/lib/actions/pulp/repository/presenters/abstract_sync_presenter.rb +0 -47
- data/app/lib/actions/pulp/repository/presenters/deb_presenter.rb +0 -95
- data/app/lib/actions/pulp/repository/presenters/docker_presenter.rb +0 -103
- data/app/lib/actions/pulp/repository/presenters/file_unit_presenter.rb +0 -42
- data/app/lib/actions/pulp/repository/presenters/yum_presenter.rb +0 -131
- data/app/lib/actions/pulp/repository/refresh.rb +0 -21
- data/app/lib/actions/pulp/repository/regenerate_applicability.rb +0 -21
- data/app/lib/actions/pulp/repository/remove_distribution.rb +0 -11
- data/app/lib/actions/pulp/repository/remove_units.rb +0 -44
- data/app/lib/actions/pulp/repository/sync.rb +0 -99
- data/app/lib/actions/pulp/repository/upload_file.rb +0 -28
- data/app/lib/actions/pulp/repository_group/create.rb +0 -31
- data/app/lib/actions/pulp/repository_group/delete.rb +0 -17
- data/app/lib/actions/pulp/repository_group/export.rb +0 -51
- data/app/lib/katello/util/content_overrides_migrator.rb +0 -98
- data/app/lib/katello/util/package_clause_generator.rb +0 -77
- data/app/models/katello/glue/pulp/pulp_errors.rb +0 -9
- data/app/models/katello/glue/pulp/repo.rb +0 -353
- data/app/models/katello/pulp_sync_status.rb +0 -165
- data/app/models/katello/pulp_task_status.rb +0 -63
- data/app/services/katello/pulp/content.rb +0 -24
- data/app/services/katello/pulp/importer_comparison.rb +0 -28
- data/app/services/katello/pulp/repository/deb.rb +0 -61
- data/app/services/katello/pulp/repository/docker.rb +0 -82
- data/app/services/katello/pulp/repository/file.rb +0 -52
- data/app/services/katello/pulp/repository/yum.rb +0 -205
- data/app/services/katello/pulp/repository.rb +0 -327
- data/app/services/katello/pulp/server.rb +0 -35
- data/app/services/katello/pulp/simple_package.rb +0 -24
- data/app/services/katello/pulp/smart_proxy_repository.rb +0 -52
- data/lib/monkeys/fix_deb_optimized_sync.rb +0 -35
- data/lib/monkeys/fix_pulp_container_path.rb +0 -35
- data/locale/bn/LC_MESSAGES/katello.mo +0 -0
- data/locale/cs/LC_MESSAGES/katello.mo +0 -0
- data/locale/de/LC_MESSAGES/katello.mo +0 -0
- data/locale/en/LC_MESSAGES/katello.mo +0 -0
- data/locale/es/LC_MESSAGES/katello.mo +0 -0
- data/locale/fr/LC_MESSAGES/katello.mo +0 -0
- data/locale/gu/LC_MESSAGES/katello.mo +0 -0
- data/locale/hi/LC_MESSAGES/katello.mo +0 -0
- data/locale/it/LC_MESSAGES/katello.mo +0 -0
- data/locale/ja/LC_MESSAGES/katello.mo +0 -0
- data/locale/ka/LC_MESSAGES/katello.mo +0 -0
- data/locale/kn/LC_MESSAGES/katello.mo +0 -0
- data/locale/ko/LC_MESSAGES/katello.mo +0 -0
- data/locale/mr/LC_MESSAGES/katello.mo +0 -0
- data/locale/or/LC_MESSAGES/katello.mo +0 -0
- data/locale/pa/LC_MESSAGES/katello.mo +0 -0
- data/locale/pt/LC_MESSAGES/katello.mo +0 -0
- data/locale/pt_BR/LC_MESSAGES/katello.mo +0 -0
- data/locale/ru/LC_MESSAGES/katello.mo +0 -0
- data/locale/ta/LC_MESSAGES/katello.mo +0 -0
- data/locale/te/LC_MESSAGES/katello.mo +0 -0
- data/locale/zanata.xml +0 -30
- data/locale/zh_CN/LC_MESSAGES/katello.mo +0 -0
- data/locale/zh_TW/LC_MESSAGES/katello.mo +0 -0
- data/webpack/scenes/ContentViews/Details/Filters/MatchContentModal/__tests__/CVRpmMatchContentSearch.fixtures.json +0 -33
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4b8d6a07335f66fa2aa32144b730a13949137d827c6df5d6418d732f3c16ffb
|
4
|
+
data.tar.gz: 8b38219d487f142d85e53a53f0c839e021b31edfca2b3ba71cd789dee1e1d378
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7a5a28b77b887eafbef71455fa92c9321c031bd986d76b4fa0a70609031aaebea564363463c96b354cbe4efd44c377ee4aa7b564f9b2e4e2a0a099923bff26e
|
7
|
+
data.tar.gz: 7e951a7f6782c464d0cf07f0a7fbdfcfbe8b273680e89cb49bfff44cc7ee136c4c76268c86f316f7e0a80e109011f23b7bc2a5646ac8f3c7997560d9b803516f
|
@@ -210,12 +210,10 @@ module Katello
|
|
210
210
|
def pull_blob
|
211
211
|
headers = {}
|
212
212
|
headers['Accept'] = request.headers['Accept'] if request.headers['Accept']
|
213
|
-
|
214
|
-
#when pulp 2 is removed, this should no longer be needed, and all clients should be redirected
|
215
|
-
render json: blob_response
|
216
|
-
end
|
213
|
+
redirect_client { Resources::Registry::Proxy.get(@_request.fullpath, headers, max_redirects: 0) }
|
217
214
|
end
|
218
215
|
|
216
|
+
# FIXME: Reimplement for Pulp 3.
|
219
217
|
def push_manifest
|
220
218
|
repository = params[:repository]
|
221
219
|
tag = params[:tag]
|
@@ -242,6 +240,8 @@ module Katello
|
|
242
240
|
render json: {}
|
243
241
|
end
|
244
242
|
|
243
|
+
# FIXME: This is referring to a non-existent Pulp 2 server.
|
244
|
+
# Pulp 3 container push support is needed instead.
|
245
245
|
def pulp_content
|
246
246
|
Katello.pulp_server.resources.content
|
247
247
|
end
|
@@ -414,6 +414,7 @@ module Katello
|
|
414
414
|
tar_file
|
415
415
|
end
|
416
416
|
|
417
|
+
# FIXME: Reimplement for Pulp 3.
|
417
418
|
def upload_manifest(tar_file)
|
418
419
|
upload_id = pulp_content.create_upload_request['upload_id']
|
419
420
|
filename = tmp_file(tar_file)
|
@@ -439,6 +440,7 @@ module Katello
|
|
439
440
|
pulp_content.delete_upload_request(upload_id) if upload_id
|
440
441
|
end
|
441
442
|
|
443
|
+
# FIXME: Reimplement for Pulp 3.
|
442
444
|
def upload_tag(digest, tag)
|
443
445
|
upload_id = pulp_content.create_upload_request['upload_id']
|
444
446
|
uploads = [{
|
@@ -211,7 +211,7 @@ module Katello
|
|
211
211
|
|
212
212
|
#api :POST, "/environments/:environment_id/consumers", N_("Register a consumer in environment")
|
213
213
|
def consumer_create
|
214
|
-
host = Katello::RegistrationManager.process_registration(rhsm_params,
|
214
|
+
host = Katello::RegistrationManager.process_registration(rhsm_params, find_content_view_environments)
|
215
215
|
|
216
216
|
host.reload
|
217
217
|
|
@@ -271,7 +271,7 @@ module Katello
|
|
271
271
|
|
272
272
|
def get_parent_host(headers)
|
273
273
|
hostnames = headers["HTTP_X_FORWARDED_HOST"]
|
274
|
-
host = hostnames.split(/[
|
274
|
+
host = hostnames.split(/[,,:]/)[0].strip if hostnames
|
275
275
|
host || URI.parse(Setting[:foreman_url]).host
|
276
276
|
end
|
277
277
|
|
@@ -308,24 +308,27 @@ module Katello
|
|
308
308
|
@host = ::Host::Managed.unscoped.find(facet.host_id)
|
309
309
|
end
|
310
310
|
|
311
|
-
def
|
312
|
-
|
311
|
+
def find_content_view_environments
|
312
|
+
environments = []
|
313
313
|
|
314
314
|
if params.key?(:environment_id)
|
315
|
-
|
315
|
+
environments = [get_content_view_environment("cp_id", params[:environment_id])]
|
316
316
|
elsif params.key?(:environments)
|
317
|
-
|
318
|
-
|
319
|
-
|
317
|
+
if params['environments'].length > 1 && !Setting['allow_multiple_content_views']
|
318
|
+
fail HttpErrors::BadRequest, _('Registering to multiple environments is not enabled.')
|
319
|
+
end
|
320
|
+
environments = params[:environments].map do |env|
|
321
|
+
get_content_view_environment("cp_id", env['id'])
|
322
|
+
end
|
323
|
+
elsif params.key?(:organization_id) && !params.key?(:environment_id) && !params.key?(:environments)
|
320
324
|
organization = Organization.current
|
321
|
-
|
325
|
+
environments = organization.library.content_view_environment
|
322
326
|
elsif User.current.default_organization.present?
|
323
|
-
|
327
|
+
environments = User.current.default_organization.library.content_view_environment
|
324
328
|
else
|
325
329
|
fail HttpErrors::NotFound, _("User '%s' did not specify an organization ID and does not have a default organization.") % current_user.login
|
326
330
|
end
|
327
|
-
|
328
|
-
environment
|
331
|
+
environments
|
329
332
|
end
|
330
333
|
|
331
334
|
def find_hypervisor_organization
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module Katello
|
2
|
-
class Api::V2::ContentExportIncrementalsController < Api::V2::
|
2
|
+
class Api::V2::ContentExportIncrementalsController < Api::V2::ExportsController
|
3
3
|
before_action :find_exportable_organization, :only => [:library]
|
4
4
|
before_action :find_exportable_content_view_version, :only => [:version]
|
5
5
|
before_action :find_exportable_repository, :only => [:repository]
|
@@ -7,70 +7,45 @@ module Katello
|
|
7
7
|
before_action :find_repository_export_view, :only => [:repository]
|
8
8
|
before_action :find_history, :only => [:version, :library, :repository]
|
9
9
|
|
10
|
+
def_param_group :incremental do
|
11
|
+
param :from_history_id, :number, :desc => N_("Export history identifier used for incremental export. "\
|
12
|
+
"If not provided the most recent export history will be used."), :required => false
|
13
|
+
end
|
14
|
+
|
10
15
|
api :POST, "/content_export_incrementals/version", N_("Performs an incremental-export of a content view version.")
|
11
16
|
param :id, :number, :desc => N_("Content view version identifier"), :required => true
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
"If not provided the most recent export history will be used."), :required => false
|
17
|
-
param :fail_on_missing_content, :bool, :desc => N_("Fails if any of the repositories belonging to this version"\
|
18
|
-
" are unexportable. False by default."), :required => false
|
17
|
+
param_group :version_fail_on_missing_content, Api::V2::ExportsController
|
18
|
+
param_group :destination_server, Api::V2::ExportsController
|
19
|
+
param_group :export, Api::V2::ExportsController
|
20
|
+
param_group :incremental
|
19
21
|
def version
|
20
|
-
|
21
|
-
content_view_version: @version,
|
22
|
-
destination_server: params[:destination_server],
|
23
|
-
chunk_size: params[:chunk_size_gb],
|
24
|
-
from_history: @history,
|
25
|
-
fail_on_missing_content: ::Foreman::Cast.to_bool(params[:fail_on_missing_content]))
|
26
|
-
|
27
|
-
respond_for_async :resource => tasks
|
22
|
+
export_content_view_version
|
28
23
|
end
|
29
24
|
|
30
25
|
api :POST, "/content_export_incrementals/library", N_("Performs an incremental-export of the repositories in library.")
|
31
26
|
param :organization_id, :number, :desc => N_("Organization identifier"), :required => true
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
"If not provided the most recent export history will be used."), :required => false
|
37
|
-
param :fail_on_missing_content, :bool, :desc => N_("Fails if any of the repositories belonging to this organization"\
|
38
|
-
" are unexportable. False by default."), :required => false
|
27
|
+
param_group :org_fail_on_missing_content, Api::V2::ExportsController
|
28
|
+
param_group :destination_server, Api::V2::ExportsController
|
29
|
+
param_group :export, Api::V2::ExportsController
|
30
|
+
param_group :incremental
|
39
31
|
def library
|
40
|
-
|
41
|
-
@organization,
|
42
|
-
destination_server: params[:destination_server],
|
43
|
-
chunk_size: params[:chunk_size_gb],
|
44
|
-
from_history: @history,
|
45
|
-
fail_on_missing_content: ::Foreman::Cast.to_bool(params[:fail_on_missing_content]))
|
46
|
-
respond_for_async :resource => tasks
|
32
|
+
export_library
|
47
33
|
end
|
48
34
|
|
49
35
|
api :POST, "/content_export_incrementals/repository", N_("Performs a incremental-export of the repository in library.")
|
50
36
|
param :id, :number, :desc => N_("Repository identifier"), :required => true
|
51
|
-
|
52
|
-
|
53
|
-
param :from_history_id, :number, :desc => N_("Export history identifier used for incremental export. "\
|
54
|
-
"If not provided the most recent export history will be used."), :required => false
|
37
|
+
param_group :export, Api::V2::ExportsController
|
38
|
+
param_group :incremental
|
55
39
|
def repository
|
56
|
-
|
57
|
-
@repository,
|
58
|
-
chunk_size: params[:chunk_size_gb],
|
59
|
-
from_history: @history)
|
60
|
-
respond_for_async :resource => tasks
|
40
|
+
export_repository
|
61
41
|
end
|
62
42
|
|
63
43
|
private
|
64
44
|
|
65
|
-
def find_exportable_content_view_version
|
66
|
-
@version = ContentViewVersion.exportable.find_by_id(params[:id])
|
67
|
-
throw_resource_not_found(name: 'content view version', id: params[:id]) if @version.blank?
|
68
|
-
@view = @version.content_view
|
69
|
-
end
|
70
|
-
|
71
45
|
def find_library_export_view
|
72
46
|
@view = ::Katello::Pulp3::ContentViewVersion::Export.find_library_export_view(destination_server: params[:destination_server],
|
73
47
|
organization: @organization,
|
48
|
+
format: find_export_format,
|
74
49
|
create_by_default: false)
|
75
50
|
if @view.blank?
|
76
51
|
msg = _("Unable to incrementally export. Do a Full Export on the library content "\
|
@@ -82,46 +57,12 @@ module Katello
|
|
82
57
|
def find_repository_export_view
|
83
58
|
@view = ::Katello::Pulp3::ContentViewVersion::Export.find_repository_export_view(
|
84
59
|
repository: @repository,
|
85
|
-
create_by_default: false
|
60
|
+
create_by_default: false,
|
61
|
+
format: find_export_format)
|
86
62
|
if @view.blank?
|
87
63
|
msg = _("Unable to incrementally export. Do a Full Export on the repository content.")
|
88
64
|
fail HttpErrors::BadRequest, msg
|
89
65
|
end
|
90
66
|
end
|
91
|
-
|
92
|
-
def find_history
|
93
|
-
if params[:from_history_id].present?
|
94
|
-
@history = ::Katello::ContentViewVersionExportHistory.find(params[:from_history_id])
|
95
|
-
if @history.blank?
|
96
|
-
throw_resource_not_found(name: 'export history',
|
97
|
-
id: params[:from_history_id])
|
98
|
-
end
|
99
|
-
else
|
100
|
-
@history = ::Katello::ContentViewVersionExportHistory.
|
101
|
-
latest(@view, destination_server: params[:destination_server])
|
102
|
-
if @history.blank?
|
103
|
-
msg = _("No existing export history was found to perform an incremental export. A full export must be performed")
|
104
|
-
fail HttpErrors::NotFound, msg
|
105
|
-
end
|
106
|
-
end
|
107
|
-
end
|
108
|
-
|
109
|
-
def find_exportable_organization
|
110
|
-
find_organization
|
111
|
-
unless @organization.can_export_content?
|
112
|
-
throw_resource_not_found(name: 'organization', id: params[:organization_id])
|
113
|
-
end
|
114
|
-
end
|
115
|
-
|
116
|
-
def find_exportable_repository
|
117
|
-
@repository = Repository.find_by_id(params[:id])
|
118
|
-
if @repository.blank?
|
119
|
-
throw_resource_not_found(name: 'repository', id: params[:id])
|
120
|
-
end
|
121
|
-
|
122
|
-
unless @repository.organization.can_export_content?
|
123
|
-
throw_resource_not_found(name: 'organization', id: @repository.organization.id)
|
124
|
-
end
|
125
|
-
end
|
126
67
|
end
|
127
68
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module Katello
|
2
|
-
class Api::V2::ContentExportsController < Api::V2::
|
2
|
+
class Api::V2::ContentExportsController < Api::V2::ExportsController
|
3
3
|
before_action :find_exportable_organization, :only => [:library]
|
4
4
|
before_action :find_exportable_content_view_version, :only => [:version]
|
5
5
|
before_action :find_exportable_repository, :only => [:repository]
|
@@ -29,96 +29,27 @@ module Katello
|
|
29
29
|
|
30
30
|
api :POST, "/content_exports/version", N_("Performs a full-export of a content view version.")
|
31
31
|
param :id, :number, :desc => N_("Content view version identifier"), :required => true
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
param :fail_on_missing_content, :bool, :desc => N_("Fails if any of the repositories belonging to this version"\
|
36
|
-
" are unexportable. False by default."), :required => false
|
37
|
-
param :format, ::Katello::Pulp3::ContentViewVersion::Export::FORMATS,
|
38
|
-
:desc => N_("Export formats. Choose syncable if content is to be imported via repository sync. "\
|
39
|
-
"Choose importable if content is to be imported via hammer content-import.
|
40
|
-
Defaults to importable."),
|
41
|
-
:required => false
|
32
|
+
param_group :version_fail_on_missing_content, Api::V2::ExportsController
|
33
|
+
param_group :destination_server, Api::V2::ExportsController
|
34
|
+
param_group :export, Api::V2::ExportsController
|
42
35
|
def version
|
43
|
-
|
44
|
-
content_view_version: @version,
|
45
|
-
destination_server: params[:destination_server],
|
46
|
-
chunk_size: params[:chunk_size_gb],
|
47
|
-
fail_on_missing_content: ::Foreman::Cast.to_bool(params[:fail_on_missing_content]),
|
48
|
-
format: find_export_format)
|
49
|
-
respond_for_async :resource => tasks
|
36
|
+
export_content_view_version
|
50
37
|
end
|
51
38
|
|
52
39
|
api :POST, "/content_exports/library", N_("Performs a full-export of the repositories in library.")
|
53
40
|
param :organization_id, :number, :desc => N_("Organization identifier"), :required => true
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
param :fail_on_missing_content, :bool, :desc => N_("Fails if any of the repositories belonging to this organization"\
|
58
|
-
" are unexportable. False by default."), :required => false
|
59
|
-
param :format, ::Katello::Pulp3::ContentViewVersion::Export::FORMATS,
|
60
|
-
:desc => N_("Export formats. Choose syncable if content is to be imported via repository sync. "\
|
61
|
-
"Choose importable if content is to be imported via hammer content-import.
|
62
|
-
Defaults to importable."),
|
63
|
-
:required => false
|
41
|
+
param_group :org_fail_on_missing_content, Api::V2::ExportsController
|
42
|
+
param_group :destination_server, Api::V2::ExportsController
|
43
|
+
param_group :export, Api::V2::ExportsController
|
64
44
|
def library
|
65
|
-
|
66
|
-
@organization,
|
67
|
-
destination_server: params[:destination_server],
|
68
|
-
chunk_size: params[:chunk_size_gb],
|
69
|
-
fail_on_missing_content: ::Foreman::Cast.to_bool(params[:fail_on_missing_content]),
|
70
|
-
format: find_export_format)
|
71
|
-
respond_for_async :resource => tasks
|
45
|
+
export_library
|
72
46
|
end
|
73
47
|
|
74
48
|
api :POST, "/content_exports/repository", N_("Performs a full-export of the repository in library.")
|
75
49
|
param :id, :number, :desc => N_("Repository identifier"), :required => true
|
76
|
-
|
77
|
-
"no greater than the specified size in gigabytes."), :required => false
|
78
|
-
param :format, ::Katello::Pulp3::ContentViewVersion::Export::FORMATS,
|
79
|
-
:desc => N_("Export formats. Choose syncable if content is to be imported via repository sync. "\
|
80
|
-
"Choose importable if content is to be imported via hammer content-import.
|
81
|
-
Defaults to importable."),
|
82
|
-
:required => false
|
50
|
+
param_group :export, Api::V2::ExportsController
|
83
51
|
def repository
|
84
|
-
|
85
|
-
@repository,
|
86
|
-
chunk_size: params[:chunk_size_gb],
|
87
|
-
format: find_export_format)
|
88
|
-
respond_for_async :resource => tasks
|
89
|
-
end
|
90
|
-
|
91
|
-
private
|
92
|
-
|
93
|
-
def find_exportable_repository
|
94
|
-
@repository = Repository.find_by_id(params[:id])
|
95
|
-
if @repository.blank? || !@repository.organization.can_export_content?
|
96
|
-
throw_resource_not_found(name: 'repository', id: params[:id])
|
97
|
-
end
|
98
|
-
end
|
99
|
-
|
100
|
-
def find_exportable_content_view_version
|
101
|
-
@version = ContentViewVersion.exportable.find_by_id(params[:id])
|
102
|
-
throw_resource_not_found(name: 'content view version', id: params[:id]) if @version.blank?
|
103
|
-
end
|
104
|
-
|
105
|
-
def find_exportable_organization
|
106
|
-
find_organization
|
107
|
-
unless @organization.can_export_content?
|
108
|
-
throw_resource_not_found(name: 'organization', id: params[:organization_id])
|
109
|
-
end
|
110
|
-
end
|
111
|
-
|
112
|
-
def find_export_format
|
113
|
-
if params[:format]
|
114
|
-
unless ::Katello::Pulp3::ContentViewVersion::Export::FORMATS.include?(params[:format])
|
115
|
-
fail HttpErrors::UnprocessableEntity, _('Invalid export format provided. Format must be one of %s ') %
|
116
|
-
::Katello::Pulp3::ContentViewVersion::Export::FORMATS.join(',')
|
117
|
-
end
|
118
|
-
params[:format]
|
119
|
-
else
|
120
|
-
::Katello::Pulp3::ContentViewVersion::Export::IMPORTABLE
|
121
|
-
end
|
52
|
+
export_repository
|
122
53
|
end
|
123
54
|
end
|
124
55
|
end
|
@@ -0,0 +1,130 @@
|
|
1
|
+
module Katello
|
2
|
+
class Api::V2::ExportsController < Api::V2::ApiController
|
3
|
+
resource_description do
|
4
|
+
api_version 'v2'
|
5
|
+
api_base_url "/katello/api"
|
6
|
+
end
|
7
|
+
|
8
|
+
def_param_group :export do
|
9
|
+
param :chunk_size_gb, :number,
|
10
|
+
:desc => N_("Split the exported content into archives "\
|
11
|
+
"no greater than the specified size in gigabytes."), :required => false
|
12
|
+
|
13
|
+
param :format, ::Katello::Pulp3::ContentViewVersion::Export::FORMATS,
|
14
|
+
:desc => N_("Export formats."\
|
15
|
+
"Choose syncable if the exported content needs to be in a yum format. "\
|
16
|
+
"This option is only available for %{syncable_repos} repositories. "\
|
17
|
+
"Choose importable if the importing server uses the same version "\
|
18
|
+
" and exported content needs to be one "\
|
19
|
+
"of %{importable_repos} repositories."\
|
20
|
+
% {
|
21
|
+
syncable_repos: ::Katello::Repository.exportable_types(
|
22
|
+
format: ::Katello::Pulp3::ContentViewVersion::Export::SYNCABLE).join(", "),
|
23
|
+
importable_repos: ::Katello::Repository.exportable_types(
|
24
|
+
format: ::Katello::Pulp3::ContentViewVersion::Export::IMPORTABLE).join(", ")
|
25
|
+
}),
|
26
|
+
:required => false
|
27
|
+
end
|
28
|
+
|
29
|
+
def_param_group :org_fail_on_missing_content do
|
30
|
+
param :fail_on_missing_content, :bool,
|
31
|
+
:desc => N_("Fails if any of the repositories belonging to this organization"\
|
32
|
+
" are unexportable. False by default."), :required => false
|
33
|
+
end
|
34
|
+
|
35
|
+
def_param_group :version_fail_on_missing_content do
|
36
|
+
param :fail_on_missing_content, :bool,
|
37
|
+
:desc => N_("Fails if any of the repositories belonging to this version"\
|
38
|
+
" are unexportable. False by default."), :required => false
|
39
|
+
end
|
40
|
+
|
41
|
+
def_param_group :destination_server do
|
42
|
+
param :destination_server, String, :desc => N_("Destination Server name"), :required => false
|
43
|
+
end
|
44
|
+
|
45
|
+
def export_repository
|
46
|
+
tasks = async_task(::Actions::Pulp3::Orchestration::ContentViewVersion::ExportRepository,
|
47
|
+
@repository,
|
48
|
+
chunk_size: params[:chunk_size_gb],
|
49
|
+
from_history: @history,
|
50
|
+
format: find_export_format)
|
51
|
+
respond_for_async :resource => tasks
|
52
|
+
end
|
53
|
+
|
54
|
+
def export_content_view_version
|
55
|
+
tasks = async_task(Actions::Katello::ContentViewVersion::Export,
|
56
|
+
content_view_version: @version,
|
57
|
+
destination_server: params[:destination_server],
|
58
|
+
chunk_size: params[:chunk_size_gb],
|
59
|
+
from_history: @history,
|
60
|
+
format: find_export_format,
|
61
|
+
fail_on_missing_content: ::Foreman::Cast.to_bool(params[:fail_on_missing_content]))
|
62
|
+
|
63
|
+
respond_for_async :resource => tasks
|
64
|
+
end
|
65
|
+
|
66
|
+
def export_library
|
67
|
+
tasks = async_task(::Actions::Pulp3::Orchestration::ContentViewVersion::ExportLibrary,
|
68
|
+
@organization,
|
69
|
+
destination_server: params[:destination_server],
|
70
|
+
chunk_size: params[:chunk_size_gb],
|
71
|
+
from_history: @history,
|
72
|
+
format: find_export_format,
|
73
|
+
fail_on_missing_content: ::Foreman::Cast.to_bool(params[:fail_on_missing_content]))
|
74
|
+
respond_for_async :resource => tasks
|
75
|
+
end
|
76
|
+
|
77
|
+
def find_export_format
|
78
|
+
if params[:format]
|
79
|
+
unless ::Katello::Pulp3::ContentViewVersion::Export::FORMATS.include?(params[:format])
|
80
|
+
fail HttpErrors::UnprocessableEntity, _('Invalid export format provided. Format must be one of %s ') %
|
81
|
+
::Katello::Pulp3::ContentViewVersion::Export::FORMATS.join(',')
|
82
|
+
end
|
83
|
+
params[:format]
|
84
|
+
else
|
85
|
+
Setting[:default_export_format]
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
def find_exportable_repository
|
90
|
+
@repository = Repository.find_by_id(params[:id])
|
91
|
+
if @repository.blank?
|
92
|
+
throw_resource_not_found(name: 'repository', id: params[:id])
|
93
|
+
end
|
94
|
+
|
95
|
+
unless @repository.organization.can_export_content?
|
96
|
+
throw_resource_not_found(name: 'organization', id: @repository.organization.id)
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
def find_exportable_organization
|
101
|
+
find_organization
|
102
|
+
unless @organization.can_export_content?
|
103
|
+
throw_resource_not_found(name: 'organization', id: params[:organization_id])
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
def find_exportable_content_view_version
|
108
|
+
@version = ContentViewVersion.exportable.find_by_id(params[:id])
|
109
|
+
throw_resource_not_found(name: 'content view version', id: params[:id]) if @version.blank?
|
110
|
+
@view = @version.content_view
|
111
|
+
end
|
112
|
+
|
113
|
+
def find_history
|
114
|
+
if params[:from_history_id].present?
|
115
|
+
@history = ::Katello::ContentViewVersionExportHistory.find(params[:from_history_id])
|
116
|
+
if @history.blank?
|
117
|
+
throw_resource_not_found(name: 'export history',
|
118
|
+
id: params[:from_history_id])
|
119
|
+
end
|
120
|
+
else
|
121
|
+
@history = ::Katello::ContentViewVersionExportHistory.
|
122
|
+
latest(@view, destination_server: params[:destination_server])
|
123
|
+
if @history.blank?
|
124
|
+
msg = _("No existing export history was found to perform an incremental export. A full export must be performed")
|
125
|
+
fail HttpErrors::NotFound, msg
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|
129
|
+
end
|
130
|
+
end
|
@@ -40,7 +40,7 @@ module Katello
|
|
40
40
|
respond_for_index :collection => @collection
|
41
41
|
end
|
42
42
|
|
43
|
-
def index_response(reload_host
|
43
|
+
def index_response(reload_host: false)
|
44
44
|
# Host needs to be reloaded because of lazy accessor
|
45
45
|
@host.reload if reload_host
|
46
46
|
presenter = ::Katello::HostSubscriptionsPresenter.new(@host)
|
@@ -55,7 +55,7 @@ module Katello
|
|
55
55
|
end
|
56
56
|
|
57
57
|
sync_task(::Actions::Katello::Host::AutoAttachSubscriptions, @host)
|
58
|
-
respond_for_index(:collection => index_response(true), :template => "index")
|
58
|
+
respond_for_index(:collection => index_response(reload_host: true), :template => "index")
|
59
59
|
end
|
60
60
|
|
61
61
|
api :DELETE, "/hosts/:host_id/subscriptions/", N_("Unregister the host as a subscription consumer")
|
@@ -126,7 +126,7 @@ module Katello
|
|
126
126
|
end
|
127
127
|
|
128
128
|
sync_task(::Actions::Katello::Host::RemoveSubscriptions, @host, pool_id_quantities.values)
|
129
|
-
respond_for_index(:collection => index_response(true), :template => "index")
|
129
|
+
respond_for_index(:collection => index_response(reload_host: true), :template => "index")
|
130
130
|
end
|
131
131
|
|
132
132
|
api :PUT, "/hosts/:host_id/subscriptions/add_subscriptions", N_("Add a subscription to a host")
|
@@ -145,7 +145,7 @@ module Katello
|
|
145
145
|
end
|
146
146
|
|
147
147
|
sync_task(::Actions::Katello::Host::AttachSubscriptions, @host, pools_with_quantities)
|
148
|
-
respond_for_index(:collection => index_response(true), :template => "index")
|
148
|
+
respond_for_index(:collection => index_response(reload_host: true), :template => "index")
|
149
149
|
end
|
150
150
|
|
151
151
|
api :GET, "/hosts/:host_id/subscriptions/product_content", N_("Get content and overrides for the host")
|
@@ -154,7 +154,7 @@ module Katello
|
|
154
154
|
param :content_access_mode_env, :bool, :desc => N_("Limit content to just that available in the host's content view version")
|
155
155
|
param_group :search, Api::V2::ApiController
|
156
156
|
def product_content
|
157
|
-
#
|
157
|
+
# NOTE: this is just there as a placeholder for apipie.
|
158
158
|
# The routing would automatically redirect it to repository_sets#index
|
159
159
|
end
|
160
160
|
|
@@ -176,7 +176,6 @@ module Katello
|
|
176
176
|
content_override_values = @content_overrides.map do |override_params|
|
177
177
|
validate_content_overrides_enabled(override_params)
|
178
178
|
end
|
179
|
-
|
180
179
|
sync_task(::Actions::Katello::Host::UpdateContentOverrides, @host, content_override_values, false)
|
181
180
|
fetch_product_content
|
182
181
|
end
|
@@ -206,7 +205,7 @@ module Katello
|
|
206
205
|
def find_content_view_environment
|
207
206
|
@content_view_environment = Katello::ContentViewEnvironment.where(:content_view_id => params[:content_view_id],
|
208
207
|
:environment_id => params[:lifecycle_environment_id]).first
|
209
|
-
fail HttpErrors::NotFound, _("Couldn't find specified
|
208
|
+
fail HttpErrors::NotFound, _("Couldn't find specified content view and lifecycle environment.") if @content_view_environment.nil?
|
210
209
|
end
|
211
210
|
|
212
211
|
def check_subscriptions
|
@@ -232,7 +231,7 @@ module Katello
|
|
232
231
|
end
|
233
232
|
|
234
233
|
def find_content_overrides
|
235
|
-
if params
|
234
|
+
if !params.dig(:content_overrides_search, :search).nil?
|
236
235
|
content_labels = ::Katello::Content.joins(:product_contents)
|
237
236
|
.where("#{Katello::ProductContent.table_name}.product_id": @host.organization.products.subscribable.enabled)
|
238
237
|
.search_for(params[:content_overrides_search][:search])
|
@@ -281,7 +281,10 @@ module Katello
|
|
281
281
|
version_environment[:environments] << cve.environment unless version_environment[:environments].include?(cve.environment)
|
282
282
|
version_environment[:next_version] ||= version.next_incremental_version
|
283
283
|
version_environment[:content_host_count] ||= 0
|
284
|
-
version_environment[:content_host_count] += content_facets.
|
284
|
+
version_environment[:content_host_count] += content_facets.in_content_views_and_environments(
|
285
|
+
content_views: [cve.content_view],
|
286
|
+
lifecycle_environments: [cve.environment]
|
287
|
+
).count
|
285
288
|
|
286
289
|
if version.content_view.composite?
|
287
290
|
version_environment[:components] = version.components_needing_errata(@errata)
|
@@ -323,9 +326,10 @@ module Katello
|
|
323
326
|
|
324
327
|
hosts.each do |host|
|
325
328
|
next unless host.content_facet
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
+
host.content_facet.assign_single_environment(
|
330
|
+
:content_view_id => content_view.id,
|
331
|
+
:environment_id => lifecycle_environment.id
|
332
|
+
)
|
329
333
|
host.content_facet.content_source = content_source
|
330
334
|
|
331
335
|
host.update_candlepin_associations
|
@@ -82,6 +82,9 @@ module Katello
|
|
82
82
|
respond_for_create :resource => @organization
|
83
83
|
rescue => e
|
84
84
|
::Foreman::Logging.exception('Could not create organization', e)
|
85
|
+
# Force @organization.errors to be populated
|
86
|
+
# Organization.new may raise so @organization may not be set
|
87
|
+
@organization&.valid?
|
85
88
|
process_resource_error(message: e.message, resource: @organization)
|
86
89
|
end
|
87
90
|
|