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
@@ -6,6 +6,7 @@ module Actions
|
|
6
6
|
param :smart_proxy_id, Integer
|
7
7
|
param :base_path, String
|
8
8
|
param :content_view_version_id, Integer
|
9
|
+
param :from_content_view_version_id, Integer
|
9
10
|
param :destination_server, String
|
10
11
|
end
|
11
12
|
|
@@ -18,8 +19,10 @@ module Actions
|
|
18
19
|
smart_proxy = ::SmartProxy.unscoped.find(input[:smart_proxy_id])
|
19
20
|
output[:path] = input[:base_path]
|
20
21
|
cvv = ::Katello::ContentViewVersion.find(input[:content_view_version_id])
|
22
|
+
from_cvv = ::Katello::ContentViewVersion.find(input[:from_content_view_version_id]) unless input[:from_content_view_version_id].blank?
|
21
23
|
export_metadata = ::Katello::Pulp3::ContentViewVersion::Export.create(
|
22
24
|
content_view_version: cvv,
|
25
|
+
from_content_view_version: from_cvv,
|
23
26
|
smart_proxy: smart_proxy,
|
24
27
|
format: input[:format]).generate_metadata
|
25
28
|
|
@@ -30,6 +33,7 @@ module Actions
|
|
30
33
|
metadata: export_metadata,
|
31
34
|
audit_comment: ::Katello::ContentViewVersionExportHistory.generate_audit_comment(content_view_version: cvv,
|
32
35
|
user: User.current,
|
36
|
+
from_version: from_cvv,
|
33
37
|
metadata: export_metadata)
|
34
38
|
)
|
35
39
|
output[:export_history_id] = history.id
|
@@ -28,6 +28,7 @@ module Actions
|
|
28
28
|
sequence do
|
29
29
|
export_output = plan_action(SyncableExport,
|
30
30
|
content_view_version: content_view_version,
|
31
|
+
from_content_view_version: from_history&.content_view_version,
|
31
32
|
smart_proxy: smart_proxy,
|
32
33
|
destination_server: destination_server).output
|
33
34
|
plan_self(export_history_id: export_output[:export_history_id],
|
@@ -49,11 +49,16 @@ module Actions
|
|
49
49
|
end
|
50
50
|
|
51
51
|
def validate_export_types!(repository, format)
|
52
|
-
|
52
|
+
return if ::Katello::Repository.exportable(format: format).where(id: repository.id).exists?
|
53
|
+
if format == ::Katello::Pulp3::ContentViewVersion::Export::SYNCABLE
|
53
54
|
fail _("NOTE: Unable to export repository '%{repository}' because"\
|
54
|
-
" it does not have an exportable content type."\
|
55
|
+
" it does not have an syncably exportable content type."\
|
55
56
|
% { repository: repository.name })
|
56
57
|
end
|
58
|
+
|
59
|
+
fail _("NOTE: Unable to export repository '%{repository}' because"\
|
60
|
+
" it does not have an exportable content type."\
|
61
|
+
% { repository: repository.name })
|
57
62
|
end
|
58
63
|
end
|
59
64
|
end
|
@@ -8,6 +8,7 @@ module Actions
|
|
8
8
|
param :content_view_version_id, Integer
|
9
9
|
param :export_history_id, Integer
|
10
10
|
param :export_path, String
|
11
|
+
param :from_content_view_version_id, Integer
|
11
12
|
end
|
12
13
|
|
13
14
|
output_format do
|
@@ -18,12 +19,14 @@ module Actions
|
|
18
19
|
def plan(content_view_version:,
|
19
20
|
smart_proxy:,
|
20
21
|
fail_on_missing_content: false,
|
21
|
-
destination_server
|
22
|
+
destination_server:,
|
23
|
+
from_content_view_version:)
|
22
24
|
format = ::Katello::Pulp3::ContentViewVersion::Export::SYNCABLE
|
23
25
|
sequence do
|
24
26
|
export_service = ::Katello::Pulp3::ContentViewVersion::Export.create(
|
25
27
|
smart_proxy: smart_proxy,
|
26
28
|
content_view_version: content_view_version,
|
29
|
+
from_content_view_version: from_content_view_version,
|
27
30
|
format: format,
|
28
31
|
destination_server: destination_server)
|
29
32
|
export_service.validate!(fail_on_missing_content: fail_on_missing_content)
|
@@ -42,7 +45,8 @@ module Actions
|
|
42
45
|
smart_proxy_id: smart_proxy.id,
|
43
46
|
exporter_data: action_output[:exporter_data],
|
44
47
|
format: format,
|
45
|
-
repository_id: repository.id
|
48
|
+
repository_id: repository.id,
|
49
|
+
from_content_view_version_id: from_content_view_version&.id)
|
46
50
|
|
47
51
|
plan_action(::Actions::Pulp3::ContentViewVersion::DestroyExporter,
|
48
52
|
smart_proxy_id: smart_proxy.id,
|
@@ -55,6 +59,7 @@ module Actions
|
|
55
59
|
::Actions::Pulp3::ContentViewVersion::CreateSyncableExportHistory,
|
56
60
|
smart_proxy_id: smart_proxy.id,
|
57
61
|
content_view_version_id: content_view_version.id,
|
62
|
+
from_content_view_version_id: from_content_view_version&.id,
|
58
63
|
destination_server: destination_server,
|
59
64
|
format: format,
|
60
65
|
base_path: base_path
|
@@ -23,8 +23,7 @@ module Actions
|
|
23
23
|
|
24
24
|
def invoke_external_task
|
25
25
|
repo = ::Katello::Repository.find(input[:repository_id])
|
26
|
-
|
27
|
-
repo.backend_service(smart_proxy, true).with_mirror_adapter.refresh_distributions
|
26
|
+
repo.backend_service(smart_proxy).with_mirror_adapter.refresh_distributions
|
28
27
|
end
|
29
28
|
end
|
30
29
|
end
|
@@ -12,9 +12,9 @@ module Actions
|
|
12
12
|
distribution_hrefs.compact!
|
13
13
|
repo = ::Katello::Repository.find(input[:repository_id])
|
14
14
|
if distribution_hrefs.any?
|
15
|
-
repo.backend_service(smart_proxy
|
15
|
+
repo.backend_service(smart_proxy).save_distribution_references(distribution_hrefs)
|
16
16
|
else
|
17
|
-
repo.backend_service(smart_proxy
|
17
|
+
repo.backend_service(smart_proxy).update_distribution
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
@@ -161,7 +161,7 @@ module Katello
|
|
161
161
|
returns String, desc: 'Package version'
|
162
162
|
end
|
163
163
|
def host_latest_applicable_rpm_version(host, package)
|
164
|
-
::Katello::Rpm.latest(host.applicable_rpms.where(name: package))
|
164
|
+
::Katello::Rpm.latest(host.applicable_rpms.where(name: package)).first.nvra
|
165
165
|
end
|
166
166
|
|
167
167
|
apipie :method, 'Loads Pool objects' do
|
@@ -8,7 +8,7 @@ module Katello
|
|
8
8
|
super
|
9
9
|
|
10
10
|
medium_provider = Katello::ManagedContentMediumProvider.new(host)
|
11
|
-
content_view = host.try(:content_facet).try(:
|
11
|
+
content_view = host.try(:content_facet).try(:single_content_view) || host.try(:single_content_view)
|
12
12
|
|
13
13
|
if content_view && host.operatingsystem.is_a?(Redhat) &&
|
14
14
|
host.operatingsystem.kickstart_repos(host).first.present? &&
|
@@ -6,10 +6,6 @@ module Katello
|
|
6
6
|
@cache = ActiveSupport::Cache::MemoryStore.new
|
7
7
|
|
8
8
|
class << self
|
9
|
-
def initialize
|
10
|
-
FileUtils.touch(lock_file)
|
11
|
-
end
|
12
|
-
|
13
9
|
def settings
|
14
10
|
SETTINGS[:katello][:event_daemon]
|
15
11
|
end
|
@@ -24,12 +20,16 @@ module Katello
|
|
24
20
|
pid_dir.join('katello_event_daemon.pid')
|
25
21
|
end
|
26
22
|
|
23
|
+
def tmp_dir
|
24
|
+
Rails.root.join('tmp')
|
25
|
+
end
|
26
|
+
|
27
27
|
def pid_dir
|
28
|
-
|
28
|
+
tmp_dir.join('pids')
|
29
29
|
end
|
30
30
|
|
31
31
|
def lock_file
|
32
|
-
|
32
|
+
tmp_dir.join('katello_event_daemon.lock')
|
33
33
|
end
|
34
34
|
|
35
35
|
def write_pid_file
|
@@ -49,10 +49,13 @@ module Katello
|
|
49
49
|
|
50
50
|
def start
|
51
51
|
return unless runnable?
|
52
|
-
|
53
|
-
|
52
|
+
|
53
|
+
FileUtils.mkdir_p(tmp_dir)
|
54
|
+
FileUtils.touch(lock_file)
|
55
|
+
|
56
|
+
File.open(lock_file, 'r') do |lockfile|
|
54
57
|
lockfile.flock(File::LOCK_EX)
|
55
|
-
return if started? # ensure it wasn't started while we waited for the lock
|
58
|
+
return nil if started? # ensure it wasn't started while we waited for the lock
|
56
59
|
start_monitor_thread
|
57
60
|
write_pid_file
|
58
61
|
|
@@ -34,10 +34,11 @@ module Katello
|
|
34
34
|
consumers
|
35
35
|
end
|
36
36
|
|
37
|
-
def create(
|
37
|
+
def create(env_ids, parameters, activation_key_cp_ids, org)
|
38
38
|
parameters['installedProducts'] ||= [] #if installed products is nil, candlepin won't attach custom products
|
39
|
-
|
40
|
-
url
|
39
|
+
parameters['environments'] = env_ids.map { |cp_id| { id: cp_id } }
|
40
|
+
url = "/candlepin/consumers/?owner=#{org.label}"
|
41
|
+
url += "&activation_keys=" + activation_key_cp_ids.join(",") if activation_key_cp_ids.length > 0
|
41
42
|
|
42
43
|
response = self.post(url, parameters.to_json, self.default_headers).body
|
43
44
|
JSON.parse(response).with_indifferent_access
|
@@ -92,7 +93,7 @@ module Katello
|
|
92
93
|
self.put(path(uuid), {:lastCheckin => checkin_date}.to_json, self.default_headers).body
|
93
94
|
end
|
94
95
|
|
95
|
-
def available_pools(owner_label, uuid, listall
|
96
|
+
def available_pools(owner_label, uuid, listall: false)
|
96
97
|
url = Resources::Candlepin::Pool.path(nil, owner_label) + "?consumer=#{uuid}&listall=#{listall}&add_future=true"
|
97
98
|
response = Candlepin::CandlepinResource.get(url, self.default_headers).body
|
98
99
|
JSON.parse(response)
|
@@ -107,8 +108,7 @@ module Katello
|
|
107
108
|
# Export is a zip file
|
108
109
|
headers = self.default_headers
|
109
110
|
headers['accept'] = 'application/zip'
|
110
|
-
|
111
|
-
response
|
111
|
+
Candlepin::CandlepinResource.get(join_path(path(uuid), 'export'), headers)
|
112
112
|
end
|
113
113
|
|
114
114
|
def entitlements(uuid)
|
@@ -60,7 +60,7 @@ module Katello
|
|
60
60
|
Product.all(organization_name, [:id, :productContent])
|
61
61
|
end
|
62
62
|
|
63
|
-
def destroy_imports(organization_name, wait_until_complete
|
63
|
+
def destroy_imports(organization_name, wait_until_complete: false)
|
64
64
|
response_json = self.delete(join_path(path(organization_name), 'imports'), self.default_headers)
|
65
65
|
response = JSON.parse(response_json).with_indifferent_access
|
66
66
|
if wait_until_complete && response['state'] == 'CREATED'
|
@@ -42,15 +42,14 @@ module Katello
|
|
42
42
|
|
43
43
|
def get_export(url, client_cert, client_key, ca_file)
|
44
44
|
logger.debug "Sending GET request to upstream Candlepin: #{url}"
|
45
|
-
return resource(url, client_cert, client_key, ca_file).get
|
45
|
+
return resource(url: url, client_cert: client_cert, client_key: client_key, ca_file: ca_file).get
|
46
46
|
rescue RestClient::Exception => e
|
47
47
|
raise e
|
48
48
|
end
|
49
49
|
|
50
50
|
def update(url, client_cert, client_key, ca_file, attributes)
|
51
|
-
logger.debug "Sending
|
52
|
-
|
53
|
-
return resource(url, client_cert, client_key, ca_file).put(attributes.to_json,
|
51
|
+
logger.debug "Sending PUT request to upstream Candlepin: #{url} #{attributes.to_json}"
|
52
|
+
return resource(url: url, client_cert: client_cert, client_key: client_key, ca_file: ca_file).put(attributes.to_json,
|
54
53
|
'accept' => 'application/json',
|
55
54
|
'accept-language' => I18n.locale,
|
56
55
|
'content-type' => 'application/json')
|
@@ -88,7 +88,7 @@ module Katello
|
|
88
88
|
class << self
|
89
89
|
delegate :[], to: :json_resource
|
90
90
|
|
91
|
-
def resource(
|
91
|
+
def resource(options = {}, url: self.site + self.path, client_cert: self.client_cert, client_key: self.client_key, ca_file: nil)
|
92
92
|
cert_store = OpenSSL::X509::Store.new
|
93
93
|
cert_store.add_file(ca_file) if ca_file
|
94
94
|
|
@@ -107,9 +107,9 @@ module Katello
|
|
107
107
|
)
|
108
108
|
end
|
109
109
|
|
110
|
-
def json_resource(
|
110
|
+
def json_resource(options = {}, url: self.site + self.path, client_cert: self.client_cert, client_key: self.client_key, ca_file: nil)
|
111
111
|
options.deep_merge!(headers: self.default_headers)
|
112
|
-
resource(url, client_cert, client_key, ca_file
|
112
|
+
resource(options, url: url, client_cert: client_cert, client_key: client_key, ca_file: ca_file)
|
113
113
|
end
|
114
114
|
|
115
115
|
def rest_client(_http_type = nil, method = :get, path = self.path)
|
@@ -117,7 +117,7 @@ module Katello
|
|
117
117
|
self.consumer_secret = nil
|
118
118
|
self.consumer_key = nil
|
119
119
|
|
120
|
-
resource(self.site + path, client_cert, client_key
|
120
|
+
resource({ http_method: method }, url: self.site + path, client_cert: client_cert, client_key: client_key, ca_file: nil)
|
121
121
|
end
|
122
122
|
|
123
123
|
def client_cert
|
@@ -46,19 +46,21 @@ module Katello
|
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
49
|
-
def filter_errata_by_pulp_href(errata,
|
50
|
-
return [] if
|
51
|
-
|
52
|
-
srpms = Katello::Srpm.where(:pulp_id => package_pulp_hrefs)
|
53
|
-
rpm_filenames = rpms.map { |rpm| File.basename(rpm.filename) }
|
54
|
-
srpm_filenames = srpms.map { |srpm| File.basename(srpm.filename) }
|
49
|
+
def filter_errata_by_pulp_href(errata, content_pulp_hrefs, source_repo_rpm_filenames, source_repo_module_stream_specs)
|
50
|
+
return [] if content_pulp_hrefs.empty?
|
51
|
+
|
55
52
|
source_repo_rpm_filenames = source_repo_rpm_filenames.map { |rpm| File.basename(rpm) }
|
53
|
+
rpm_filenames = Katello::Rpm.where(:pulp_id => content_pulp_hrefs).map { |rpm| File.basename(rpm.filename) }
|
54
|
+
srpm_filenames = Katello::Srpm.where(:pulp_id => content_pulp_hrefs).map { |srpm| File.basename(srpm.filename) }
|
55
|
+
module_stream_specs = Katello::ModuleStream.where(:pulp_id => content_pulp_hrefs).map(&:module_spec)
|
56
|
+
|
56
57
|
matching_errata = []
|
57
58
|
errata.each do |erratum|
|
58
|
-
# The erratum should be copied if
|
59
|
-
|
60
|
-
|
61
|
-
|
59
|
+
# The erratum should be copied if content_pulp_hrefs has all of its packages/modules that are available in the source repo.
|
60
|
+
content_in_erratum_and_source_repo =
|
61
|
+
(erratum.packages.pluck(:filename) + erratum.module_stream_specs) & (source_repo_rpm_filenames + source_repo_module_stream_specs)
|
62
|
+
if (content_in_erratum_and_source_repo - rpm_filenames - srpm_filenames - module_stream_specs).empty? ||
|
63
|
+
(erratum.packages.empty? && erratum.module_streams.empty?) || content_in_erratum_and_source_repo.empty?
|
62
64
|
matching_errata << erratum
|
63
65
|
end
|
64
66
|
end
|
@@ -42,7 +42,6 @@ module Katello
|
|
42
42
|
classes = get_subclasses(ActiveRecord::Base)
|
43
43
|
classes = classes.select { |c| !ignore_list.include?(c.name) && c.respond_to?(:index) }
|
44
44
|
|
45
|
-
#we need index base classes first (TaskStatus) before child classes (PulpTaskStatus)
|
46
45
|
initial_list = classes.select { |c| c.superclass == ActiveRecord::Base }
|
47
46
|
subclass_list = classes - initial_list
|
48
47
|
initial_list + subclass_list
|
@@ -5,8 +5,11 @@ module Katello
|
|
5
5
|
environment_id = record.respond_to?(:lifecycle_environment_id) ? record.lifecycle_environment_id : record.environment_id
|
6
6
|
view = ContentView.where(:id => record.content_view_id).first
|
7
7
|
environment = KTEnvironment.where(:id => environment_id).first
|
8
|
-
unless view
|
9
|
-
record.errors[:base] << _("
|
8
|
+
unless view && environment
|
9
|
+
record.errors[:base] << _("Content view environments must have both a content view and an environment")
|
10
|
+
end
|
11
|
+
unless view&.organization == environment&.organization
|
12
|
+
record.errors[:base] << _("%{view_label} could not be promoted to %{environment_label} because the content view and the environment are not in the same organization!") % {:view_label => view&.label, :environment_label => environment&.label}
|
10
13
|
end
|
11
14
|
end
|
12
15
|
end
|
@@ -4,7 +4,6 @@ module Katello
|
|
4
4
|
def validate(record)
|
5
5
|
#support lifecycle_environment_id for foreman models
|
6
6
|
environment_id = record.respond_to?(:lifecycle_environment_id) ? record.lifecycle_environment_id : record.environment_id
|
7
|
-
|
8
7
|
if record.content_view_id
|
9
8
|
view = ContentView.where(:id => record.content_view_id).first
|
10
9
|
if environment_id
|
@@ -15,7 +14,7 @@ module Katello
|
|
15
14
|
end
|
16
15
|
end
|
17
16
|
if view&.generated_for_repository?
|
18
|
-
record.errors[:base] << _("Generated
|
17
|
+
record.errors[:base] << _("Generated content views cannot be assigned to hosts or activation keys")
|
19
18
|
end
|
20
19
|
end
|
21
20
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Katello
|
2
|
+
module Validators
|
3
|
+
class GeneratedContentViewValidator < ActiveModel::Validator
|
4
|
+
def validate(record)
|
5
|
+
record.content_view_environments.each do |cve|
|
6
|
+
if cve.content_view_id
|
7
|
+
view = ContentView.where(:id => cve.content_view_id).first
|
8
|
+
if view&.generated_for_repository?
|
9
|
+
record.errors[:base] << _("Content view '%{cv_name}' is a generated content view, which cannot be assigned to hosts or activation keys.") % { :cv_name => view.name }
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -33,8 +33,10 @@ module Katello
|
|
33
33
|
::User.as(user.login) do
|
34
34
|
@content_view = options[:content_view]
|
35
35
|
@environment = options[:environment]
|
36
|
-
@content_facets = Katello::Host::ContentFacet.
|
37
|
-
|
36
|
+
@content_facets = Katello::Host::ContentFacet.in_content_views_and_environments(
|
37
|
+
:lifecycle_environments => [@environment],
|
38
|
+
:content_views => [@content_view]
|
39
|
+
)
|
38
40
|
@hosts = ::Host::Managed.authorized("view_hosts").where(:id => @content_facets.pluck(:host_id))
|
39
41
|
@errata = @content_facets.map(&:installable_errata).flatten.uniq
|
40
42
|
|
@@ -34,7 +34,7 @@ module Katello
|
|
34
34
|
validates :base_url, if: -> { custom? || rhui? }, presence: true
|
35
35
|
validates :products, if: -> { custom? || rhui? }, absence: true
|
36
36
|
validates :label, :uniqueness => true
|
37
|
-
validates :name, :uniqueness => true
|
37
|
+
validates :name, :uniqueness => true, presence: true
|
38
38
|
validates :verify_ssl, if: :custom?, exclusion: [nil]
|
39
39
|
validates :alternate_content_source_type, inclusion: {
|
40
40
|
in: ->(_) { ACS_TYPES },
|
@@ -46,6 +46,10 @@ module Katello
|
|
46
46
|
allow_blank: false,
|
47
47
|
message: ->(_, _) { _("is not allowed for ACS. Must be one of the following: %s") % (RepositoryTypeManager.defined_repository_types.keys & CONTENT_TYPES).join(',') }
|
48
48
|
}
|
49
|
+
validates :content_type, if: -> { rhui? }, inclusion: {
|
50
|
+
in: [::Katello::Repository::YUM_TYPE],
|
51
|
+
message: "'%{value}' is not valid for RHUI ACS"
|
52
|
+
}
|
49
53
|
validates_with Validators::AlternateContentSourcePathValidator, :attributes => [:base_url, :subpaths], :if => :custom?
|
50
54
|
|
51
55
|
scope :uses_http_proxies, -> { where(use_http_proxies: true) }
|
@@ -25,8 +25,11 @@ module Katello
|
|
25
25
|
:complete_value => TRACE_STATUS_MAP
|
26
26
|
|
27
27
|
#associations for simpler scoped searches
|
28
|
-
|
29
|
-
|
28
|
+
has_many :content_view_environment_content_facets, through: :content_facet, class_name: 'Katello::ContentViewEnvironmentContentFacet'
|
29
|
+
has_many :content_view_environments, through: :content_view_environment_content_facets
|
30
|
+
has_many :content_views, through: :content_view_environments
|
31
|
+
has_many :lifecycle_environments, through: :content_view_environments
|
32
|
+
|
30
33
|
has_one :content_source, :through => :content_facet
|
31
34
|
has_many :content_facet_errata, :through => :content_facet, :class_name => 'Katello::ContentFacetErratum'
|
32
35
|
has_many :applicable_errata, :through => :content_facet_errata, :source => :erratum
|
@@ -37,10 +40,8 @@ module Katello
|
|
37
40
|
has_many :bound_root_repositories, :through => :content_facet
|
38
41
|
has_many :bound_content, :through => :content_facet
|
39
42
|
|
40
|
-
scoped_search :relation => :
|
41
|
-
scoped_search :relation => :
|
42
|
-
scoped_search :relation => :lifecycle_environment, :on => :name, :complete_value => true, :rename => :lifecycle_environment
|
43
|
-
scoped_search :relation => :content_facet, :on => :lifecycle_environment_id, :rename => :lifecycle_environment_id, :only_explicit => true, :validator => ScopedSearch::Validators::INTEGER
|
43
|
+
scoped_search :relation => :content_views, :on => :name, :complete_value => true, :rename => :content_views
|
44
|
+
scoped_search :relation => :lifecycle_environments, :on => :name, :complete_value => true, :rename => :lifecycle_environments
|
44
45
|
scoped_search :relation => :applicable_errata, :on => :errata_id, :rename => :applicable_errata, :complete_value => true, :ext_method => :find_by_applicable_errata, :only_explicit => true
|
45
46
|
scoped_search :relation => :applicable_errata, :on => :errata_id, :rename => :installable_errata, :complete_value => true, :ext_method => :find_by_installable_errata, :only_explicit => true
|
46
47
|
scoped_search :relation => :applicable_errata, :on => :issued, :rename => :applicable_errata_issued, :complete_value => true, :only_explicit => true
|
@@ -68,8 +69,8 @@ module Katello
|
|
68
69
|
end
|
69
70
|
|
70
71
|
apipie :class do
|
71
|
-
property :
|
72
|
-
property :
|
72
|
+
property :content_views, 'ContentView', desc: 'Returns content views associated with the host'
|
73
|
+
property :lifecycle_environments, 'KTEnvironment', desc: 'Returns lifecycle environment objects associated with the host'
|
73
74
|
property :content_source, 'SmartProxy', desc: 'Returns Smart Proxy object as the content source for the host'
|
74
75
|
property :applicable_errata, array_of: 'Erratum', desc: 'Returns errata applicable to the host'
|
75
76
|
end
|
@@ -154,15 +155,25 @@ module Katello
|
|
154
155
|
end
|
155
156
|
end
|
156
157
|
|
157
|
-
def
|
158
|
-
relation = self.joins(:content_facet)
|
159
|
-
relation = relation.where("#{::Katello::
|
160
|
-
relation = relation.where("#{::Katello::
|
158
|
+
def in_content_view_environments(content_views: nil, lifecycle_environments: nil)
|
159
|
+
relation = self.joins(:content_facet => {:content_view_environment_content_facets => :content_view_environment })
|
160
|
+
relation = relation.where("#{::Katello::ContentViewEnvironment.table_name}.content_view_id" => content_views) if content_views
|
161
|
+
relation = relation.where("#{::Katello::ContentViewEnvironment.table_name}.environment_id" => lifecycle_environments) if lifecycle_environments
|
161
162
|
relation
|
162
163
|
end
|
163
164
|
|
165
|
+
def in_environments(lifecycle_environments)
|
166
|
+
in_content_view_environments(:lifecycle_environments => lifecycle_environments)
|
167
|
+
end
|
168
|
+
|
169
|
+
def in_content_view_environment(content_view: nil, lifecycle_environment: nil)
|
170
|
+
Rails.logger.warn "DEPRECATION WARNING: in_content_view_environment is deprecated and will be removed in Katello 4.8. Please use in_content_view_environments instead."
|
171
|
+
in_content_view_environments(:content_views => content_view, :lifecycle_environments => lifecycle_environment)
|
172
|
+
end
|
173
|
+
|
164
174
|
def in_environment(lifecycle_environment)
|
165
|
-
|
175
|
+
Rails.logger.warn "DEPRECATION WARNING: in_environment is deprecated and will be removed in Katello 4.9. Please use in_environments instead."
|
176
|
+
in_environments(lifecycle_environment)
|
166
177
|
end
|
167
178
|
|
168
179
|
private
|
@@ -189,5 +200,5 @@ module Katello
|
|
189
200
|
end
|
190
201
|
|
191
202
|
class ::Host::Managed::Jail < Safemode::Jail
|
192
|
-
allow :
|
203
|
+
allow :content_source, :applicable_errata
|
193
204
|
end
|
@@ -51,8 +51,12 @@ module Katello
|
|
51
51
|
prepend ::ForemanRemoteExecution::HostExtensions if ::Katello.with_remote_execution?
|
52
52
|
prepend Overrides
|
53
53
|
|
54
|
-
delegate :content_source_id, :
|
54
|
+
delegate :content_source_id, :single_content_view, :single_lifecycle_environment, :default_environment?, :single_content_view_environment?, :multi_content_view_environment?, :kickstart_repository_id, :bound_repositories, to: :content_facet, allow_nil: true
|
55
55
|
|
56
|
+
has_many :content_view_environment_content_facets, through: :content_facet, class_name: 'Katello::ContentViewEnvironmentContentFacet'
|
57
|
+
has_many :content_view_environments, through: :content_view_environment_content_facets
|
58
|
+
has_many :content_views, through: :content_view_environments
|
59
|
+
has_many :lifecycle_environments, through: :content_view_environments
|
56
60
|
has_many :dispatch_histories, :class_name => "::Katello::Agent::DispatchHistory", :foreign_key => :host_id, :dependent => :delete_all
|
57
61
|
|
58
62
|
has_many :host_installed_packages, :class_name => "::Katello::HostInstalledPackage", :foreign_key => :host_id, :dependent => :delete_all
|
@@ -92,6 +96,10 @@ module Katello
|
|
92
96
|
scoped_search :relation => :host_traces, :on => :application, :complete_value => true, :rename => :trace_app, :only_explicit => true
|
93
97
|
scoped_search :relation => :host_traces, :on => :app_type, :complete_value => true, :rename => :trace_app_type, :only_explicit => true
|
94
98
|
scoped_search :relation => :host_traces, :on => :helper, :complete_value => true, :rename => :trace_helper, :only_explicit => true
|
99
|
+
scoped_search :relation => :lifecycle_environments, :on => :name, :complete_value => true, :rename => :lifecycle_environment, :only_explicit => true
|
100
|
+
scoped_search :relation => :content_views, :on => :name, :complete_value => true, :rename => :content_view, :only_explicit => true
|
101
|
+
scoped_search :relation => :lifecycle_environments, :on => :id, :complete_value => true, :rename => :lifecycle_environment_id, :only_explicit => true
|
102
|
+
scoped_search :relation => :content_views, :on => :id, :complete_value => true, :rename => :content_view_id, :only_explicit => true
|
95
103
|
|
96
104
|
scoped_search relation: :pools, on: :pools_expiring_in_days, ext_method: :find_with_expiring_pools, only_explicit: true
|
97
105
|
|
@@ -111,8 +119,8 @@ module Katello
|
|
111
119
|
property :host_collections, array_of: 'HostCollection', desc: 'Returns list of the host collections the host belongs to'
|
112
120
|
property :pools, array_of: 'Pool', desc: 'Returns subscription pool objects associated with the host'
|
113
121
|
property :hypervisor_host, 'Host', desc: 'Returns hypervisor host object of this host'
|
114
|
-
property :
|
115
|
-
property :
|
122
|
+
property :lifecycle_environments, 'KTEnvironment', desc: 'Returns lifecycle environments associated with the host'
|
123
|
+
property :content_views, 'ContentView', desc: 'Returns content views associated with the host'
|
116
124
|
property :installed_packages, array_of: 'InstalledPackage', desc: 'Returns a list of packages installed on the host'
|
117
125
|
end
|
118
126
|
end
|
@@ -263,9 +271,9 @@ module Katello
|
|
263
271
|
def import_module_streams(module_streams)
|
264
272
|
streams = {}
|
265
273
|
module_streams.each do |module_stream|
|
266
|
-
stream = AvailableModuleStream.
|
274
|
+
stream = AvailableModuleStream.create_or_find_by!(name: module_stream["name"],
|
267
275
|
context: module_stream["context"],
|
268
|
-
stream: module_stream["stream"])
|
276
|
+
stream: module_stream["stream"])
|
269
277
|
streams[stream.id] = module_stream
|
270
278
|
end
|
271
279
|
sync_available_module_stream_associations(streams)
|
@@ -433,7 +441,7 @@ module Katello
|
|
433
441
|
versions_by_name = {}
|
434
442
|
if versions.present?
|
435
443
|
JSON.parse(versions).each do |nvra|
|
436
|
-
nvra =~ /([
|
444
|
+
nvra =~ /([^.]*)-\d+\.[-.\w]*/
|
437
445
|
versions_by_name[Regexp.last_match(1)] = nvra
|
438
446
|
end
|
439
447
|
end
|
@@ -471,9 +479,10 @@ end
|
|
471
479
|
|
472
480
|
class ::Host::Managed::Jail < Safemode::Jail
|
473
481
|
allow :content_source, :subscription_manager_configuration_url, :rhsm_organization_label,
|
474
|
-
:host_collections, :pools, :hypervisor_host, :
|
482
|
+
:host_collections, :pools, :hypervisor_host, :installed_debs,
|
475
483
|
:installed_packages, :traces_helpers, :advisory_ids, :package_names_for_job_template,
|
476
|
-
:filtered_entitlement_quantity_consumed, :bound_repositories
|
484
|
+
:filtered_entitlement_quantity_consumed, :bound_repositories,
|
485
|
+
:single_content_view, :single_lifecycle_environment
|
477
486
|
end
|
478
487
|
|
479
488
|
class ActiveRecord::Associations::CollectionProxy::Jail < Safemode::Jail
|
@@ -63,20 +63,30 @@ module Katello
|
|
63
63
|
def variant_repos(host, variant)
|
64
64
|
if variant && host.content_source
|
65
65
|
product_id = host.try(:content_facet).try(:kickstart_repository).try(:product_id) || host.try(:kickstart_repository).try(:product_id)
|
66
|
-
|
66
|
+
distribution_repositories(host)
|
67
67
|
.joins(:product)
|
68
68
|
.where("#{Katello::Repository.table_name}.distribution_variant LIKE :variant", { variant: "%#{variant}%" })
|
69
69
|
.where("#{Katello::Product.table_name}.id": product_id).collect { |repo| repo.to_hash(host.content_source, true) }
|
70
|
-
distros
|
71
70
|
end
|
72
71
|
end
|
73
72
|
|
74
73
|
def distribution_repositories(host, content_facet: nil)
|
75
74
|
content_facet ||= host.content_facet
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
75
|
+
case content_facet
|
76
|
+
when ::Katello::Host::ContentFacet
|
77
|
+
if content_facet.new_record?
|
78
|
+
content_views = ::Katello::ContentView.where(id: content_facet.content_view_environments.map(&:content_view_id))
|
79
|
+
lifecycle_environments = ::Katello::KTEnvironment.where(id: content_facet.content_view_environments.map(&:environment_id))
|
80
|
+
else
|
81
|
+
content_views = content_facet.try(:content_views) || host.try(:content_views)
|
82
|
+
lifecycle_environments = content_facet.try(:lifecycle_environments) || host.try(:lifecycle_environments)
|
83
|
+
end
|
84
|
+
when ::Katello::Hostgroup::ContentFacet
|
85
|
+
content_views = [content_facet.try(:content_view), host.try(:content_views)].flatten.compact
|
86
|
+
lifecycle_environments = [content_facet.try(:lifecycle_environment), host.try(:lifecycle_environments)].flatten.compact
|
87
|
+
end
|
88
|
+
if content_views.present? && lifecycle_environments.present? && host.os && host.architecture
|
89
|
+
Katello::Repository.in_environment(lifecycle_environments).in_content_views(content_views).
|
80
90
|
where(:distribution_arch => host.architecture.name).
|
81
91
|
where("#{Katello::Repository.table_name}.distribution_version = :release or #{Katello::Repository.table_name}.distribution_version like :match",
|
82
92
|
release: host.os.release, match: "#{host.os.release}.%")
|
@@ -235,14 +235,6 @@ module Katello
|
|
235
235
|
end
|
236
236
|
end
|
237
237
|
|
238
|
-
def backend_service_type(repository)
|
239
|
-
if pulp3_support?(repository)
|
240
|
-
Actions::Pulp3::Abstract::BACKEND_SERVICE_TYPE
|
241
|
-
else
|
242
|
-
Actions::Pulp::Abstract::BACKEND_SERVICE_TYPE
|
243
|
-
end
|
244
|
-
end
|
245
|
-
|
246
238
|
def pulp3_enabled?
|
247
239
|
self.has_feature? PULP3_FEATURE
|
248
240
|
end
|
@@ -451,10 +443,6 @@ module Katello
|
|
451
443
|
repos_in_env_cv(environment, content_view) - repos_in_sync_history
|
452
444
|
end
|
453
445
|
|
454
|
-
def smart_proxy_service
|
455
|
-
@smart_proxy_service ||= Pulp::SmartProxyRepository.new(self)
|
456
|
-
end
|
457
|
-
|
458
446
|
def rhsm_url
|
459
447
|
# Since Foreman 3.1 this setting is set
|
460
448
|
if (rhsm_url = setting(SmartProxy::PULP3_FEATURE, 'rhsm_url'))
|