katello 4.11.1 → 4.12.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/assets/javascripts/katello/common/katello.global.js +1 -1
- data/app/assets/javascripts/katello/locale/bn/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/bn_IN/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/ca/katello.js +80 -86
- data/app/assets/javascripts/katello/locale/cs/katello.js +79 -85
- data/app/assets/javascripts/katello/locale/cs_CZ/katello.js +91 -88
- data/app/assets/javascripts/katello/locale/de/katello.js +97 -94
- data/app/assets/javascripts/katello/locale/de_AT/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/de_DE/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/el/katello.js +86 -86
- data/app/assets/javascripts/katello/locale/en/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/en_GB/katello.js +88 -85
- data/app/assets/javascripts/katello/locale/en_US/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/es/katello.js +94 -94
- data/app/assets/javascripts/katello/locale/et_EE/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/fr/katello.js +97 -94
- data/app/assets/javascripts/katello/locale/gl/katello.js +80 -86
- data/app/assets/javascripts/katello/locale/gu/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/he_IL/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/hi/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/id/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/it/katello.js +89 -86
- data/app/assets/javascripts/katello/locale/ja/katello.js +97 -94
- data/app/assets/javascripts/katello/locale/ka/katello.js +92 -92
- data/app/assets/javascripts/katello/locale/kn/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/ko/katello.js +91 -94
- data/app/assets/javascripts/katello/locale/locale/katello.js +1051 -1048
- data/app/assets/javascripts/katello/locale/ml_IN/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/mr/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/nl_NL/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/or/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/pa/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/pl/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/pl_PL/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/pt/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/pt_BR/katello.js +94 -94
- data/app/assets/javascripts/katello/locale/ro/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/ro_RO/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/ru/katello.js +91 -94
- data/app/assets/javascripts/katello/locale/sl/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/sv_SE/katello.js +80 -86
- data/app/assets/javascripts/katello/locale/ta/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/ta_IN/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/te/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/tr/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/vi/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/vi_VN/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/zh/katello.js +76 -85
- data/app/assets/javascripts/katello/locale/zh_CN/katello.js +97 -94
- data/app/assets/javascripts/katello/locale/zh_TW/katello.js +91 -94
- data/app/assets/javascripts/katello/sync_management/index.js +0 -1
- data/app/assets/javascripts/katello/sync_management/sync_management.js +365 -308
- data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +1 -0
- data/app/controllers/katello/api/v2/debs_controller.rb +4 -0
- data/app/controllers/katello/api/v2/host_debs_controller.rb +13 -1
- data/app/controllers/katello/api/v2/organizations_controller.rb +1 -3
- data/app/controllers/katello/api/v2/repositories_controller.rb +2 -8
- data/app/controllers/katello/concerns/api/v2/registration_commands_controller_extensions.rb +0 -1
- data/app/controllers/katello/concerns/hosts_controller_extensions.rb +7 -3
- data/app/controllers/katello/concerns/organizations_controller_extensions.rb +1 -17
- data/app/helpers/katello/concerns/dashboard_helper_extensions.rb +0 -20
- data/app/lib/actions/katello/content_view/publish.rb +3 -3
- data/app/lib/actions/katello/content_view_version/auto_create_products.rb +4 -4
- data/app/lib/actions/katello/content_view_version/auto_create_redhat_repositories.rb +5 -5
- data/app/lib/actions/katello/content_view_version/auto_create_repositories.rb +5 -5
- data/app/lib/actions/katello/content_view_version/import.rb +14 -13
- data/app/lib/actions/katello/content_view_version/import_library.rb +4 -4
- data/app/lib/actions/katello/content_view_version/import_repository.rb +3 -3
- data/app/lib/actions/katello/content_view_version/reset_content_view_repositories_from_metadata.rb +2 -2
- data/app/lib/actions/katello/host/hypervisors_update.rb +0 -1
- data/app/lib/actions/katello/organization/manifest_delete.rb +1 -1
- data/app/lib/actions/katello/organization/manifest_refresh.rb +16 -16
- data/app/lib/actions/katello/repository/sync.rb +2 -4
- data/app/lib/actions/pulp3/orchestration/content_view_version/export.rb +20 -15
- data/app/lib/actions/pulp3/orchestration/content_view_version/export_library.rb +17 -14
- data/app/lib/actions/pulp3/orchestration/content_view_version/import.rb +11 -11
- data/app/lib/actions/pulp3/orchestration/repository/upload_content.rb +18 -13
- data/app/lib/actions/pulp3/repository/import_upload.rb +13 -5
- data/app/lib/actions/pulp3/repository/save_artifact.rb +23 -12
- data/app/lib/katello/api/v2/error_handling.rb +1 -1
- data/app/lib/katello/lazy_accessor.rb +6 -6
- data/app/lib/katello/resources/candlepin/owner.rb +2 -2
- data/app/mailers/katello/errata_mailer.rb +3 -3
- data/app/models/katello/concerns/host_managed_extensions.rb +29 -76
- data/app/models/katello/concerns/hostgroup_extensions.rb +4 -2
- data/app/models/katello/concerns/organization_extensions.rb +1 -1
- data/app/models/katello/concerns/pulp_database_unit.rb +1 -1
- data/app/models/katello/concerns/subscription_facet_host_extensions.rb +0 -27
- data/app/models/katello/content_view.rb +11 -6
- data/app/models/katello/content_view_version.rb +2 -0
- data/app/models/katello/deb.rb +8 -0
- data/app/models/katello/host/content_facet.rb +19 -14
- data/app/models/katello/host/subscription_facet.rb +0 -19
- data/app/models/katello/host_tracer.rb +9 -5
- data/app/models/katello/installed_deb.rb +1 -0
- data/app/models/katello/repository.rb +3 -2
- data/app/models/katello/trace_status.rb +6 -2
- data/app/overrides/add_organization_attributes.rb +0 -18
- data/app/presenters/katello/host_deb_presenter.rb +23 -0
- data/app/services/katello/candlepin/consumer.rb +0 -4
- data/app/services/katello/candlepin/event_handler.rb +6 -25
- data/app/services/katello/candlepin/message_handler.rb +1 -21
- data/app/services/katello/host/profiles_uploader.rb +17 -6
- data/app/services/katello/host_status_manager.rb +0 -22
- data/app/services/katello/organization_creator.rb +2 -2
- data/app/services/katello/pulp3/api/apt.rb +1 -1
- data/app/services/katello/pulp3/content_view_version/export.rb +2 -2
- data/app/services/katello/pulp3/content_view_version/metadata_generator.rb +1 -0
- data/app/services/katello/pulp3/content_view_version/metadata_map.rb +3 -0
- data/app/services/katello/pulp3/repository/apt.rb +16 -6
- data/app/services/katello/registration_manager.rb +1 -13
- data/app/views/katello/api/v2/host_debs/base.json.rabl +2 -0
- data/app/views/katello/api/v2/hosts/base.json.rabl +9 -0
- data/app/views/katello/api/v2/subscription_facet/base_with_root.json.rabl +0 -3
- data/app/views/katello/api/v2/subscription_facet/show.json.rabl +3 -0
- data/app/views/katello/sync_management/index.html.erb +14 -13
- data/app/views/overrides/activation_keys/_host_environment_select.html.erb +20 -16
- data/app/views/overrides/activation_keys/_host_synced_content_select.html.erb +6 -4
- data/app/views/overrides/organizations/_edit_override.html.erb +0 -12
- data/db/migrate/20131014225132_add_users_fields.rb +0 -1
- data/db/migrate/20150603045418_remove_user_fields.rb +0 -2
- data/db/migrate/20160404132250_remove_katello_from_notification_name.rb +4 -22
- data/db/migrate/20160505181337_rename_katello_settings.rb +2 -2
- data/db/migrate/20200818192230_update_system_purpose_status.rb +9 -3
- data/db/migrate/20240111032511_add_index_to_host_installed_packages.rb +16 -0
- data/db/migrate/20240123120109_remove_pulp_export_destination_setting.rb +9 -0
- data/db/migrate/20240207191223_remove_entitlement_mode_host_statuses.rb +30 -0
- data/db/seeds.d/111-upgrade_tasks.rb +2 -1
- data/engines/bastion/app/assets/javascripts/bastion/bastion.js +0 -2
- data/engines/bastion/app/views/bastion/layouts/assets.html.erb +6 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-associations-content-hosts.html +0 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-details.html +0 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/bastion-katello-bootstrap.js +45 -29
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts-helper.service.js +0 -10
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-details.controller.js +0 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-info.html +2 -21
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-subscriptions.html +0 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts.html +0 -7
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/bastion_katello.pot +5 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +9 -1
- data/engines/bastion_katello/lib/bastion_katello/engine.rb +0 -6
- data/lib/katello/engine.rb +0 -3
- data/lib/katello/plugin.rb +2 -11
- data/lib/katello/tasks/rubocop.rake +0 -9
- data/lib/katello/tasks/unify_hosts.rake +0 -1
- data/lib/katello/tasks/upgrades/4.12/update_content_access_modes.rake +35 -0
- data/lib/katello/version.rb +1 -1
- data/locale/action_names.rb +12 -6
- data/locale/bn/katello.po +19 -28
- data/locale/bn/katello.po.time_stamp +0 -0
- data/locale/bn/katello.pox +0 -0
- data/locale/bn_IN/katello.po +19 -28
- data/locale/bn_IN/katello.po.time_stamp +0 -0
- data/locale/ca/LC_MESSAGES/katello.mo +0 -0
- data/locale/ca/katello.po +20 -29
- data/locale/ca/katello.po.time_stamp +0 -0
- data/locale/cs/katello.po +19 -29
- data/locale/cs/katello.po.time_stamp +0 -0
- data/locale/cs_CZ/LC_MESSAGES/katello.mo +0 -0
- data/locale/cs_CZ/katello.po +20 -29
- data/locale/cs_CZ/katello.po.time_stamp +0 -0
- data/locale/de/LC_MESSAGES/katello.mo +0 -0
- data/locale/de/katello.po +20 -29
- data/locale/de/katello.po.time_stamp +0 -0
- data/locale/de_AT/katello.po +19 -28
- data/locale/de_AT/katello.po.time_stamp +0 -0
- data/locale/de_DE/katello.po +19 -28
- data/locale/de_DE/katello.po.time_stamp +0 -0
- data/locale/el/LC_MESSAGES/katello.mo +0 -0
- data/locale/el/katello.po +20 -29
- data/locale/el/katello.po.time_stamp +0 -0
- data/locale/en/katello.po +19 -28
- data/locale/en/katello.po.time_stamp +0 -0
- data/locale/en_GB/LC_MESSAGES/katello.mo +0 -0
- data/locale/en_GB/katello.po +19 -28
- data/locale/en_GB/katello.po.time_stamp +0 -0
- data/locale/en_US/katello.po +19 -28
- data/locale/en_US/katello.po.time_stamp +0 -0
- data/locale/es/LC_MESSAGES/katello.mo +0 -0
- data/locale/es/katello.po +20 -29
- data/locale/es/katello.po.time_stamp +0 -0
- data/locale/et_EE/katello.po +19 -28
- data/locale/et_EE/katello.po.time_stamp +0 -0
- data/locale/fr/LC_MESSAGES/katello.mo +0 -0
- data/locale/fr/katello.po +20 -29
- data/locale/fr/katello.po.time_stamp +0 -0
- data/locale/gl/LC_MESSAGES/katello.mo +0 -0
- data/locale/gl/katello.po +20 -29
- data/locale/gl/katello.po.time_stamp +0 -0
- data/locale/gu/katello.po +19 -28
- data/locale/gu/katello.po.time_stamp +0 -0
- data/locale/he_IL/katello.po +19 -28
- data/locale/he_IL/katello.po.time_stamp +0 -0
- data/locale/hi/katello.po +19 -28
- data/locale/hi/katello.po.time_stamp +0 -0
- data/locale/id/katello.po +19 -28
- data/locale/id/katello.po.time_stamp +0 -0
- data/locale/it/LC_MESSAGES/katello.mo +0 -0
- data/locale/it/katello.po +20 -29
- data/locale/it/katello.po.time_stamp +0 -0
- data/locale/ja/LC_MESSAGES/katello.mo +0 -0
- data/locale/ja/katello.po +20 -29
- data/locale/ja/katello.po.time_stamp +0 -0
- data/locale/ka/LC_MESSAGES/katello.mo +0 -0
- data/locale/ka/katello.po +20 -29
- data/locale/ka/katello.po.time_stamp +0 -0
- data/locale/katello.pot +363 -348
- data/locale/kn/katello.po +19 -28
- data/locale/kn/katello.po.time_stamp +0 -0
- data/locale/ko/LC_MESSAGES/katello.mo +0 -0
- data/locale/ko/katello.po +20 -29
- data/locale/ko/katello.po.time_stamp +0 -0
- data/locale/messages.mo +0 -0
- data/locale/ml_IN/katello.po +19 -28
- data/locale/ml_IN/katello.po.time_stamp +0 -0
- data/locale/mr/katello.po +19 -28
- data/locale/mr/katello.po.time_stamp +0 -0
- data/locale/nl_NL/katello.po +19 -28
- data/locale/nl_NL/katello.po.time_stamp +0 -0
- data/locale/or/katello.po +19 -28
- data/locale/or/katello.po.time_stamp +0 -0
- data/locale/pa/katello.po +19 -28
- data/locale/pa/katello.po.time_stamp +0 -0
- data/locale/pl/katello.po +19 -28
- data/locale/pl/katello.po.time_stamp +0 -0
- data/locale/pl_PL/katello.po +19 -28
- data/locale/pl_PL/katello.po.time_stamp +0 -0
- data/locale/pt/katello.po +19 -28
- data/locale/pt/katello.po.time_stamp +0 -0
- data/locale/pt_BR/LC_MESSAGES/katello.mo +0 -0
- data/locale/pt_BR/katello.po +20 -29
- data/locale/pt_BR/katello.po.time_stamp +0 -0
- data/locale/ro/katello.po +19 -28
- data/locale/ro/katello.po.time_stamp +0 -0
- data/locale/ro_RO/katello.po +19 -28
- data/locale/ro_RO/katello.po.time_stamp +0 -0
- data/locale/ru/LC_MESSAGES/katello.mo +0 -0
- data/locale/ru/katello.po +20 -29
- data/locale/ru/katello.po.time_stamp +0 -0
- data/locale/sl/katello.po +19 -28
- data/locale/sl/katello.po.time_stamp +0 -0
- data/locale/sv_SE/LC_MESSAGES/katello.mo +0 -0
- data/locale/sv_SE/katello.po +20 -29
- data/locale/sv_SE/katello.po.time_stamp +0 -0
- data/locale/ta/katello.po +19 -28
- data/locale/ta/katello.po.time_stamp +0 -0
- data/locale/ta_IN/katello.po +19 -28
- data/locale/ta_IN/katello.po.time_stamp +0 -0
- data/locale/te/katello.po +19 -28
- data/locale/te/katello.po.time_stamp +0 -0
- data/locale/tr/katello.po +19 -28
- data/locale/tr/katello.po.time_stamp +0 -0
- data/locale/vi/katello.po +19 -28
- data/locale/vi/katello.po.time_stamp +0 -0
- data/locale/vi_VN/katello.po +19 -28
- data/locale/vi_VN/katello.po.time_stamp +0 -0
- data/locale/zh/katello.po +19 -28
- data/locale/zh/katello.po.time_stamp +0 -0
- data/locale/zh_CN/LC_MESSAGES/katello.mo +0 -0
- data/locale/zh_CN/katello.po +20 -29
- data/locale/zh_CN/katello.po.time_stamp +0 -0
- data/locale/zh_TW/LC_MESSAGES/katello.mo +0 -0
- data/locale/zh_TW/katello.po +20 -29
- data/locale/zh_TW/katello.po.time_stamp +0 -0
- data/package.json +0 -1
- data/webpack/components/extensions/HostDetails/Tabs/ContentTab/SecondaryTabsRoutes.js +4 -0
- data/webpack/components/extensions/HostDetails/Tabs/ContentTab/constants.js +4 -1
- data/webpack/components/extensions/HostDetails/Tabs/DebsTab/DebInstallModal.js +250 -0
- data/webpack/components/extensions/HostDetails/Tabs/DebsTab/DebInstallModal.scss +3 -0
- data/webpack/components/extensions/HostDetails/Tabs/DebsTab/DebsTab.js +585 -0
- data/webpack/components/extensions/HostDetails/Tabs/DebsTab/DebsTab.scss +12 -0
- data/webpack/components/extensions/HostDetails/Tabs/DebsTab/HostDebsActions.js +13 -0
- data/webpack/components/extensions/HostDetails/Tabs/DebsTab/HostDebsConstants.js +13 -0
- data/webpack/components/extensions/HostDetails/Tabs/DebsTab/HostDebsSelectors.js +16 -0
- data/webpack/components/extensions/HostDetails/Tabs/DebsTab/InstallableDebsActions.js +17 -0
- data/webpack/components/extensions/HostDetails/Tabs/DebsTab/InstallableDebsConstants.js +3 -0
- data/webpack/components/extensions/HostDetails/Tabs/DebsTab/InstallableDebsSelectors.js +16 -0
- data/webpack/components/extensions/HostDetails/Tabs/ModuleStreamsTab/ModuleStreamsTab.js +1 -8
- data/webpack/components/extensions/HostDetails/Tabs/PackagesTab/PackagesTab.js +2 -0
- data/webpack/components/extensions/HostDetails/Tabs/RepositorySetsTab/RepositorySetsTab.js +4 -18
- data/webpack/components/extensions/HostDetails/Tabs/TracesTab/TracesTab.js +13 -5
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/debs.fixtures.json +31 -0
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/debsInstallModal.test.js +226 -0
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/debsTab.test.js +420 -0
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/installableDebs.fixtures.json +63 -0
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/traces.fixtures.json +11 -1
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/tracesTab.test.js +63 -3
- data/webpack/scenes/ContentViews/ContentViewsConstants.js +3 -0
- data/webpack/scenes/ContentViews/Delete/__tests__/affectedHosts.fixtures.json +0 -13
- data/webpack/scenes/ContentViews/Details/ContentViewDetailActions.js +23 -1
- data/webpack/scenes/ContentViews/Details/ContentViewDetailSelectors.js +19 -1
- data/webpack/scenes/ContentViews/Details/Versions/BulkDelete/__tests__/hosts.fixtures.json +0 -13
- data/webpack/scenes/ContentViews/Details/Versions/Compare/CVVersionCompareConfig.js +37 -3
- data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersionContent.js +10 -2
- data/webpack/scenes/ContentViews/Details/Versions/Delete/__tests__/cvAffectedHosts.fixture.json +0 -13
- data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionDetailConfig.js +31 -5
- data/webpack/scenes/Organizations/OrganizationSelectors.js +0 -3
- data/webpack/scenes/Subscriptions/Manifest/index.js +1 -4
- data/webpack/scenes/Subscriptions/SubscriptionsPage.js +3 -25
- data/webpack/scenes/Subscriptions/SubscriptionsSelectors.js +0 -3
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionsSelectors.test.js +0 -3
- data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsPage.test.js.snap +0 -22
- data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsSelectors.test.js.snap +0 -3
- data/webpack/scenes/Subscriptions/index.js +1 -2
- metadata +93 -190
- data/app/controllers/katello/concerns/content_facet_hosts_controller_extensions.rb +0 -22
- data/app/models/katello/concerns/widget_extensions.rb +0 -23
- data/app/models/katello/purpose_addons_status.rb +0 -28
- data/app/models/katello/purpose_role_status.rb +0 -28
- data/app/models/katello/purpose_sla_status.rb +0 -28
- data/app/models/katello/purpose_status.rb +0 -71
- data/app/models/katello/purpose_usage_status.rb +0 -28
- data/app/models/katello/subscription_status.rb +0 -71
- data/app/services/katello/candlepin/system_purpose.rb +0 -49
- data/app/views/dashboard/_subscription_status_widget.html.erb +0 -37
- data/app/views/dashboard/_subscription_widget.html.erb +0 -85
- data/app/views/overrides/organizations/_index_header_override.html.erb +0 -3
- data/app/views/overrides/organizations/_index_row_override.html.erb +0 -3
- data/app/views/overrides/organizations/_step_1_override.html.erb +0 -10
- data/config/locales/README +0 -10
- data/config/locales/bn.yml +0 -182
- data/config/locales/compare_upstream.sh +0 -21
- data/config/locales/cs.yml +0 -211
- data/config/locales/de.yml +0 -203
- data/config/locales/en.yml +0 -205
- data/config/locales/es.yml +0 -199
- data/config/locales/fr.yml +0 -222
- data/config/locales/gu.yml +0 -181
- data/config/locales/hi.yml +0 -199
- data/config/locales/it.yml +0 -205
- data/config/locales/ja.yml +0 -197
- data/config/locales/kn.yml +0 -199
- data/config/locales/ko.yml +0 -197
- data/config/locales/mr.yml +0 -178
- data/config/locales/or.yml +0 -181
- data/config/locales/pa.yml +0 -181
- data/config/locales/pt-BR.yml +0 -207
- data/config/locales/pt.yml +0 -207
- data/config/locales/ru.yml +0 -257
- data/config/locales/ta.yml +0 -181
- data/config/locales/te.yml +0 -181
- data/config/locales/update.sh +0 -14
- data/config/locales/zh-CN.yml +0 -199
- data/config/locales/zh-TW.yml +0 -199
- data/engines/bastion/app/assets/javascripts/bastion/bastion-bootstrap.js +0 -17
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/content-access-mode-banner.directive.js +0 -22
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/content-access-mode-banner.html +0 -10
- data/webpack/scenes/Subscriptions/Manifest/SimpleContentAccess.js +0 -96
@@ -3,7 +3,7 @@ module Actions
|
|
3
3
|
module Orchestration
|
4
4
|
module ContentViewVersion
|
5
5
|
class Import < Actions::EntryAction
|
6
|
-
def plan(content_view_version,
|
6
|
+
def plan(content_view_version, opts = {})
|
7
7
|
action_subject(content_view_version)
|
8
8
|
sequence do
|
9
9
|
smart_proxy = SmartProxy.pulp_primary!
|
@@ -11,8 +11,8 @@ module Actions
|
|
11
11
|
::Actions::Pulp3::ContentViewVersion::CreateImporter,
|
12
12
|
content_view_version_id: content_view_version.id,
|
13
13
|
smart_proxy_id: smart_proxy.id,
|
14
|
-
path: path,
|
15
|
-
metadata: metadata
|
14
|
+
path: opts[:path],
|
15
|
+
metadata: opts[:metadata]
|
16
16
|
).output
|
17
17
|
|
18
18
|
plan_action(
|
@@ -20,8 +20,8 @@ module Actions
|
|
20
20
|
organization_id: content_view_version.content_view.organization_id,
|
21
21
|
smart_proxy_id: smart_proxy.id,
|
22
22
|
importer_data: importer_output[:importer_data],
|
23
|
-
path: path,
|
24
|
-
metadata: metadata
|
23
|
+
path: opts[:path],
|
24
|
+
metadata: opts[:metadata]
|
25
25
|
)
|
26
26
|
concurrence do
|
27
27
|
content_view_version.importable_repositories.each do |repo|
|
@@ -31,20 +31,20 @@ module Actions
|
|
31
31
|
plan_action(
|
32
32
|
::Actions::Pulp3::ContentViewVersion::CreateImportHistory,
|
33
33
|
content_view_version_id: content_view_version.id,
|
34
|
-
path: path,
|
35
|
-
metadata: metadata,
|
34
|
+
path: opts[:path],
|
35
|
+
metadata: opts[:metadata],
|
36
36
|
content_view_name: content_view_version.name
|
37
37
|
)
|
38
38
|
plan_action(::Actions::Pulp3::ContentViewVersion::DestroyImporter,
|
39
39
|
organization_id: content_view_version.content_view.organization_id,
|
40
40
|
smart_proxy_id: smart_proxy.id,
|
41
|
-
path: path,
|
42
|
-
metadata: metadata,
|
41
|
+
path: opts[:path],
|
42
|
+
metadata: opts[:metadata],
|
43
43
|
importer_data: importer_output[:importer_data])
|
44
44
|
plan_self(
|
45
45
|
content_view_name: content_view_version.name,
|
46
|
-
metadata: metadata,
|
47
|
-
path: path,
|
46
|
+
metadata: opts[:metadata],
|
47
|
+
path: opts[:path],
|
48
48
|
content_view_version_id: content_view_version.id
|
49
49
|
)
|
50
50
|
end
|
@@ -6,22 +6,27 @@ module Actions
|
|
6
6
|
include Actions::Helpers::OutputPropagator
|
7
7
|
def plan(repository, smart_proxy, file, unit_type_id)
|
8
8
|
sequence do
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
if repository.deb?
|
10
|
+
upload_action_output = plan_action(Pulp3::Repository::UploadFile, repository, smart_proxy, file[:path]).output
|
11
|
+
artifact_action_output = plan_action(Pulp3::Repository::SaveArtifact, file, repository, smart_proxy, upload_action_output[:pulp_tasks], unit_type_id).output
|
12
|
+
else
|
13
|
+
checksum = Digest::SHA256.hexdigest(File.read(file[:path]))
|
14
|
+
duplicate_sha_path_content_list = ::Katello::Pulp3::PulpContentUnit.find_duplicate_unit(repository, unit_type_id, file, checksum)
|
15
|
+
duplicate_content_href = duplicate_sha_path_content_list&.results&.first&.pulp_href
|
12
16
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
17
|
+
unless duplicate_content_href
|
18
|
+
duplicate_sha_artifact_list = ::Katello::Pulp3::Api::Core.new(smart_proxy).artifacts_api.list("sha256": Digest::SHA256.hexdigest(File.read(file[:path])))
|
19
|
+
duplicate_sha_artifact_href = duplicate_sha_artifact_list&.results&.first&.pulp_href
|
20
|
+
if duplicate_sha_artifact_href
|
21
|
+
artifact_action_output = plan_action(Pulp3::Repository::SaveArtifact, file, repository, smart_proxy, nil, unit_type_id, artifact_href: duplicate_sha_artifact_href).output
|
22
|
+
else
|
23
|
+
upload_action_output = plan_action(Pulp3::Repository::UploadFile, repository, smart_proxy, file[:path]).output
|
24
|
+
artifact_action_output = plan_action(Pulp3::Repository::SaveArtifact, file, repository, smart_proxy, upload_action_output[:pulp_tasks], unit_type_id).output
|
25
|
+
end
|
21
26
|
end
|
22
|
-
|
27
|
+
artifact_action_output ||= {:content_unit_href => duplicate_content_href}
|
23
28
|
end
|
24
|
-
|
29
|
+
|
25
30
|
action_output = plan_action(Pulp3::Repository::ImportUpload, artifact_action_output, repository, smart_proxy).output
|
26
31
|
plan_action(Pulp3::Repository::SaveVersion, repository, tasks: action_output[:pulp_tasks]).output
|
27
32
|
plan_self(:subaction_output => action_output)
|
@@ -12,17 +12,25 @@ module Actions
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def invoke_external_task
|
15
|
+
repo = ::Katello::Repository.find(input[:repository_id])
|
16
|
+
repo_backend_service = repo.backend_service(smart_proxy)
|
17
|
+
|
15
18
|
if input[:save_artifact_output][:pulp_tasks]&.any?
|
16
|
-
|
19
|
+
if repo.deb?
|
20
|
+
content_unit_href = input[:save_artifact_output][:pulp_tasks].last[:created_resources].find { |href| href.include?("/deb/packages") }
|
21
|
+
else
|
22
|
+
content_unit_href = input[:save_artifact_output][:pulp_tasks].last[:created_resources].first
|
23
|
+
end
|
17
24
|
else
|
18
25
|
content_unit_href = input[:save_artifact_output][:content_unit_href]
|
19
26
|
end
|
20
27
|
|
21
|
-
repo = ::Katello::Repository.find(input[:repository_id])
|
22
|
-
repo_backend_service = repo.backend_service(smart_proxy)
|
23
|
-
|
24
28
|
output[:content_unit_href] = content_unit_href
|
25
|
-
|
29
|
+
if repo.deb?
|
30
|
+
output[:pulp_tasks] = input[:save_artifact_output][:pulp_tasks]
|
31
|
+
else
|
32
|
+
output[:pulp_tasks] = [repo_backend_service.add_content(content_unit_href)]
|
33
|
+
end
|
26
34
|
end
|
27
35
|
end
|
28
36
|
end
|
@@ -16,20 +16,31 @@ module Actions
|
|
16
16
|
content_type = input[:unit_type_id]
|
17
17
|
content_backend_service = SmartProxy.pulp_primary.content_service(content_type)
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
19
|
+
if repository.deb?
|
20
|
+
repo_url = repository.backend_service(smart_proxy).repository_reference.repository_href
|
21
|
+
output[:pulp_tasks] = [content_backend_service.content_api_create(relative_path: input[:options][:file_name],
|
22
|
+
repository: repo_url,
|
23
|
+
repository_id: repository.id,
|
24
|
+
distribution: "katello",
|
25
|
+
component: "upload",
|
26
|
+
artifact: artifact_href,
|
27
|
+
content_type: content_type)]
|
24
28
|
else
|
25
|
-
|
26
|
-
|
27
|
-
|
29
|
+
existing_content = ::Katello::Pulp3::PulpContentUnit.find_duplicate_unit(repository, input[:unit_type_id], {filename: input[:options][:file_name]}, input[:options][:sha256])
|
30
|
+
existing_content_href = existing_content&.results&.first&.pulp_href
|
31
|
+
|
32
|
+
if ::Katello::RepositoryTypeManager.find_content_type(input[:unit_type_id]).repository_import_on_upload
|
33
|
+
output[:pulp_tasks] = [repository.backend_service(smart_proxy).repository_import_content(artifact_href, input[:options])]
|
28
34
|
else
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
35
|
+
if existing_content_href
|
36
|
+
output[:content_unit_href] = existing_content_href
|
37
|
+
[]
|
38
|
+
else
|
39
|
+
output[:pulp_tasks] = [content_backend_service.content_api_create(relative_path: input[:options][:file_name],
|
40
|
+
repository_id: repository.id,
|
41
|
+
artifact: artifact_href,
|
42
|
+
content_type: content_type)]
|
43
|
+
end
|
33
44
|
end
|
34
45
|
end
|
35
46
|
end
|
@@ -75,7 +75,7 @@ module Katello
|
|
75
75
|
end
|
76
76
|
|
77
77
|
def rescue_from_unsupported_action_exception(exception)
|
78
|
-
respond_for_exception(exception, :status => :bad_request)
|
78
|
+
respond_for_exception(exception, :status => :bad_request, :force_json => true)
|
79
79
|
end
|
80
80
|
|
81
81
|
def rescue_from_bad_data(exception)
|
@@ -56,21 +56,21 @@ module Katello
|
|
56
56
|
@changed_remote_attributes = val
|
57
57
|
end
|
58
58
|
|
59
|
-
def save(
|
60
|
-
if (status = super)
|
59
|
+
def save(...)
|
60
|
+
if (status = super(...))
|
61
61
|
changed_remote_attributes.clear
|
62
62
|
end
|
63
63
|
status
|
64
64
|
end
|
65
65
|
|
66
|
-
def save!(
|
67
|
-
super.tap do
|
66
|
+
def save!(...)
|
67
|
+
super(...).tap do
|
68
68
|
changed_remote_attributes.clear
|
69
69
|
end
|
70
70
|
end
|
71
71
|
|
72
|
-
def reload(
|
73
|
-
super.tap do
|
72
|
+
def reload(...)
|
73
|
+
super(...).tap do
|
74
74
|
changed_remote_attributes.clear
|
75
75
|
end
|
76
76
|
end
|
@@ -18,7 +18,7 @@ module Katello
|
|
18
18
|
:displayName => description,
|
19
19
|
:contentPrefix => "/#{key}/$env",
|
20
20
|
:contentAccessMode => content_access_mode,
|
21
|
-
:contentAccessModeList =>
|
21
|
+
:contentAccessModeList => 'org_environment'
|
22
22
|
}
|
23
23
|
owner_json = self.post(path, attrs.to_json, self.default_headers).body
|
24
24
|
JSON.parse(owner_json).with_indifferent_access
|
@@ -42,7 +42,7 @@ module Katello
|
|
42
42
|
def update(key, attrs)
|
43
43
|
owner = find(key)
|
44
44
|
owner.merge!(attrs)
|
45
|
-
owner.merge!(:contentAccessModeList =>
|
45
|
+
owner.merge!(:contentAccessModeList => 'org_environment')
|
46
46
|
self.put(path(key), JSON.generate(owner), self.default_headers).body
|
47
47
|
end
|
48
48
|
|
@@ -50,9 +50,9 @@ module Katello
|
|
50
50
|
|
51
51
|
def errata_counts(errata)
|
52
52
|
counts = {:total => errata.count}
|
53
|
-
counts.merge(
|
54
|
-
|
55
|
-
end
|
53
|
+
counts.merge([:security, :bugfix, :enhancement].index_with do |errata_type|
|
54
|
+
errata.send(errata_type).count
|
55
|
+
end)
|
56
56
|
end
|
57
57
|
end
|
58
58
|
end
|
@@ -48,28 +48,6 @@ module Katello
|
|
48
48
|
inherited_attrs
|
49
49
|
end
|
50
50
|
|
51
|
-
def apply_inherited_attributes(attributes, initialized = true)
|
52
|
-
attributes = super(attributes, initialized) || {}
|
53
|
-
facet_attrs = attributes&.[]('content_facet_attributes')
|
54
|
-
return attributes if facet_attrs.blank?
|
55
|
-
cv_id = facet_attrs['content_view_id']
|
56
|
-
lce_id = facet_attrs['lifecycle_environment_id']
|
57
|
-
if initialized && (cv_id.blank? || lce_id.blank?)
|
58
|
-
if cv_id.blank?
|
59
|
-
Rails.logger.info "Hostgroup has no content view assigned; using host's existing content view"
|
60
|
-
facet_attrs['content_view_id'] = content_facet&.single_content_view&.id
|
61
|
-
end
|
62
|
-
if lce_id.blank?
|
63
|
-
Rails.logger.info "Hostgroup has no lifecycle environment assigned; using host's existing lifecycle environment"
|
64
|
-
facet_attrs['lifecycle_environment_id'] = content_facet&.single_lifecycle_environment&.id
|
65
|
-
end
|
66
|
-
attributes['content_facet_attributes'] = facet_attrs
|
67
|
-
else
|
68
|
-
Rails.logger.debug "Hostgroup has content view and lifecycle environment assigned; using those"
|
69
|
-
end
|
70
|
-
attributes
|
71
|
-
end
|
72
|
-
|
73
51
|
def smart_proxy_ids
|
74
52
|
ids = super
|
75
53
|
ids << content_source_id
|
@@ -168,6 +146,8 @@ module Katello
|
|
168
146
|
|
169
147
|
scoped_search relation: :pools, on: :pools_expiring_in_days, ext_method: :find_with_expiring_pools, only_explicit: true
|
170
148
|
|
149
|
+
smart_proxy_reference :content_facet => [:content_source_id]
|
150
|
+
|
171
151
|
def add_back_cve_errors
|
172
152
|
if @pending_cve_attrs&.[](:content_view_id).present? || @pending_cve_attrs&.[](:lifecycle_environment_id).present?
|
173
153
|
check_cve_attributes({ content_facet_attributes: @pending_cve_attrs })
|
@@ -430,18 +410,6 @@ module Katello
|
|
430
410
|
update_trace_status
|
431
411
|
end
|
432
412
|
|
433
|
-
def subscription_status
|
434
|
-
@subscription_status ||= get_status(::Katello::SubscriptionStatus).status
|
435
|
-
end
|
436
|
-
|
437
|
-
def subscription_status_label(options = {})
|
438
|
-
@subscription_status_label ||= get_status(::Katello::SubscriptionStatus).to_label(options)
|
439
|
-
end
|
440
|
-
|
441
|
-
def subscription_global_status
|
442
|
-
@subscription_global_status ||= get_status(::Katello::SubscriptionStatus).to_global
|
443
|
-
end
|
444
|
-
|
445
413
|
def errata_status
|
446
414
|
@errata_status ||= get_status(::Katello::ErrataStatus).status
|
447
415
|
end
|
@@ -450,46 +418,6 @@ module Katello
|
|
450
418
|
@errata_status_label ||= get_status(::Katello::ErrataStatus).to_label(options)
|
451
419
|
end
|
452
420
|
|
453
|
-
def purpose_status
|
454
|
-
@purpose_status ||= get_status(::Katello::PurposeStatus).status
|
455
|
-
end
|
456
|
-
|
457
|
-
def purpose_status_label(options = {})
|
458
|
-
@purpose_status_label ||= get_status(::Katello::PurposeStatus).to_label(options)
|
459
|
-
end
|
460
|
-
|
461
|
-
def purpose_sla_status
|
462
|
-
@purpose_sla_status ||= get_status(::Katello::PurposeSlaStatus).status
|
463
|
-
end
|
464
|
-
|
465
|
-
def purpose_sla_status_label(options = {})
|
466
|
-
@purpose_sla_status_label ||= get_status(::Katello::PurposeSlaStatus).to_label(options)
|
467
|
-
end
|
468
|
-
|
469
|
-
def purpose_role_status
|
470
|
-
@purpose_role_status ||= get_status(::Katello::PurposeRoleStatus).status
|
471
|
-
end
|
472
|
-
|
473
|
-
def purpose_role_status_label(options = {})
|
474
|
-
@purpose_role_status_label ||= get_status(::Katello::PurposeRoleStatus).to_label(options)
|
475
|
-
end
|
476
|
-
|
477
|
-
def purpose_usage_status
|
478
|
-
@purpose_usage_status ||= get_status(::Katello::PurposeUsageStatus).status
|
479
|
-
end
|
480
|
-
|
481
|
-
def purpose_usage_status_label(options = {})
|
482
|
-
@purpose_usage_status_label ||= get_status(::Katello::PurposeUsageStatus).to_label(options)
|
483
|
-
end
|
484
|
-
|
485
|
-
def purpose_addons_status
|
486
|
-
@purpose_addons_status ||= get_status(::Katello::PurposeAddonsStatus).status
|
487
|
-
end
|
488
|
-
|
489
|
-
def purpose_addons_status_label(options = {})
|
490
|
-
@purpose_addons_status_label ||= get_status(::Katello::PurposeAddonsStatus).to_label(options)
|
491
|
-
end
|
492
|
-
|
493
421
|
def rhel_lifecycle_global_status
|
494
422
|
@rhel_lifecycle_global_status ||= get_status(::Katello::RhelLifecycleStatus).to_global
|
495
423
|
end
|
@@ -541,6 +469,14 @@ module Katello
|
|
541
469
|
end
|
542
470
|
|
543
471
|
def package_names_for_job_template(action:, search:, versions: nil)
|
472
|
+
if self.operatingsystem.family == 'Debian'
|
473
|
+
deb_names_for_job_template(action: action, search: search)
|
474
|
+
else
|
475
|
+
yum_names_for_job_template(action: action, search: search, versions: versions)
|
476
|
+
end
|
477
|
+
end
|
478
|
+
|
479
|
+
def yum_names_for_job_template(action:, search:, versions: nil)
|
544
480
|
actions = %w(install remove update).freeze
|
545
481
|
case action
|
546
482
|
when 'install'
|
@@ -567,6 +503,24 @@ module Katello
|
|
567
503
|
end
|
568
504
|
end
|
569
505
|
|
506
|
+
def deb_names_for_job_template(action:, search:)
|
507
|
+
actions = %w(install remove update).freeze
|
508
|
+
case action
|
509
|
+
when 'install'
|
510
|
+
::Katello::Deb.apt_installable_for_host(self).search_for(search).distinct.pluck(:name)
|
511
|
+
when 'remove'
|
512
|
+
return [] if search.empty?
|
513
|
+
|
514
|
+
installed_debs.search_for(search).distinct.pluck(:name)
|
515
|
+
when 'update'
|
516
|
+
return [] if search.empty?
|
517
|
+
|
518
|
+
installed_debs.search_for(search).distinct.pluck(:name)
|
519
|
+
else
|
520
|
+
fail ::Foreman::Exception.new(N_("deb_names_for_job_template: Action must be one of %s"), actions.join(', '))
|
521
|
+
end
|
522
|
+
end
|
523
|
+
|
570
524
|
def advisory_ids(search:)
|
571
525
|
::Katello::Erratum.installable_for_hosts([self]).search_for(search).pluck(:errata_id)
|
572
526
|
end
|
@@ -596,8 +550,7 @@ class ::Host::Managed::Jail < Safemode::Jail
|
|
596
550
|
:host_collections, :pools, :hypervisor_host, :installed_debs,
|
597
551
|
:installed_packages, :traces_helpers, :advisory_ids, :package_names_for_job_template,
|
598
552
|
:filtered_entitlement_quantity_consumed, :bound_repositories,
|
599
|
-
:single_content_view, :single_lifecycle_environment, :
|
600
|
-
:purpose_role_status_label, :purpose_usage_status_label
|
553
|
+
:single_content_view, :single_lifecycle_environment, :release_version
|
601
554
|
end
|
602
555
|
|
603
556
|
class ActiveRecord::Associations::CollectionProxy::Jail < Safemode::Jail
|
@@ -122,8 +122,10 @@ module Katello
|
|
122
122
|
# it will return the value 2.
|
123
123
|
facet_model = Facets.registered_facets[facet].hostgroup_configuration.model
|
124
124
|
value = facet_model.where.not(attribute => nil).joins(:hostgroup).merge(
|
125
|
-
::Hostgroup.where(id: self.ancestor_ids).reorder(
|
126
|
-
|
125
|
+
::Hostgroup.where(id: self.ancestor_ids).reorder(
|
126
|
+
"#{::Hostgroup.table_name}.ancestry desc nulls last"
|
127
|
+
)
|
128
|
+
).pick(attribute)
|
127
129
|
end
|
128
130
|
value
|
129
131
|
end
|
@@ -169,7 +169,7 @@ module Katello
|
|
169
169
|
|
170
170
|
def orphaned
|
171
171
|
if many_repository_associations
|
172
|
-
where.
|
172
|
+
left_joins(repository_association.to_sym).where("#{repository_association_class.table_name}.#{unit_id_field}" => nil)
|
173
173
|
else
|
174
174
|
where.not(:repository_id => ::Katello::Repository.select(:id))
|
175
175
|
end
|
@@ -10,38 +10,15 @@ module Katello
|
|
10
10
|
included do
|
11
11
|
audited :associations => [:pools]
|
12
12
|
|
13
|
-
SUBSCRIPTION_STATUS_MAP = {
|
14
|
-
:valid => Katello::SubscriptionStatus::VALID,
|
15
|
-
:partial => Katello::SubscriptionStatus::PARTIAL,
|
16
|
-
:invalid => Katello::SubscriptionStatus::INVALID,
|
17
|
-
:unknown => Katello::SubscriptionStatus::UNKNOWN,
|
18
|
-
:disabled => Katello::SubscriptionStatus::DISABLED,
|
19
|
-
:unsubscribed_hypervisor => Katello::SubscriptionStatus::UNSUBSCRIBED_HYPERVISOR
|
20
|
-
}.freeze
|
21
|
-
|
22
13
|
accepts_nested_attributes_for :subscription_facet, :update_only => true, :reject_if => lambda { |attrs| attrs.values.compact.empty? }
|
23
14
|
|
24
15
|
has_many :activation_keys, :through => :subscription_facet
|
25
16
|
has_many :pools, :through => :subscription_facet
|
26
17
|
has_many :purpose_addons, :through => :subscription_facet
|
27
18
|
has_many :subscriptions, :through => :pools
|
28
|
-
has_one :subscription_status_object, :class_name => 'Katello::SubscriptionStatus', :foreign_key => 'host_id', :dependent => :destroy
|
29
|
-
has_one :purpose_sla_status_object, :class_name => 'Katello::PurposeSlaStatus', :foreign_key => 'host_id', :dependent => :destroy
|
30
|
-
has_one :purpose_role_status_object, :class_name => 'Katello::PurposeRoleStatus', :foreign_key => 'host_id', :dependent => :destroy
|
31
|
-
has_one :purpose_usage_status_object, :class_name => 'Katello::PurposeUsageStatus', :foreign_key => 'host_id', :dependent => :destroy
|
32
|
-
has_one :purpose_addons_status_object, :class_name => 'Katello::PurposeAddonsStatus', :foreign_key => 'host_id', :dependent => :destroy
|
33
|
-
has_one :purpose_status_object, :class_name => 'Katello::PurposeStatus', :foreign_key => 'host_id', :dependent => :destroy
|
34
19
|
has_one :rhel_lifecycle_status_object, :class_name => 'Katello::RhelLifecycleStatus', :foreign_key => 'host_id', :dependent => :destroy
|
35
20
|
has_one :hypervisor_host, :through => :subscription_facet
|
36
21
|
|
37
|
-
scoped_search :on => :status, :relation => :subscription_status_object, :rename => :subscription_status,
|
38
|
-
:complete_value => SUBSCRIPTION_STATUS_MAP
|
39
|
-
|
40
|
-
scoped_search on: :status, relation: :purpose_sla_status_object, rename: :sla_status, complete_value: purpose_status_map
|
41
|
-
scoped_search on: :status, relation: :purpose_role_status_object, rename: :role_status, complete_value: purpose_status_map
|
42
|
-
scoped_search on: :status, relation: :purpose_usage_status_object, rename: :usage_status, complete_value: purpose_status_map
|
43
|
-
scoped_search on: :status, relation: :purpose_addons_status_object, rename: :addons_status, complete_value: purpose_status_map
|
44
|
-
scoped_search on: :status, relation: :purpose_status_object, rename: :purpose_status, complete_value: purpose_status_map
|
45
22
|
scoped_search on: :status, relation: :rhel_lifecycle_status_object, rename: :rhel_lifecycle_status, complete_value: rhel_lifecycle_status_map
|
46
23
|
|
47
24
|
scoped_search :on => :release_version, :relation => :subscription_facet, :complete_value => true, :only_explicit => true
|
@@ -98,10 +75,6 @@ module Katello
|
|
98
75
|
end
|
99
76
|
|
100
77
|
module ClassMethods
|
101
|
-
def purpose_status_map
|
102
|
-
::Katello::PurposeStatus.status_map
|
103
|
-
end
|
104
|
-
|
105
78
|
def rhel_lifecycle_status_map
|
106
79
|
::Katello::RhelLifecycleStatus.status_map
|
107
80
|
end
|
@@ -18,6 +18,7 @@ module Katello
|
|
18
18
|
|
19
19
|
has_many :content_view_versions, :class_name => "Katello::ContentViewVersion", :dependent => :destroy
|
20
20
|
alias_method :versions, :content_view_versions
|
21
|
+
has_one :latest_version_object, -> { latest }, :class_name => "Katello::ContentViewVersion", :dependent => :destroy
|
21
22
|
# Note the difference between content_view_components and component_composites both refer to
|
22
23
|
# ContentViewComponent but mean different things.
|
23
24
|
# content_view_components -> Topdown, given I am a composite CV get the associated components belonging to me
|
@@ -188,7 +189,7 @@ module Katello
|
|
188
189
|
end
|
189
190
|
|
190
191
|
def content_host_count
|
191
|
-
hosts.
|
192
|
+
hosts.size
|
192
193
|
end
|
193
194
|
|
194
195
|
def component_ids
|
@@ -341,10 +342,6 @@ module Katello
|
|
341
342
|
latest_version_object.try(:environments) || []
|
342
343
|
end
|
343
344
|
|
344
|
-
def latest_version_object
|
345
|
-
self.versions.order('major DESC').order('minor DESC').first
|
346
|
-
end
|
347
|
-
|
348
345
|
def last_task
|
349
346
|
last_task_id = history.order(:created_at)&.last&.task_id
|
350
347
|
last_task_id ? ForemanTasks::Task.find_by(id: last_task_id) : nil
|
@@ -611,6 +608,14 @@ module Katello
|
|
611
608
|
:components => components
|
612
609
|
)
|
613
610
|
|
611
|
+
# TODO: If a controller creates a new version and then uses latest_version_object, the old data is displayed.
|
612
|
+
# To prevent this, a 'reload' would currently be necessary, but this is not very performant.
|
613
|
+
# However, this is currently not a problem because after your create_new_version there is no immediate
|
614
|
+
# access to latest_version_object, but the ContentView object is first completely reloaded.
|
615
|
+
#
|
616
|
+
# In Rails 7.1, individual connections can be reloaded:
|
617
|
+
# https://www.shakacode.com/blog/rails-7-1-allows-resetting-singular-associations/
|
618
|
+
|
614
619
|
update(:next_version => major.to_i + 1) unless major.to_i < next_version
|
615
620
|
version
|
616
621
|
end
|
@@ -735,7 +740,7 @@ module Katello
|
|
735
740
|
end
|
736
741
|
|
737
742
|
def version_count
|
738
|
-
content_view_versions.
|
743
|
+
content_view_versions.size
|
739
744
|
end
|
740
745
|
|
741
746
|
def on_demand_repositories
|
@@ -66,6 +66,8 @@ module Katello
|
|
66
66
|
joins(:repositories).includes(:content_view).merge(repositories).distinct
|
67
67
|
end
|
68
68
|
|
69
|
+
scope :latest, -> { order('major DESC', 'minor DESC').limit(1) }
|
70
|
+
|
69
71
|
scoped_search :on => :content_view_id, :only_explicit => true, :validator => ScopedSearch::Validators::INTEGER
|
70
72
|
scoped_search :on => :major, :rename => :version, :complete_value => true, :ext_method => :find_by_version
|
71
73
|
serialize :content_counts
|
data/app/models/katello/deb.rb
CHANGED
@@ -10,6 +10,7 @@ module Katello
|
|
10
10
|
:dependent => :destroy, :inverse_of => :deb
|
11
11
|
has_many :content_facets, :through => :content_facet_applicable_debs, :class_name => "Katello::Host::ContentFacet"
|
12
12
|
|
13
|
+
scoped_search :on => :id, :complete_value => true
|
13
14
|
scoped_search :on => :name, :complete_value => true
|
14
15
|
scoped_search :on => :version, :complete_value => true
|
15
16
|
scoped_search :on => :architecture, :complete_value => true
|
@@ -95,6 +96,13 @@ module Katello
|
|
95
96
|
where("#{Katello::Host::ContentFacet.table_name}.host_id" => hosts).distinct
|
96
97
|
end
|
97
98
|
|
99
|
+
# Return deb packages that are not installed on a host, but could be installed
|
100
|
+
# the word 'installable' has a different meaning here than elsewhere
|
101
|
+
def self.apt_installable_for_host(host)
|
102
|
+
repos = host.content_facet.bound_repositories.pluck(:id)
|
103
|
+
Katello::Deb.in_repositories(repos).where.not(name: host.installed_debs.pluck(:name)).order(:name)
|
104
|
+
end
|
105
|
+
|
98
106
|
def self.latest(_relation)
|
99
107
|
fail 'NotImplemented'
|
100
108
|
end
|
@@ -8,6 +8,9 @@ module Katello
|
|
8
8
|
HOST_TOOLS_PACKAGE_NAME = 'katello-host-tools'.freeze
|
9
9
|
HOST_TOOLS_TRACER_PACKAGE_NAME = 'katello-host-tools-tracer'.freeze
|
10
10
|
SUBSCRIPTION_MANAGER_PACKAGE_NAME = 'subscription-manager'.freeze
|
11
|
+
ALL_HOST_TOOLS_PACKAGE_NAMES = [ "python-#{HOST_TOOLS_PACKAGE_NAME}",
|
12
|
+
"python3-#{HOST_TOOLS_PACKAGE_NAME}",
|
13
|
+
HOST_TOOLS_PACKAGE_NAME ].freeze
|
11
14
|
ALL_TRACER_PACKAGE_NAMES = [ "python-#{HOST_TOOLS_TRACER_PACKAGE_NAME}",
|
12
15
|
"python3-#{HOST_TOOLS_TRACER_PACKAGE_NAME}",
|
13
16
|
HOST_TOOLS_TRACER_PACKAGE_NAME ].freeze
|
@@ -181,12 +184,14 @@ module Katello
|
|
181
184
|
}
|
182
185
|
installable_hash[:total] = installable_hash.values.inject(:+)
|
183
186
|
# same for applicable, but we need to get the counts from the db
|
187
|
+
applicable_errata_counts = applicable_errata.pluck(:errata_type).tally
|
184
188
|
applicable_hash = {
|
185
|
-
:
|
186
|
-
:
|
187
|
-
:enhancement =>
|
189
|
+
:bugfix => applicable_errata_counts.values_at(*Katello::Erratum::BUGZILLA).compact.sum,
|
190
|
+
:security => applicable_errata_counts.values_at(*Katello::Erratum::SECURITY).compact.sum,
|
191
|
+
:enhancement => applicable_errata_counts.values_at(*Katello::Erratum::ENHANCEMENT).compact.sum
|
188
192
|
}
|
189
|
-
applicable_hash[:total] =
|
193
|
+
applicable_hash[:total] = applicable_errata_counts.values.sum
|
194
|
+
|
190
195
|
# keeping installable at the top level for backward compatibility
|
191
196
|
installable_hash.merge({
|
192
197
|
:applicable => applicable_hash
|
@@ -307,22 +312,22 @@ module Katello
|
|
307
312
|
end
|
308
313
|
end
|
309
314
|
|
310
|
-
def tracer_installed?
|
311
|
-
|
312
|
-
self.host.
|
315
|
+
def tracer_installed?(force_update_cache: false)
|
316
|
+
Rails.cache.fetch("#{self.host.id}/tracer_installed", expires_in: 7.days, force: force_update_cache) do
|
317
|
+
self.host.installed_packages.where("#{Katello::InstalledPackage.table_name}.name" => ALL_TRACER_PACKAGE_NAMES).any? ||
|
318
|
+
self.host.installed_debs.where("#{Katello::InstalledDeb.table_name}.name" => ALL_TRACER_PACKAGE_NAMES).any?
|
319
|
+
end
|
313
320
|
end
|
314
321
|
|
315
322
|
def tracer_rpm_available?
|
316
323
|
::Katello::Rpm.yum_installable_for_host(self.host).where(name: ALL_TRACER_PACKAGE_NAMES).any?
|
317
324
|
end
|
318
325
|
|
319
|
-
def host_tools_installed?
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
"python3-#{HOST_TOOLS_PACKAGE_NAME}",
|
325
|
-
HOST_TOOLS_PACKAGE_NAME ]).any?
|
326
|
+
def host_tools_installed?(force_update_cache: false)
|
327
|
+
Rails.cache.fetch("#{self.host.id}/host_tools_installed", expires_in: 7.days, force: force_update_cache) do
|
328
|
+
self.host.installed_packages.where("#{Katello::InstalledPackage.table_name}.name" => ALL_HOST_TOOLS_PACKAGE_NAMES).any? ||
|
329
|
+
self.host.installed_debs.where("#{Katello::InstalledDeb.table_name}.name" => ALL_HOST_TOOLS_PACKAGE_NAMES).any?
|
330
|
+
end
|
326
331
|
end
|
327
332
|
|
328
333
|
def update_errata_status
|