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
@@ -1,353 +0,0 @@
|
|
1
|
-
module Katello
|
2
|
-
module Glue::Pulp::Repo
|
3
|
-
# TODO: move into submodules
|
4
|
-
def self.included(base)
|
5
|
-
base.send :include, LazyAccessor
|
6
|
-
base.send :include, InstanceMethods
|
7
|
-
|
8
|
-
base.class_eval do
|
9
|
-
lazy_accessor :pulp_repo_facts,
|
10
|
-
:initializer => (lambda do |_s|
|
11
|
-
if pulp_id
|
12
|
-
begin
|
13
|
-
Katello.pulp_server.extensions.repository.retrieve_with_details(pulp_id)
|
14
|
-
rescue RestClient::ResourceNotFound
|
15
|
-
nil # not found = it was not orchestrated yet
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end)
|
19
|
-
|
20
|
-
lazy_accessor :importers,
|
21
|
-
:initializer => lambda { |_s| pulp_repo_facts["importers"] if pulp_id }
|
22
|
-
|
23
|
-
lazy_accessor :distributors,
|
24
|
-
:initializer => lambda { |_s| pulp_repo_facts["distributors"] if pulp_id }
|
25
|
-
|
26
|
-
def self.delete_orphaned_content
|
27
|
-
Katello.pulp_server.resources.content.remove_orphans
|
28
|
-
end
|
29
|
-
|
30
|
-
def self.needs_importer_updates(repos, smart_proxy)
|
31
|
-
repos.select do |repo|
|
32
|
-
repo_details = repo.backend_service(smart_proxy).backend_data
|
33
|
-
next unless repo_details
|
34
|
-
capsule_importer = repo_details["importers"][0]
|
35
|
-
!repo.importer_matches?(capsule_importer, smart_proxy)
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
def self.needs_distributor_updates(repos, smart_proxy)
|
40
|
-
repos.select do |repo|
|
41
|
-
repo_details = repo.backend_service(smart_proxy).backend_data
|
42
|
-
next unless repo_details
|
43
|
-
!repo.distributors_match?(repo_details["distributors"], smart_proxy)
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
module InstanceMethods
|
50
|
-
# TODO: This module is too long. See https://projects.theforeman.org/issues/12584.
|
51
|
-
def last_sync
|
52
|
-
last = self.latest_dynflow_sync
|
53
|
-
last.nil? ? nil : last.to_s
|
54
|
-
end
|
55
|
-
|
56
|
-
def initialize(attrs = nil)
|
57
|
-
if attrs.nil?
|
58
|
-
super
|
59
|
-
else
|
60
|
-
#rename "type" to "cp_type" (activerecord and candlepin variable name conflict)
|
61
|
-
#if attrs.has_key?(type_key) && !(attrs.has_key?(:cp_type) || attrs.has_key?('cp_type'))
|
62
|
-
# attrs[:cp_type] = attrs[type_key]
|
63
|
-
#end
|
64
|
-
|
65
|
-
attrs_used_by_model = attrs.reject do |k, _v|
|
66
|
-
!self.class.column_defaults.keys.member?(k.to_s) && (!respond_to?(:"#{k.to_s}=") rescue true)
|
67
|
-
end
|
68
|
-
super(attrs_used_by_model)
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
|
-
def srpm_count
|
73
|
-
pulp_repo_facts['content_unit_counts']['srpm']
|
74
|
-
end
|
75
|
-
|
76
|
-
def to_hash
|
77
|
-
pulp_repo_facts.merge(as_json).merge(:sync_state => sync_state)
|
78
|
-
end
|
79
|
-
|
80
|
-
def pulp_scratchpad_checksum_type
|
81
|
-
if SmartProxy.pulp_primary.has_feature?(SmartProxy::PULP_FEATURE)
|
82
|
-
pulp_repo_facts&.dig('scratchpad', 'checksum_type')
|
83
|
-
end
|
84
|
-
end
|
85
|
-
|
86
|
-
def pulp_counts_differ?
|
87
|
-
pulp_counts = pulp_repo_facts[:content_unit_counts]
|
88
|
-
rpms.count != pulp_counts['rpm'].to_i ||
|
89
|
-
srpms.count != pulp_counts['srpm'].to_i ||
|
90
|
-
errata.count != pulp_counts['erratum'].to_i ||
|
91
|
-
package_groups.count != pulp_counts['package_group'].to_i ||
|
92
|
-
docker_manifests.count != pulp_counts['docker_manifest'].to_i ||
|
93
|
-
docker_tags.count != pulp_counts['docker_tag'].to_i
|
94
|
-
end
|
95
|
-
|
96
|
-
def empty_in_pulp?
|
97
|
-
pulp_repo_facts[:content_unit_counts].values.all? { |value| value == 0 }
|
98
|
-
end
|
99
|
-
|
100
|
-
def generate_importer(capsule = ::SmartProxy.default_capsule!)
|
101
|
-
backend_service(capsule).generate_importer
|
102
|
-
end
|
103
|
-
|
104
|
-
def generate_distributors(capsule = ::SmartProxy.default_capsule!)
|
105
|
-
backend_service(capsule).generate_distributors
|
106
|
-
end
|
107
|
-
|
108
|
-
def package_group_count
|
109
|
-
content_unit_counts = 0
|
110
|
-
if self.pulp_repo_facts
|
111
|
-
content_unit_counts = self.pulp_repo_facts[:content_unit_counts][:package_group]
|
112
|
-
end
|
113
|
-
content_unit_counts
|
114
|
-
end
|
115
|
-
|
116
|
-
def clone_file_metadata(to_repo)
|
117
|
-
Katello.pulp_server.extensions.yum_repo_metadata_file.copy(self.pulp_id, to_repo.pulp_id)
|
118
|
-
end
|
119
|
-
|
120
|
-
def unassociate_by_filter(content_type, filter_clauses)
|
121
|
-
criteria = {:type_ids => [content_type], :filters => {:unit => filter_clauses}}
|
122
|
-
case content_type
|
123
|
-
when Katello.pulp_server.extensions.rpm.content_type
|
124
|
-
criteria[:fields] = { :unit => Pulp::Rpm::PULP_SELECT_FIELDS}
|
125
|
-
when Katello.pulp_server.extensions.errata.content_type
|
126
|
-
criteria[:fields] = { :unit => Pulp::Erratum::PULP_SELECT_FIELDS}
|
127
|
-
end
|
128
|
-
Katello.pulp_server.extensions.repository.unassociate_units(self.pulp_id, criteria)
|
129
|
-
end
|
130
|
-
|
131
|
-
def clear_contents
|
132
|
-
tasks = content_types.flat_map { |type| type.unassociate_from_repo(self.pulp_id, {}) }
|
133
|
-
|
134
|
-
tasks << Katello.pulp_server.extensions.repository.unassociate_units(self.pulp_id,
|
135
|
-
:type_ids => ['rpm'], :filters => {}, :fields => { :unit => Pulp::Rpm::PULP_SELECT_FIELDS})
|
136
|
-
tasks
|
137
|
-
end
|
138
|
-
|
139
|
-
def content_types
|
140
|
-
[Katello.pulp_server.extensions.errata,
|
141
|
-
Katello.pulp_server.extensions.package_group,
|
142
|
-
Katello.pulp_server.extensions.module_stream
|
143
|
-
]
|
144
|
-
end
|
145
|
-
|
146
|
-
def sync_status
|
147
|
-
self._get_most_recent_sync_status if @sync_status.nil?
|
148
|
-
end
|
149
|
-
|
150
|
-
def sync_state
|
151
|
-
status = sync_status
|
152
|
-
return PulpSyncStatus::Status::NOT_SYNCED if status.nil?
|
153
|
-
status.state
|
154
|
-
end
|
155
|
-
|
156
|
-
def synced?
|
157
|
-
sync_history = self.sync_status
|
158
|
-
!sync_history.nil? && successful_sync?(sync_history)
|
159
|
-
end
|
160
|
-
|
161
|
-
def successful_sync?(sync_history_item)
|
162
|
-
sync_history_item['state'] == PulpTaskStatus::Status::FINISHED.to_s
|
163
|
-
end
|
164
|
-
|
165
|
-
def find_distributor(use_clone_distributor = false)
|
166
|
-
dist_type_id = if use_clone_distributor
|
167
|
-
case self.content_type
|
168
|
-
when Repository::YUM_TYPE
|
169
|
-
Runcible::Models::YumCloneDistributor.type_id
|
170
|
-
when Repository::PUPPET_TYPE
|
171
|
-
Runcible::Models::PuppetInstallDistributor.type_id
|
172
|
-
end
|
173
|
-
else
|
174
|
-
case self.content_type
|
175
|
-
when Repository::YUM_TYPE
|
176
|
-
Runcible::Models::YumDistributor.type_id
|
177
|
-
when Repository::PUPPET_TYPE
|
178
|
-
Runcible::Models::PuppetInstallDistributor.type_id
|
179
|
-
end
|
180
|
-
end
|
181
|
-
|
182
|
-
distributors.detect { |dist| dist["distributor_type_id"] == dist_type_id }
|
183
|
-
end
|
184
|
-
|
185
|
-
def sort_sync_status(statuses)
|
186
|
-
statuses.sort! do |a, b|
|
187
|
-
if a['finish_time'].nil? && b['finish_time'].nil?
|
188
|
-
if a['start_time'].nil?
|
189
|
-
1
|
190
|
-
elsif b['start_time'].nil?
|
191
|
-
-1
|
192
|
-
else
|
193
|
-
a['start_time'] <=> b['start_time']
|
194
|
-
end
|
195
|
-
elsif a['finish_time'].nil?
|
196
|
-
if a['start_time'].nil?
|
197
|
-
1
|
198
|
-
else
|
199
|
-
-1
|
200
|
-
end
|
201
|
-
elsif b['finish_time'].nil?
|
202
|
-
if b['start_time'].nil?
|
203
|
-
-1
|
204
|
-
else
|
205
|
-
1
|
206
|
-
end
|
207
|
-
else
|
208
|
-
b['finish_time'] <=> a['finish_time']
|
209
|
-
end
|
210
|
-
end
|
211
|
-
return statuses
|
212
|
-
end
|
213
|
-
|
214
|
-
def unit_type_id
|
215
|
-
case content_type
|
216
|
-
when Repository::YUM_TYPE
|
217
|
-
"rpm"
|
218
|
-
when Repository::DOCKER_TYPE
|
219
|
-
"docker_manifest"
|
220
|
-
when Repository::OSTREE_TYPE
|
221
|
-
"ostree"
|
222
|
-
when Repository::FILE_TYPE
|
223
|
-
"iso"
|
224
|
-
when Repository::DEB_TYPE
|
225
|
-
"deb"
|
226
|
-
when Repository::ANSIBLE_COLLECTION_TYPE
|
227
|
-
"ansible_collection"
|
228
|
-
end
|
229
|
-
end
|
230
|
-
|
231
|
-
def unit_search(options = {})
|
232
|
-
Katello.pulp_server.extensions.repository.unit_search(self.pulp_id, options)
|
233
|
-
end
|
234
|
-
|
235
|
-
def docker?
|
236
|
-
self.content_type == Repository::DOCKER_TYPE
|
237
|
-
end
|
238
|
-
|
239
|
-
def file?
|
240
|
-
self.content_type == Repository::FILE_TYPE
|
241
|
-
end
|
242
|
-
|
243
|
-
def yum?
|
244
|
-
self.content_type == Repository::YUM_TYPE
|
245
|
-
end
|
246
|
-
|
247
|
-
def ostree?
|
248
|
-
self.content_type == Repository::OSTREE_TYPE
|
249
|
-
end
|
250
|
-
|
251
|
-
def deb?
|
252
|
-
self.content_type == Repository::DEB_TYPE
|
253
|
-
end
|
254
|
-
|
255
|
-
def ansible_collection?
|
256
|
-
self.content_type == Repository::ANSIBLE_COLLECTION_TYPE
|
257
|
-
end
|
258
|
-
|
259
|
-
def published?
|
260
|
-
distributors.map { |dist| dist['last_publish'] }.compact.any?
|
261
|
-
end
|
262
|
-
|
263
|
-
def capsule_download_policy(capsule)
|
264
|
-
policy = capsule.download_policy || Setting[:default_proxy_download_policy]
|
265
|
-
if self.yum?
|
266
|
-
if policy == ::SmartProxy::DOWNLOAD_INHERIT
|
267
|
-
self.root.download_policy
|
268
|
-
else
|
269
|
-
policy
|
270
|
-
end
|
271
|
-
end
|
272
|
-
end
|
273
|
-
|
274
|
-
def distributors_match?(capsule_distributors, capsule)
|
275
|
-
generated_distributor_configs = self.generate_distributors(capsule)
|
276
|
-
generated_distributor_configs.all? do |gen_dist|
|
277
|
-
type = gen_dist.class.type_id
|
278
|
-
found_on_capsule = capsule_distributors.find { |dist| dist['distributor_type_id'] == type }
|
279
|
-
found_on_capsule && filtered_distribution_config_equal?(gen_dist.config, found_on_capsule['config'])
|
280
|
-
end
|
281
|
-
end
|
282
|
-
|
283
|
-
def needs_metadata_publish?
|
284
|
-
last_publish = last_publish_task.try(:[], 'finish_time')
|
285
|
-
last_sync = last_sync_task.try(:[], 'finish_time')
|
286
|
-
return false if last_sync.nil?
|
287
|
-
return true if last_publish.nil?
|
288
|
-
|
289
|
-
Time.parse(last_sync) >= Time.parse(last_publish)
|
290
|
-
end
|
291
|
-
|
292
|
-
def last_sync_task
|
293
|
-
tasks = Katello.pulp_server.extensions.repository.sync_status(self.pulp_id)
|
294
|
-
most_recent_task(tasks)
|
295
|
-
end
|
296
|
-
|
297
|
-
def last_publish_task
|
298
|
-
tasks = Katello.pulp_server.extensions.repository.publish_status(self.pulp_id)
|
299
|
-
most_recent_task(tasks, true)
|
300
|
-
end
|
301
|
-
|
302
|
-
def most_recent_task(tasks, only_successful = false)
|
303
|
-
tasks = tasks.select { |t| t['finish_time'] }.sort_by { |t| t['finish_time'] }
|
304
|
-
tasks = tasks.select { |task| task['error'].nil? } if only_successful
|
305
|
-
tasks.last
|
306
|
-
end
|
307
|
-
|
308
|
-
def filtered_distribution_config_equal?(generated_config, actual_config)
|
309
|
-
generated = generated_config.clone
|
310
|
-
actual = actual_config.clone
|
311
|
-
#We store 'default' checksum type as nil, but pulp will default to sha256, so if we haven't set it, ignore it
|
312
|
-
if generated.keys.include?('checksum_type') && generated['checksum_type'].nil?
|
313
|
-
generated.delete('checksum_type')
|
314
|
-
actual.delete('checksum_type')
|
315
|
-
end
|
316
|
-
generated.compact == actual.compact
|
317
|
-
end
|
318
|
-
|
319
|
-
def importer_matches?(capsule_importer, capsule)
|
320
|
-
generated_importer = self.generate_importer(capsule)
|
321
|
-
capsule_importer.try(:[], 'importer_type_id') == generated_importer.id &&
|
322
|
-
generated_importer.config.compact == capsule_importer['config'].compact
|
323
|
-
end
|
324
|
-
|
325
|
-
protected
|
326
|
-
|
327
|
-
def object_to_hash(object)
|
328
|
-
hash = {}
|
329
|
-
object.instance_variables.each { |var| hash[var.to_s.delete("@")] = object.instance_variable_get(var) }
|
330
|
-
hash
|
331
|
-
end
|
332
|
-
|
333
|
-
def _get_most_recent_sync_status
|
334
|
-
begin
|
335
|
-
history = Katello.pulp_server.extensions.repository.sync_status(pulp_id)
|
336
|
-
|
337
|
-
if history.blank?
|
338
|
-
history = PulpSyncStatus.convert_history(Katello.pulp_server.extensions.repository.sync_history(pulp_id))
|
339
|
-
end
|
340
|
-
rescue
|
341
|
-
history = PulpSyncStatus.convert_history(Katello.pulp_server.extensions.repository.sync_history(pulp_id))
|
342
|
-
end
|
343
|
-
|
344
|
-
if history.blank?
|
345
|
-
return PulpSyncStatus.new(:state => PulpSyncStatus::Status::NOT_SYNCED)
|
346
|
-
else
|
347
|
-
history = sort_sync_status(history)
|
348
|
-
return PulpSyncStatus.pulp_task(history.first.with_indifferent_access)
|
349
|
-
end
|
350
|
-
end
|
351
|
-
end
|
352
|
-
end
|
353
|
-
end
|
@@ -1,165 +0,0 @@
|
|
1
|
-
module Katello
|
2
|
-
class PulpSyncProgress
|
3
|
-
attr_reader :total_size, :size_left, :total_count, :items_left, :error_details, :step
|
4
|
-
|
5
|
-
def initialize(progress_attrs = {})
|
6
|
-
@total_size = @size_left = @total_count = @items_left = 0
|
7
|
-
|
8
|
-
unless progress_attrs.nil?
|
9
|
-
#depending on whether this is a history item, or current sync structure may be different
|
10
|
-
ht = HashUtil.new
|
11
|
-
|
12
|
-
details = ht.null_safe_get(progress_attrs, nil, %w(progress_report yum_importer content)) ||
|
13
|
-
ht.null_safe_get(progress_attrs, nil, %w(progress_report details packages sync_report)) ||
|
14
|
-
ht.null_safe_get(progress_attrs, nil, %w(progress_report iso_importer))
|
15
|
-
|
16
|
-
#if the task is waiting, it wont have a progress report
|
17
|
-
progress_attrs['progress_report'] ||= {}
|
18
|
-
|
19
|
-
if progress_attrs['progress_report']['iso_importer']
|
20
|
-
@total_size = ht.null_safe_get(details, 0, ['total_bytes'])
|
21
|
-
@size_left = @total_size - ht.null_safe_get(details, 0, ['finished_bytes'])
|
22
|
-
@total_count = ht.null_safe_get(details, 0, ['num_isos'])
|
23
|
-
@items_left = @total_count - ht.null_safe_get(details, 0, ['num_isos_finished'])
|
24
|
-
|
25
|
-
else
|
26
|
-
@total_size = ht.null_safe_get(details, 0, ['size_total'])
|
27
|
-
@size_left = ht.null_safe_get(details, 0, ['size_left'])
|
28
|
-
end
|
29
|
-
|
30
|
-
@error_details = errors(progress_attrs['progress_report'])
|
31
|
-
@step = ht.null_safe_get(progress_attrs, 0, ['step'])
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
private
|
36
|
-
|
37
|
-
def errors(progress)
|
38
|
-
if progress[:yum_importer]
|
39
|
-
details = progress[:yum_importer]
|
40
|
-
elsif progress[:details]
|
41
|
-
details = progress[:details]
|
42
|
-
end
|
43
|
-
|
44
|
-
format_errors(details)
|
45
|
-
end
|
46
|
-
|
47
|
-
# Possible formats coming from pulp
|
48
|
-
#
|
49
|
-
# We ignore this case:
|
50
|
-
# {'finished_count' => {}}
|
51
|
-
#
|
52
|
-
# We extract from this case:
|
53
|
-
# {'content' => {'error' => ''},
|
54
|
-
# 'errata' => {'error' => ''},
|
55
|
-
# 'packages' => {'error' => ''},
|
56
|
-
# 'metadata' => {'error_details => ''}
|
57
|
-
# }
|
58
|
-
def format_errors(details)
|
59
|
-
errors = {messages: [], details: []}
|
60
|
-
|
61
|
-
if details && !details.key?(:finished_count)
|
62
|
-
details.each do |step, report|
|
63
|
-
if step == "content"
|
64
|
-
parse_content(report, errors)
|
65
|
-
else
|
66
|
-
parse_generic(report, errors)
|
67
|
-
end
|
68
|
-
end
|
69
|
-
end
|
70
|
-
|
71
|
-
errors
|
72
|
-
end
|
73
|
-
|
74
|
-
def parse_content(details, errors)
|
75
|
-
timeout = false
|
76
|
-
|
77
|
-
details['error_details'].each do |error|
|
78
|
-
if error['error_code'] == 37
|
79
|
-
timeout = true
|
80
|
-
end
|
81
|
-
end
|
82
|
-
|
83
|
-
if timeout
|
84
|
-
errors[:messages] << _('One or more packages failed to sync properly.')
|
85
|
-
errors[:details].concat(details[:error_details]) if details[:error_details].present?
|
86
|
-
else
|
87
|
-
parse_generic(details, errors)
|
88
|
-
end
|
89
|
-
end
|
90
|
-
|
91
|
-
def parse_generic(details, errors)
|
92
|
-
errors[:messages] << details[:error] if details[:error].present?
|
93
|
-
errors[:details].concat(details[:error_details]) if details[:error_details].present?
|
94
|
-
end
|
95
|
-
end
|
96
|
-
end
|
97
|
-
|
98
|
-
module Katello
|
99
|
-
class PulpSyncStatus < PulpTaskStatus
|
100
|
-
HISTORY_ERROR = 'failed'.freeze
|
101
|
-
HISTORY_SUCCESS = 'success'.freeze
|
102
|
-
FINISHED = "finished".freeze
|
103
|
-
ERROR = "error".freeze
|
104
|
-
RUNNING = "running".freeze
|
105
|
-
WAITING = "waiting".freeze
|
106
|
-
CANCELED = "canceled".freeze
|
107
|
-
|
108
|
-
class Status < TaskStatus::Status
|
109
|
-
NOT_SYNCED = :not_synced
|
110
|
-
end
|
111
|
-
|
112
|
-
def progress
|
113
|
-
PulpSyncProgress.new(attributes['progress'])
|
114
|
-
end
|
115
|
-
|
116
|
-
def after_refresh
|
117
|
-
correct_state
|
118
|
-
end
|
119
|
-
|
120
|
-
def self.pulp_task(pulp_status)
|
121
|
-
task_status = PulpSyncStatus.find_by(:uuid => pulp_status[:id])
|
122
|
-
task_status = self.new { |t| yield t if block_given? } if task_status.nil?
|
123
|
-
task_status.update_state(pulp_status)
|
124
|
-
end
|
125
|
-
|
126
|
-
def update_state(pulp_status)
|
127
|
-
PulpSyncStatus.dump_state(pulp_status, self)
|
128
|
-
correct_state
|
129
|
-
self
|
130
|
-
end
|
131
|
-
|
132
|
-
def correct_state
|
133
|
-
if [FINISHED].include?(self.state) && self.progress.error_details[:messages].present?
|
134
|
-
self.state = ERROR
|
135
|
-
self.save! unless self.new_record?
|
136
|
-
end
|
137
|
-
end
|
138
|
-
|
139
|
-
# Pulp history items are moved from the task item, but are different
|
140
|
-
# and as a result we need to convert the structure
|
141
|
-
# @option [Array] history_list list of pulp sync history hashes
|
142
|
-
def self.convert_history(history_list)
|
143
|
-
#history item attributes
|
144
|
-
#["_id", "_ns", "added_count", "completed", "details", "error_message", "exception", "id",
|
145
|
-
# "importer_id", "importer_type_id", "removed_count", "repo_id", "result", "started", "summary",
|
146
|
-
# "traceback", "updated_count"]
|
147
|
-
|
148
|
-
#task status attributes
|
149
|
-
#["task_group_id", "exception", "traceback", "_href", "task_id", "call_request_tags", "reasons",
|
150
|
-
# "start_time", "tags", "state", "finish_time", "dependency_failures", "schedule_id", "progress",
|
151
|
-
# "call_request_group_id", "call_request_id", "principal_login", "response", "result"]
|
152
|
-
history_list.collect do |history|
|
153
|
-
result = history['result']
|
154
|
-
result = ERROR if result == HISTORY_ERROR
|
155
|
-
result = FINISHED if result == HISTORY_SUCCESS
|
156
|
-
{
|
157
|
-
:state => result,
|
158
|
-
:progress => {:details => history["details"]},
|
159
|
-
:finish_time => history['completed'],
|
160
|
-
:start_time => history['started']
|
161
|
-
}.with_indifferent_access
|
162
|
-
end
|
163
|
-
end
|
164
|
-
end
|
165
|
-
end
|
@@ -1,63 +0,0 @@
|
|
1
|
-
module Katello
|
2
|
-
class PulpTaskStatus < TaskStatus
|
3
|
-
WAIT_TIMES = [0.5, 1, 2, 4, 8, 16].freeze
|
4
|
-
WAIT_TIME_STEP = 5
|
5
|
-
|
6
|
-
validates_lengths_from_database
|
7
|
-
|
8
|
-
def refresh
|
9
|
-
PulpTaskStatus.refresh(self)
|
10
|
-
end
|
11
|
-
|
12
|
-
def after_refresh
|
13
|
-
#potentially used by child class, see PulpSyncStatus for example
|
14
|
-
end
|
15
|
-
|
16
|
-
def affected_units
|
17
|
-
self.result['num_changes']
|
18
|
-
end
|
19
|
-
|
20
|
-
def error
|
21
|
-
self.result[:errors][0] if self.error? && self.result[:errors]
|
22
|
-
end
|
23
|
-
|
24
|
-
def self.using_pulp_task(pulp_status)
|
25
|
-
if pulp_status.is_a? TaskStatus
|
26
|
-
pulp_status
|
27
|
-
else
|
28
|
-
task_id = pulp_status[:task_id] || pulp_status[:spawned_tasks].first[:task_id]
|
29
|
-
pulp_status = Katello.pulp_server.resources.task.poll(task_id)
|
30
|
-
|
31
|
-
task_status = TaskStatus.find_by(:uuid => task_id)
|
32
|
-
task_status = self.new { |t| yield t if block_given? } if task_status.nil?
|
33
|
-
PulpTaskStatus.dump_state(pulp_status, task_status)
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
def self.dump_state(pulp_status, task_status)
|
38
|
-
if !pulp_status.key?(:state) && pulp_status[:result] == "success"
|
39
|
-
# Note: if pulp_status doesn't contain a state, the status is coming from pulp sync history
|
40
|
-
pulp_status[:state] = Status::FINISHED.to_s
|
41
|
-
end
|
42
|
-
|
43
|
-
task_status.attributes = {
|
44
|
-
:uuid => pulp_status[:task_id],
|
45
|
-
:state => pulp_status[:state] || pulp_status[:result],
|
46
|
-
:start_time => pulp_status[:start_time] || pulp_status[:start_time],
|
47
|
-
:finish_time => pulp_status[:finish_time],
|
48
|
-
:progress => pulp_status,
|
49
|
-
:result => pulp_status[:result].nil? ? {:errors => [pulp_status[:exception], pulp_status[:traceback]]} : pulp_status[:result]
|
50
|
-
}
|
51
|
-
task_status.save! unless task_status.new_record?
|
52
|
-
task_status
|
53
|
-
end
|
54
|
-
|
55
|
-
def self.refresh(task_status)
|
56
|
-
pulp_task = Katello.pulp_server.resources.task.poll(task_status.uuid)
|
57
|
-
|
58
|
-
self.dump_state(pulp_task, task_status)
|
59
|
-
task_status.after_refresh
|
60
|
-
task_status
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
module Katello
|
2
|
-
module Pulp
|
3
|
-
class Content
|
4
|
-
extend Katello::Abstract::Pulp::Content
|
5
|
-
class << self
|
6
|
-
def create_upload(_size = 0, _checksum = nil, _content_type = nil, _repository = nil)
|
7
|
-
pulp_content.create_upload_request
|
8
|
-
end
|
9
|
-
|
10
|
-
def delete_upload(upload_id)
|
11
|
-
pulp_content.delete_upload_request(upload_id)
|
12
|
-
end
|
13
|
-
|
14
|
-
def upload_chunk(upload_id, offset, content, _size)
|
15
|
-
pulp_content.upload_bits(upload_id, offset, content)
|
16
|
-
end
|
17
|
-
|
18
|
-
private def pulp_content
|
19
|
-
SmartProxy.pulp_primary.pulp_api.resources.content
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
@@ -1,28 +0,0 @@
|
|
1
|
-
module Katello
|
2
|
-
module Pulp
|
3
|
-
module ImporterComparison
|
4
|
-
def importer_matches?(generated_importer, capsule_importer)
|
5
|
-
if capsule_importer.try(:[], 'importer_type_id') != generated_importer.id
|
6
|
-
return false
|
7
|
-
end
|
8
|
-
|
9
|
-
generated_config = generated_importer.config
|
10
|
-
capsule_config = capsule_importer['config']
|
11
|
-
if generated_config['proxy_host'] == ""
|
12
|
-
proxy_keys = %w(proxy_host proxy_username proxy_password)
|
13
|
-
proxy_keys.each do |key|
|
14
|
-
generated_config.delete(key)
|
15
|
-
capsule_config.delete(key)
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
if generated_config['proxy_password'] == "" && capsule_config['proxy_password'] == "*****"
|
20
|
-
generated_config.delete('proxy_password')
|
21
|
-
capsule_config.delete('proxy_password')
|
22
|
-
end
|
23
|
-
|
24
|
-
generated_config.compact == capsule_config.compact
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
@@ -1,61 +0,0 @@
|
|
1
|
-
module Katello
|
2
|
-
module Pulp
|
3
|
-
class Repository
|
4
|
-
class Deb < ::Katello::Pulp::Repository
|
5
|
-
REPOSITORY_TYPE = 'deb'.freeze
|
6
|
-
|
7
|
-
def generate_primary_importer
|
8
|
-
config = {
|
9
|
-
feed: root.url,
|
10
|
-
remove_missing: root.mirror_on_sync?,
|
11
|
-
releases: root.deb_releases,
|
12
|
-
components: root.deb_components,
|
13
|
-
architectures: root.deb_architectures,
|
14
|
-
gpg_keys: root&.gpg_key&.content,
|
15
|
-
require_signature: root.gpg_key.present?
|
16
|
-
}
|
17
|
-
importer_class.new(config.merge(primary_importer_connection_options))
|
18
|
-
end
|
19
|
-
|
20
|
-
def generate_mirror_importer
|
21
|
-
config = {
|
22
|
-
feed: external_url,
|
23
|
-
remove_missing: true,
|
24
|
-
releases: root.deb_releases,
|
25
|
-
components: root.deb_components,
|
26
|
-
architectures: root.deb_architectures,
|
27
|
-
gpg_keys: root&.gpg_key&.content,
|
28
|
-
require_signature: root.gpg_key.present?
|
29
|
-
}
|
30
|
-
importer_class.new(config.merge(mirror_importer_connection_options))
|
31
|
-
end
|
32
|
-
|
33
|
-
def generate_distributors
|
34
|
-
[Runcible::Models::DebDistributor.new(repo.relative_path, root.unprotected, true,
|
35
|
-
id: repo.pulp_id,
|
36
|
-
auto_publish: true)]
|
37
|
-
end
|
38
|
-
|
39
|
-
def distributors_to_publish(_options)
|
40
|
-
{Runcible::Models::DebDistributor => {}}
|
41
|
-
end
|
42
|
-
|
43
|
-
def partial_repo_path
|
44
|
-
"/pulp/deb/#{repo.relative_path}/"
|
45
|
-
end
|
46
|
-
|
47
|
-
def importer_class
|
48
|
-
Runcible::Models::DebImporter
|
49
|
-
end
|
50
|
-
|
51
|
-
def copy_contents(destination_repo, _options = {})
|
52
|
-
[
|
53
|
-
@smart_proxy.pulp_api.extensions.deb.copy(@repo.pulp_id, destination_repo.pulp_id, fields: ::Katello::Pulp::Deb::PULP_SELECT_FIELDS),
|
54
|
-
@smart_proxy.pulp_api.extensions.deb_release.copy(@repo.pulp_id, destination_repo.pulp_id, {}),
|
55
|
-
@smart_proxy.pulp_api.extensions.deb_component.copy(@repo.pulp_id, destination_repo.pulp_id, {})
|
56
|
-
]
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|