katello 4.0.3 → 4.1.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/hosts/host_and_hostgroup_edit.js +0 -33
- data/app/assets/stylesheets/katello/contents.scss +1 -1
- data/app/controllers/katello/api/registry/registry_proxies_controller.rb +5 -11
- data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +2 -9
- data/app/controllers/katello/api/v2/activation_keys_controller.rb +10 -24
- data/app/controllers/katello/api/v2/api_controller.rb +15 -3
- data/app/controllers/katello/api/v2/content_credentials_controller.rb +1 -1
- data/app/controllers/katello/api/v2/content_export_incrementals_controller.rb +1 -8
- data/app/controllers/katello/api/v2/content_exports_controller.rb +1 -14
- data/app/controllers/katello/api/v2/content_imports_controller.rb +38 -15
- data/app/controllers/katello/api/v2/content_uploads_controller.rb +1 -1
- data/app/controllers/katello/api/v2/content_view_components_controller.rb +22 -1
- data/app/controllers/katello/api/v2/content_view_filter_rules_controller.rb +6 -1
- data/app/controllers/katello/api/v2/content_view_versions_controller.rb +2 -59
- data/app/controllers/katello/api/v2/content_views_controller.rb +3 -58
- data/app/controllers/katello/api/v2/host_errata_controller.rb +7 -6
- data/app/controllers/katello/api/v2/host_packages_controller.rb +4 -4
- data/app/controllers/katello/api/v2/host_subscriptions_controller.rb +18 -22
- data/app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb +16 -16
- data/app/controllers/katello/api/v2/organizations_controller.rb +2 -1
- data/app/controllers/katello/api/v2/package_groups_controller.rb +4 -0
- data/app/controllers/katello/api/v2/repositories_controller.rb +13 -12
- data/app/controllers/katello/api/v2/repository_sets_controller.rb +50 -4
- data/app/controllers/katello/api/v2/subscriptions_controller.rb +7 -1
- data/app/controllers/katello/concerns/api/api_controller.rb +10 -0
- data/app/controllers/katello/concerns/api/v2/registration_commands_controller_extensions.rb +46 -0
- data/app/controllers/katello/concerns/api/v2/registration_controller_extensions.rb +8 -0
- data/app/controllers/katello/concerns/api/v2/repository_content_controller.rb +31 -22
- data/app/controllers/katello/concerns/hosts_controller_extensions.rb +0 -8
- data/app/controllers/katello/concerns/organizations_controller_extensions.rb +1 -1
- data/app/controllers/katello/concerns/registration_commands_controller_extensions.rb +34 -0
- data/app/helpers/katello/katello_urls_helper.rb +23 -0
- data/app/lib/actions/candlepin/owner/import.rb +10 -3
- data/app/lib/actions/candlepin/product/content_update.rb +1 -1
- data/app/lib/actions/foreman/environment/destroy.rb +2 -2
- data/app/lib/actions/katello/agent_action.rb +1 -6
- data/app/lib/actions/katello/capsule_content/refresh_repos.rb +0 -7
- data/app/lib/actions/katello/capsule_content/sync.rb +1 -1
- data/app/lib/actions/katello/capsule_content/sync_capsule.rb +1 -2
- data/app/lib/actions/katello/content_view/add_to_environment.rb +9 -7
- data/app/lib/actions/katello/content_view/incremental_updates.rb +3 -10
- data/app/lib/actions/katello/content_view/presenters/incremental_updates_presenter.rb +2 -3
- data/app/lib/actions/katello/content_view/promote_to_environment.rb +1 -4
- data/app/lib/actions/katello/content_view/publish.rb +21 -31
- data/app/lib/actions/katello/content_view_environment/destroy.rb +0 -5
- data/app/lib/actions/katello/content_view_version/auto_create_products.rb +22 -0
- data/app/lib/actions/katello/content_view_version/auto_create_repositories.rb +22 -0
- data/app/lib/actions/katello/content_view_version/destroy.rb +0 -10
- data/app/lib/actions/katello/content_view_version/export.rb +20 -22
- data/app/lib/actions/katello/content_view_version/import.rb +27 -13
- data/app/lib/actions/katello/content_view_version/import_library.rb +4 -2
- data/app/lib/actions/katello/content_view_version/incremental_update.rb +12 -67
- data/app/lib/actions/katello/content_view_version/republish_repositories.rb +0 -4
- data/app/lib/actions/katello/content_view_version/reset_content_view_repositories_from_metadata.rb +11 -0
- data/app/lib/actions/katello/foreman/content_update.rb +0 -3
- data/app/lib/actions/katello/host/auto_attach_subscriptions.rb +0 -4
- data/app/lib/actions/katello/organization/manifest_import.rb +7 -1
- data/app/lib/actions/katello/organization/manifest_refresh.rb +28 -7
- data/app/lib/actions/katello/orphan_cleanup/remove_orphans.rb +2 -2
- data/app/lib/actions/katello/product/create.rb +0 -1
- data/app/lib/actions/katello/repository/check_matching_content.rb +4 -3
- data/app/lib/actions/katello/repository/destroy.rb +1 -1
- data/app/lib/actions/katello/repository/discover.rb +1 -1
- data/app/lib/actions/katello/repository/filtered_index_content.rb +1 -4
- data/app/lib/actions/katello/repository/import_upload.rb +0 -1
- data/app/lib/actions/katello/repository/update.rb +0 -1
- data/app/lib/actions/middleware/record_smart_proxy_sync_history.rb +0 -5
- data/app/lib/actions/pulp/repository/create.rb +1 -7
- data/app/lib/actions/pulp/repository/distributor_publish.rb +2 -10
- data/app/lib/actions/pulp/repository/sync.rb +1 -3
- data/app/lib/actions/pulp3/capsule_content/refresh_content_guard.rb +17 -0
- data/app/lib/actions/pulp3/content_guard/refresh.rb +10 -6
- data/app/lib/actions/pulp3/content_view_version/create_export_history.rb +57 -0
- data/app/lib/actions/pulp3/content_view_version/create_import_history.rb +34 -0
- data/app/lib/actions/pulp3/orchestration/content_view_version/copy_version_units_to_library.rb +2 -3
- data/app/lib/actions/pulp3/orchestration/content_view_version/export.rb +34 -51
- data/app/lib/actions/pulp3/orchestration/content_view_version/export_library.rb +2 -2
- data/app/lib/actions/pulp3/orchestration/content_view_version/import.rb +13 -1
- data/app/lib/actions/pulp3/orchestration/orphan_cleanup/remove_orphans.rb +1 -1
- data/app/lib/actions/pulp3/orchestration/repository/sync.rb +1 -0
- data/app/lib/actions/pulp3/repository/refresh_remote.rb +17 -0
- data/app/lib/katello/agent/client_message_handler.rb +3 -11
- data/app/lib/katello/concerns/base_template_scope_extensions.rb +117 -3
- data/app/lib/katello/errors.rb +6 -11
- data/app/lib/katello/event_daemon/monitor.rb +0 -1
- data/app/lib/katello/event_daemon/runner.rb +2 -2
- data/app/lib/katello/event_daemon/services/agent_event_receiver.rb +10 -6
- data/app/lib/katello/http_resource.rb +1 -6
- data/app/lib/katello/logging.rb +11 -6
- data/app/lib/katello/qpid/connection.rb +1 -3
- data/app/lib/katello/repo_discovery.rb +15 -1
- data/app/lib/katello/resources/candlepin/owner.rb +3 -2
- data/app/lib/katello/resources/candlepin/pool.rb +6 -2
- data/app/lib/katello/resources/candlepin.rb +10 -0
- data/app/lib/katello/util/package.rb +1 -1
- data/app/lib/katello/util/pulpcore_content_filters.rb +1 -1
- data/app/lib/katello/validators/hostgroup_kickstart_repository_validator.rb +0 -6
- data/app/models/katello/authorization/content_view.rb +8 -0
- data/app/models/katello/authorization/content_view_version_import_history.rb +11 -0
- data/app/models/katello/concerns/content_facet_host_extensions.rb +1 -1
- data/app/models/katello/concerns/content_view_filter_rule_common.rb +2 -2
- data/app/models/katello/concerns/host_managed_extensions.rb +1 -32
- data/app/models/katello/concerns/hostgroup_extensions.rb +2 -9
- data/app/models/katello/concerns/http_proxy_extensions.rb +2 -4
- data/app/models/katello/concerns/location_extensions.rb +2 -25
- data/app/models/katello/concerns/operatingsystem_extensions.rb +0 -2
- data/app/models/katello/concerns/organization_extensions.rb +4 -18
- data/app/models/katello/concerns/redhat_extensions.rb +10 -18
- data/app/models/katello/concerns/smart_proxy_extensions.rb +6 -31
- data/app/models/katello/content_view.rb +17 -113
- data/app/models/katello/content_view_component.rb +5 -0
- data/app/models/katello/content_view_docker_filter_rule.rb +1 -0
- data/app/models/katello/content_view_package_filter_rule.rb +4 -0
- data/app/models/katello/content_view_package_group_filter.rb +1 -0
- data/app/models/katello/content_view_repository.rb +4 -5
- data/app/models/katello/content_view_version.rb +9 -33
- data/app/models/katello/content_view_version_export_history.rb +18 -4
- data/app/models/katello/content_view_version_import_history.rb +42 -0
- data/app/models/katello/erratum.rb +1 -1
- data/app/models/katello/events/delete_pool.rb +19 -0
- data/app/models/katello/glue/candlepin/environment.rb +7 -0
- data/app/models/katello/glue/candlepin/owner.rb +12 -1
- data/app/models/katello/glue/candlepin/pool.rb +42 -25
- data/app/models/katello/glue/provider.rb +3 -6
- data/app/models/katello/glue/pulp/repo.rb +19 -9
- data/app/models/katello/host/content_facet.rb +1 -0
- data/app/models/katello/host/subscription_facet.rb +3 -1
- data/app/models/katello/kt_environment.rb +0 -6
- data/app/models/katello/package_group.rb +4 -0
- data/app/models/katello/ping.rb +15 -4
- data/app/models/katello/pool.rb +9 -0
- data/app/models/katello/product.rb +0 -6
- data/app/models/katello/product_content.rb +3 -1
- data/app/models/katello/pulp_sync_status.rb +0 -10
- data/app/models/katello/repository.rb +20 -35
- data/app/models/katello/root_repository.rb +0 -5
- data/app/models/katello/subscription.rb +10 -0
- data/app/models/katello/sync_plan.rb +7 -0
- data/app/models/setting/content.rb +7 -8
- data/app/presenters/katello/content_view_version_compare_presenter.rb +2 -6
- data/app/presenters/katello/product_content_presenter.rb +3 -5
- data/app/services/cert/certs.rb +3 -7
- data/app/services/katello/applicability/applicable_content_helper.rb +1 -2
- data/app/services/katello/candlepin/event_handler.rb +22 -22
- data/app/services/katello/candlepin/message_handler.rb +24 -15
- data/app/services/katello/content_view_manager.rb +24 -0
- data/app/services/katello/event_monitor/poller_thread.rb +25 -20
- data/app/services/katello/managed_content_medium_provider.rb +4 -0
- data/app/services/katello/organization_creator.rb +120 -0
- data/app/services/katello/product_content_finder.rb +5 -1
- data/app/services/katello/pulp/pulp_content_unit.rb +6 -6
- data/app/services/katello/pulp/smart_proxy_repository.rb +2 -17
- data/app/services/katello/pulp3/api/ansible_collection.rb +14 -2
- data/app/services/katello/pulp3/api/apt.rb +1 -1
- data/app/services/katello/pulp3/api/content_guard.rb +6 -40
- data/app/services/katello/pulp3/api/core.rb +27 -2
- data/app/services/katello/pulp3/api/docker.rb +1 -1
- data/app/services/katello/pulp3/api/file.rb +5 -1
- data/app/services/katello/pulp3/api/yum.rb +9 -1
- data/app/services/katello/pulp3/content_view_version/export.rb +18 -40
- data/app/services/katello/pulp3/content_view_version/import.rb +75 -30
- data/app/services/katello/pulp3/content_view_version/import_gpg_keys.rb +32 -0
- data/app/services/katello/pulp3/content_view_version/import_validator.rb +53 -21
- data/app/services/katello/pulp3/content_view_version/importable_products.rb +47 -0
- data/app/services/katello/pulp3/content_view_version/importable_repositories.rb +52 -0
- data/app/services/katello/pulp3/content_view_version/metadata_generator.rb +99 -0
- data/app/services/katello/pulp3/pulp_content_unit.rb +1 -1
- data/app/services/katello/pulp3/repository/ansible_collection.rb +5 -1
- data/app/services/katello/pulp3/repository/apt.rb +2 -1
- data/app/services/katello/pulp3/repository/yum.rb +0 -16
- data/app/services/katello/pulp3/repository.rb +20 -1
- data/app/services/katello/pulp3/rpm.rb +5 -1
- data/app/services/katello/pulp3/task.rb +12 -5
- data/app/services/katello/pulp3/task_group.rb +10 -5
- data/app/services/katello/smart_proxy_helper.rb +1 -8
- data/app/services/katello/ui_notifications/pulp/proxy_disk_space.rb +0 -1
- data/app/services/katello/ui_notifications/system_error.rb +25 -0
- data/app/views/katello/api/v2/content_view_components/show.json.rabl +1 -1
- data/app/views/katello/api/v2/content_view_filters/show.json.rabl +0 -1
- data/app/views/katello/api/v2/{puppet_modules → content_view_version_import_histories}/index.json.rabl +1 -1
- data/app/views/katello/api/v2/content_view_version_import_histories/show.json.rabl +14 -0
- data/app/views/katello/api/v2/content_view_versions/base.json.rabl +2 -2
- data/app/views/katello/api/v2/content_view_versions/show.json.rabl +0 -7
- data/app/views/katello/api/v2/content_views/base.json.rabl +20 -9
- data/app/views/katello/api/v2/environments/show.json.rabl +0 -1
- data/app/views/katello/api/v2/package_groups/index.json.rabl +4 -0
- data/app/views/katello/api/v2/repositories/base.json.rabl +0 -1
- data/app/views/katello/api/v2/repositories/show.json.rabl +1 -1
- data/app/views/katello/api/v2/repository_sets/index.json.rabl +4 -1
- data/app/views/katello/api/v2/repository_sets/show.json.rabl +22 -0
- data/app/views/katello/api/v2/subscriptions/show.json.rabl +1 -1
- data/app/views/overrides/activation_keys/_host_media_type_select.html.erb +1 -1
- data/app/views/overrides/smart_proxies/_download_policy.erb +1 -1
- data/config/initializers/monkeys.rb +0 -1
- data/config/katello.yaml.example +0 -1
- data/config/routes/api/v2.rb +9 -21
- data/config/routes/overrides.rb +1 -2
- data/db/migrate/20140422000001_update_products_add_organization.rb +3 -2
- data/db/migrate/20160701180402_add_sortable_version_to_puppet_modules.rb +2 -0
- data/db/migrate/20200514092553_move_katello_fields_from_hostgroups.katello.rb +1 -1
- data/db/migrate/20210119162528_delete_puppet_and_ostree_repos.rb +14 -20
- data/db/migrate/20210224160921_remove_disabled_products_from_sync_plans.rb +6 -0
- data/db/migrate/20210302165636_remove_katello_puppet_modules.rb +62 -0
- data/db/migrate/20210309160925_create_katello_content_view_version_import_histories.rb +13 -0
- data/db/migrate/20210318204533_add_import_type_to_import_histories.rb +8 -0
- data/db/migrate/20210319123300_add_foreign_keys_to_import_export_histories.rb +6 -0
- data/db/migrate/20210322142311_add_auth_url_token_to_root_repositories.rb +6 -0
- data/db/migrate/20210331180353_katello_pool_organization_id_not_nullable.rb +16 -0
- data/db/migrate/20210409033915_add_created_in_katello_to_taxonomy.rb +9 -0
- data/db/seeds.d/101-locations.rb +0 -3
- data/db/seeds.d/102-organizations.rb +1 -5
- data/db/seeds.d/109-katello-notification-blueprints.rb +12 -0
- data/db/seeds.d/111-upgrade_tasks.rb +3 -2
- data/engines/bastion/vendor/assets/javascripts/bastion/angular/angular.js +325 -156
- data/engines/bastion/vendor/assets/javascripts/bastion/angular-animate/angular-animate.js +3 -3
- data/engines/bastion/vendor/assets/javascripts/bastion/angular-resource/angular-resource.js +3 -3
- data/engines/bastion/vendor/assets/javascripts/bastion/angular-route/angular-route.js +3 -3
- data/engines/bastion/vendor/assets/javascripts/bastion/angular-sanitize/angular-sanitize.js +21 -43
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-repository-sets.controller.js +9 -10
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-repository-sets.html +2 -9
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/bastion-katello-bootstrap.js +0 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/bastion_katello.js +0 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-errata-modal.controller.js +2 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-packages-modal.controller.js +2 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-errata-modal.html +11 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-packages-modal.html +18 -11
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-system-purpose-modal.html +10 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-errata.controller.js +2 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-packages-actions.controller.js +5 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-packages-applicable.controller.js +7 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-packages-installed.controller.js +7 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-errata.html +6 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-packages-actions.html +7 -7
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-packages-applicable.html +14 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-packages-installed.html +5 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts.routes.js +0 -14
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-repository-sets.controller.js +9 -11
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-info.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-repository-sets.html +2 -8
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts.html +3 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/register.html +5 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/content-view.factory.js +0 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/content-views.routes.js +0 -56
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/components/views/content-view-composite-available-content-views.html +0 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/components/views/content-view-composite-content-views-list.html +0 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-details.html +2 -9
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-info.html +0 -12
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-versions.html +0 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/content-view-version-content.controller.js +2 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/content-view-versions.module.js +0 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version.html +0 -7
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/content.service.js +0 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/environments.module.js +0 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/environments.routes.js +0 -11
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/views/environments.html +0 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/apply-errata.controller.js +21 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/views/apply-errata-confirm.html +9 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/bastion_katello.pot +71 -311
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/translations.js +0 -10
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/fenced-pages.service.js +0 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-manage-content.controller.js +2 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +13 -15
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/views/new-repository.html +21 -7
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/repositories.routes.js +0 -9
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/views/product-repositories.html +0 -6
- data/engines/bastion_katello/lib/bastion_katello/engine.rb +3 -3
- data/lib/katello/engine.rb +16 -15
- data/lib/katello/middleware/organization_created_enforcer.rb +22 -0
- data/lib/katello/permission_creator.rb +12 -28
- data/lib/katello/permissions/host_permissions.rb +3 -2
- data/lib/katello/plugin.rb +6 -19
- data/lib/katello/repository_types/ansible_collection.rb +1 -1
- data/lib/katello/repository_types/deb.rb +1 -1
- data/lib/katello/repository_types/docker.rb +1 -1
- data/lib/katello/repository_types/file.rb +1 -1
- data/lib/katello/repository_types/yum.rb +1 -1
- data/lib/katello/tasks/clean_backend_objects.rake +25 -0
- data/lib/katello/tasks/jenkins.rake +6 -0
- data/lib/katello/tasks/receptor/extract_orgs.rake +1 -3
- data/lib/katello/tasks/reimport.rake +0 -1
- data/lib/katello/tasks/repository.rake +0 -30
- data/lib/katello/tasks/update_subscription_facet_backend_data.rake +3 -3
- data/lib/katello/tasks/upgrades/4.0/remove_ostree_puppet_content.rake +2 -4
- data/lib/katello/tasks/upgrades/4.1/fix_invalid_pools.rake +62 -0
- data/lib/katello/tasks/upgrades/4.1/sync_noarch_content.rake +15 -0
- data/lib/katello/version.rb +1 -1
- data/lib/katello.rb +1 -1
- data/locale/action_names.rb +65 -63
- data/locale/bn/katello.edit.po +1357 -1606
- data/locale/bn/katello.po +465 -744
- data/locale/cs/katello.edit.po +1213 -1087
- data/locale/cs/katello.po +307 -219
- data/locale/de/katello.edit.po +1498 -1520
- data/locale/de/katello.po +589 -625
- data/locale/en/katello.edit.po +1198 -1074
- data/locale/en/katello.po +304 -213
- data/locale/es/katello.edit.po +2344 -2304
- data/locale/es/katello.po +1407 -1407
- data/locale/fr/katello.edit.po +2720 -2642
- data/locale/fr/katello.po +1703 -1750
- data/locale/gu/katello.edit.po +1546 -1797
- data/locale/gu/katello.po +654 -935
- data/locale/hi/katello.edit.po +1545 -1793
- data/locale/hi/katello.po +653 -931
- data/locale/it/katello.edit.po +1323 -1310
- data/locale/it/katello.po +407 -409
- data/locale/ja/katello.edit.po +2645 -2557
- data/locale/ja/katello.po +1646 -1664
- data/locale/katello.pot +1435 -1289
- data/locale/kn/katello.edit.po +1546 -1795
- data/locale/kn/katello.po +654 -933
- data/locale/ko/katello.edit.po +1464 -1449
- data/locale/ko/katello.po +554 -554
- data/locale/mr/katello.edit.po +1545 -1758
- data/locale/mr/katello.po +653 -896
- data/locale/or/katello.edit.po +1546 -1795
- data/locale/or/katello.po +654 -933
- data/locale/pa/katello.edit.po +1541 -1775
- data/locale/pa/katello.po +649 -913
- data/locale/pt/katello.edit.po +1289 -1255
- data/locale/pt/katello.po +398 -394
- data/locale/pt_BR/katello.edit.po +2370 -2315
- data/locale/pt_BR/katello.po +1435 -1421
- data/locale/ru/katello.edit.po +1611 -1608
- data/locale/ru/katello.po +704 -716
- data/locale/ta/katello.edit.po +1358 -1605
- data/locale/ta/katello.po +465 -742
- data/locale/te/katello.edit.po +1545 -1792
- data/locale/te/katello.po +653 -930
- data/locale/zh_CN/katello.edit.po +3052 -2930
- data/locale/zh_CN/katello.po +2055 -2039
- data/locale/zh_TW/katello.edit.po +1571 -1669
- data/locale/zh_TW/katello.po +649 -777
- data/package.json +2 -2
- data/webpack/{scenes/ContentViews/Details/Repositories/RepoAddedStatus.js → components/AddedStatusLabel.js} +5 -5
- data/webpack/components/RoutedTabs/RoutedTabs.js +91 -0
- data/webpack/components/RoutedTabs/__tests__/RoutedTabs.test.js +32 -0
- data/webpack/components/RoutedTabs/index.js +4 -0
- data/webpack/components/extensions/RegistrationCommands/RegistrationCommandsPageConstants.js +2 -0
- data/webpack/components/extensions/RegistrationCommands/RegistrationCommandsPageHelpers.js +21 -0
- data/webpack/components/extensions/RegistrationCommands/RegistrationCommandsPageSelectors.js +21 -0
- data/webpack/components/extensions/RegistrationCommands/__tests__/ActivationKeys.test.js +18 -0
- data/webpack/components/extensions/RegistrationCommands/__tests__/Force.test.js +9 -0
- data/webpack/components/extensions/RegistrationCommands/__tests__/IgnoreSubmanErrors.test.js +9 -0
- data/webpack/components/extensions/RegistrationCommands/__tests__/LifeCycleEnvironment.test.js +11 -0
- data/webpack/components/extensions/RegistrationCommands/__tests__/__snapshots__/ActivationKeys.test.js.snap +58 -0
- data/webpack/components/extensions/RegistrationCommands/__tests__/__snapshots__/Force.test.js.snap +25 -0
- data/webpack/components/extensions/RegistrationCommands/__tests__/__snapshots__/IgnoreSubmanErrors.test.js.snap +25 -0
- data/webpack/components/extensions/RegistrationCommands/__tests__/__snapshots__/LifeCycleEnvironment.test.js.snap +27 -0
- data/webpack/components/extensions/RegistrationCommands/fields/ActivationKeys.js +99 -0
- data/webpack/components/extensions/RegistrationCommands/fields/Force.js +38 -0
- data/webpack/components/extensions/RegistrationCommands/fields/IgnoreSubmanErrors.js +38 -0
- data/webpack/components/extensions/RegistrationCommands/fields/LifecycleEnvironment.js +56 -0
- data/webpack/components/extensions/RegistrationCommands/index.js +81 -0
- data/webpack/components/pf3Table/formatters/EntitlementsInlineEditFormatter.js +23 -24
- data/webpack/components/pf3Table/formatters/__tests__/__snapshots__/EntitlementsInlineEditFormatter.test.js.snap +3 -1
- data/webpack/components/pf3Table/formatters/entitlementsValueFormatter.js +16 -0
- data/webpack/containers/Application/overrides.scss +3 -0
- data/webpack/fills_index.js +3 -0
- data/webpack/redux/reducers/RedHatRepositories/enabled.fixtures.js +0 -2
- data/webpack/scenes/ContentViews/ContentViewsConstants.js +8 -1
- data/webpack/scenes/ContentViews/Copy/__tests__/contentViewCopyResult.fixtures.json +1 -3
- data/webpack/scenes/ContentViews/Create/__tests__/contentViewCreateResult.fixtures.json +1 -3
- data/webpack/scenes/ContentViews/Details/ComponentContentViews/ComponentEnvironments.js +28 -0
- data/webpack/scenes/ContentViews/Details/ComponentContentViews/ComponentVersion.js +45 -0
- data/webpack/scenes/ContentViews/Details/ComponentContentViews/ContentViewComponents.js +124 -0
- data/webpack/scenes/ContentViews/Details/ComponentContentViews/__tests__/contentViewComponents.fixtures.json +161 -0
- data/webpack/scenes/ContentViews/Details/ComponentContentViews/__tests__/contentViewComponents.test.js +163 -0
- data/webpack/scenes/ContentViews/Details/ComponentContentViews/__tests__/unpublishedCVComponents.fixtures.json +64 -0
- data/webpack/scenes/ContentViews/Details/ContentViewDetailActions.js +67 -7
- data/webpack/scenes/ContentViews/Details/ContentViewDetailSelectors.js +61 -4
- data/webpack/scenes/ContentViews/Details/ContentViewDetails.js +34 -11
- data/webpack/scenes/ContentViews/Details/Filters/CVFilterDetailType.js +33 -0
- data/webpack/scenes/ContentViews/Details/Filters/CVPackageGroupFilterContent.js +117 -0
- data/webpack/scenes/ContentViews/Details/Filters/CVRpmFilterContent.js +115 -0
- data/webpack/scenes/ContentViews/Details/Filters/ContentType.js +7 -10
- data/webpack/scenes/ContentViews/Details/Filters/ContentViewFilterDetails.js +49 -0
- data/webpack/scenes/ContentViews/Details/Filters/ContentViewFilterDetailsHeader.js +56 -0
- data/webpack/scenes/ContentViews/Details/Filters/ContentViewFilters.js +3 -17
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/CVRpmFilterContent.test.js +116 -0
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/allFilterPackageGroups.fixtures.json +69 -0
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilterDetail.fixtures.json +103 -0
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilterDetails.test.js +116 -0
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvPackageFilterDetail.fixtures.json +147 -0
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvPackageFilterRules.fixtures.json +30 -0
- data/webpack/scenes/ContentViews/Details/Histories/ContentViewHistories.js +136 -0
- data/webpack/scenes/ContentViews/Details/Histories/__tests__/contentViewHistory.fixtures.json +370 -0
- data/webpack/scenes/ContentViews/Details/Histories/__tests__/contentViewHistory.test.js +94 -0
- data/webpack/scenes/ContentViews/Details/Repositories/ContentCounts.js +0 -1
- data/webpack/scenes/ContentViews/Details/Repositories/ContentViewRepositories.js +106 -13
- data/webpack/scenes/ContentViews/Details/Repositories/LastSync.js +11 -5
- data/webpack/scenes/ContentViews/Details/Repositories/RepoIcon.js +5 -1
- data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewAddRemove.test.js +138 -0
- data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewDetailRepos.fixtures.json +0 -2
- data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewDetailRepos.test.js +1 -1
- data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewRepoAdd.fixture.json +57 -0
- data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersionContent.js +73 -0
- data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersionEnvironments.js +31 -0
- data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersionErrata.js +64 -0
- data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersionErrata.scss +8 -0
- data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersionPackages.js +0 -0
- data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersions.js +105 -0
- data/webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.fixtures.json +728 -0
- data/webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.test.js +154 -0
- data/webpack/scenes/ContentViews/Details/Versions/__tests__/emptyCVVersion.fixtures.json +13 -0
- data/webpack/scenes/ContentViews/Details/__tests__/contentViewDetail.test.js +3 -1
- data/webpack/scenes/ContentViews/Details/__tests__/contentViewDetails.fixtures.json +0 -2
- data/webpack/scenes/ContentViews/Table/ContentViewVersionCell.js +33 -0
- data/webpack/scenes/ContentViews/Table/ContentViewsTable.js +17 -22
- data/webpack/scenes/ContentViews/Table/tableDataGenerator.js +51 -102
- data/webpack/scenes/ContentViews/__tests__/basicContentViews.fixtures.js +5 -3
- data/webpack/scenes/ContentViews/__tests__/contentViewList.fixtures.json +30 -5
- data/webpack/scenes/ContentViews/__tests__/contentViewPage.test.js +95 -0
- data/webpack/scenes/ContentViews/components/ContentViewIcon.js +11 -5
- data/webpack/scenes/ContentViews/components/EnvironmentLabels.js +16 -0
- data/webpack/scenes/ContentViews/components/IconWithCount.js +1 -1
- data/webpack/scenes/ContentViews/components/InactiveText.js +15 -0
- data/webpack/scenes/ContentViews/expansions/DetailsExpansion.js +19 -1
- data/webpack/scenes/Subscriptions/Details/SubscriptionPurposeAttributes.js +1 -1
- data/webpack/scenes/Subscriptions/Details/__tests__/__snapshots__/SubscriptionDetailInfo.test.js.snap +1 -1
- data/webpack/scenes/Subscriptions/Details/__tests__/__snapshots__/SubscriptionDetails.test.js.snap +3 -3
- data/webpack/scenes/Subscriptions/Details/__tests__/subscriptionDetails.fixtures.js +1 -1
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTableHelpers.js +17 -0
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTableSchema.js +2 -1
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTable.test.js +1 -1
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/__snapshots__/SubscriptionsTable.test.js.snap +144 -0
- data/webpack/scenes/Tasks/helpers.js +2 -2
- data/webpack/test-utils/react-testing-lib-wrapper.js +11 -3
- data/webpack/utils/__tests__/useParamsWithHash.test.js +22 -0
- data/webpack/utils/helpers.js +2 -0
- data/webpack/utils/paramsFromHash.js +16 -0
- data/webpack/utils/useUrlParams.js +14 -0
- metadata +122 -206
- data/app/controllers/katello/api/v2/content_view_puppet_modules_controller.rb +0 -82
- data/app/controllers/katello/api/v2/puppet_modules_controller.rb +0 -19
- data/app/controllers/katello/concerns/registration_controller_extensions.rb +0 -16
- data/app/helpers/katello/concerns/hosts_and_hostgroups_helper_extensions.rb +0 -20
- data/app/lib/actions/candlepin/owner/create.rb +0 -16
- data/app/lib/actions/katello/content_view_puppet_environment/clear.rb +0 -11
- data/app/lib/actions/katello/content_view_puppet_environment/clone.rb +0 -78
- data/app/lib/actions/katello/content_view_puppet_environment/clone_content_for_version.rb +0 -20
- data/app/lib/actions/katello/content_view_puppet_environment/create.rb +0 -34
- data/app/lib/actions/katello/content_view_puppet_environment/create_for_version.rb +0 -23
- data/app/lib/actions/katello/content_view_puppet_environment/destroy.rb +0 -28
- data/app/lib/actions/katello/content_view_puppet_module/destroy.rb +0 -46
- data/app/lib/actions/katello/environment/library_create.rb +0 -35
- data/app/lib/actions/katello/organization/create.rb +0 -38
- data/app/lib/actions/pulp/content_view_puppet_environment/copy_contents.rb +0 -36
- data/app/lib/actions/pulp/content_view_puppet_environment/index_content.rb +0 -19
- data/app/lib/actions/pulp/repository/presenters/puppet_presenter.rb +0 -54
- data/app/lib/actions/pulp3/content_migration.rb +0 -31
- data/app/lib/actions/pulp3/content_migration_presenter.rb +0 -59
- data/app/lib/actions/pulp3/content_migration_reset.rb +0 -22
- data/app/lib/katello/foreman.rb +0 -32
- data/app/lib/katello/mapping.rb +0 -31
- data/app/lib/katello/util/hostgroup_facets_helper.rb +0 -126
- data/app/lib/katello/validators/content_view_puppet_module_validator.rb +0 -32
- data/app/models/katello/concerns/environment_extensions.rb +0 -74
- data/app/models/katello/content_view_puppet_environment.rb +0 -116
- data/app/models/katello/content_view_puppet_environment_puppet_module.rb +0 -11
- data/app/models/katello/content_view_puppet_module.rb +0 -63
- data/app/models/katello/puppet_module.rb +0 -77
- data/app/models/katello/repository_puppet_module.rb +0 -7
- data/app/services/katello/pulp/puppet_module.rb +0 -21
- data/app/services/katello/pulp/repository/puppet.rb +0 -68
- data/app/services/katello/pulp3/migration.rb +0 -329
- data/app/services/katello/pulp3/migration_plan.rb +0 -178
- data/app/services/katello/pulp3/migration_switchover.rb +0 -126
- data/app/services/katello/puppet_class_importer_extensions.rb +0 -32
- data/app/views/foreman/hosts/_registration.html.erb +0 -12
- data/app/views/katello/api/v2/activation_keys/product_content.json.rabl +0 -30
- data/app/views/katello/api/v2/content_view_puppet_modules/create.json.rabl +0 -3
- data/app/views/katello/api/v2/content_view_puppet_modules/index.json.rabl +0 -7
- data/app/views/katello/api/v2/content_view_puppet_modules/show.json.rabl +0 -9
- data/app/views/katello/api/v2/content_views/puppet_modules.json.rabl +0 -7
- data/app/views/katello/api/v2/host_subscriptions/content_override.json.rabl +0 -3
- data/app/views/katello/api/v2/host_subscriptions/product_content.json.rabl +0 -29
- data/app/views/katello/api/v2/puppet_modules/backend.json.rabl +0 -7
- data/app/views/katello/api/v2/puppet_modules/base.json.rabl +0 -9
- data/app/views/katello/api/v2/puppet_modules/compare.json.rabl +0 -10
- data/app/views/katello/api/v2/puppet_modules/name.json.rabl +0 -3
- data/app/views/katello/api/v2/puppet_modules/names.json.rabl +0 -7
- data/app/views/katello/api/v2/puppet_modules/show.json.rabl +0 -4
- data/db/migrate/20210512192745_fix_red_hat_root_repository_arch.rb +0 -11
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register-client.directive.js +0 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register-os-client.directive.js +0 -17
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js +0 -44
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/register-client.html +0 -28
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/register-deb-client.html +0 -38
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/register-oracle-client.html +0 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/register-sles-client.html +0 -28
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-available-puppet-modules.controller.js +0 -9
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/puppet-modules/content-view-puppet-module-names.controller.js +0 -45
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/puppet-modules/content-view-puppet-module-versions.controller.js +0 -61
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/puppet-modules/content-view-puppet-module.factory.js +0 -23
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/puppet-modules/content-view-puppet-modules.controller.js +0 -74
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/puppet-modules/views/content-view-puppet-module-names.html +0 -57
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/puppet-modules/views/content-view-puppet-module-versions.html +0 -64
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/puppet-modules/views/content-view-puppet-modules.html +0 -54
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-puppet-modules.html +0 -19
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment-puppet-modules.html +0 -25
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/de.po +0 -6903
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/es.po +0 -7094
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/fr.po +0 -7303
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/it.po +0 -6895
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ja.po +0 -6865
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ko.po +0 -6720
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/pt_BR.po +0 -7077
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ru.po +0 -6832
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/zh_CN.po +0 -6766
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/zh_TW.po +0 -6703
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-puppet-modules.html +0 -66
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/puppet-modules/details/puppet-module-content-views.controller.js +0 -44
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/puppet-modules/details/puppet-module-repositories.controller.js +0 -36
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/puppet-modules/details/puppet-module.controller.js +0 -34
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/puppet-modules/details/views/puppet-module-content-views.html +0 -41
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/puppet-modules/details/views/puppet-module-info.html +0 -32
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/puppet-modules/details/views/puppet-module-repositories.html +0 -52
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/puppet-modules/details/views/puppet-module.html +0 -37
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/puppet-modules/puppet-module.factory.js +0 -28
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/puppet-modules/puppet-modules.controller.js +0 -35
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/puppet-modules/puppet-modules.module.js +0 -20
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/puppet-modules/puppet-modules.routes.js +0 -71
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/puppet-modules/views/puppet-modules.html +0 -47
- data/lib/katello/repository_types/puppet.rb +0 -5
- data/lib/katello/tasks/fix_hostgroup_facets.rake +0 -8
- data/lib/katello/tasks/pulp3_content_switchover.rake +0 -32
- data/lib/katello/tasks/pulp3_migration.rake +0 -41
- data/lib/katello/tasks/pulp3_migration_abort.rake +0 -22
- data/lib/katello/tasks/pulp3_migration_reset.rake +0 -26
- data/lib/katello/tasks/pulp3_migration_stats.rake +0 -41
- data/lib/katello/tasks/pulp3_post_migration_check.rake +0 -51
- data/lib/monkeys/passenger_tee_input.rb +0 -20
- 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/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/zh_CN/LC_MESSAGES/katello.mo +0 -0
- data/locale/zh_TW/LC_MESSAGES/katello.mo +0 -0
- data/webpack/components/TabWrapper/TabWrapper.js +0 -26
- data/webpack/components/TabWrapper/index.js +0 -3
- data/webpack/components/TabbedView/TabbedView.js +0 -38
- data/webpack/components/TabbedView/TabbedView.scss +0 -3
- data/webpack/components/TabbedView/index.js +0 -3
- data/webpack/scenes/ContentViews/expansions/EnvironmentsExpansion.js +0 -19
- data/webpack/scenes/ContentViews/expansions/VersionsExpansion.js +0 -11
@@ -10,6 +10,7 @@ module Katello
|
|
10
10
|
|
11
11
|
CONTENT_DIR = "content_views".freeze
|
12
12
|
IMPORT_LIBRARY = "Import-Library".freeze
|
13
|
+
EXPORT_LIBRARY = "Export-Library".freeze
|
13
14
|
|
14
15
|
belongs_to :organization, :inverse_of => :content_views, :class_name => "::Organization"
|
15
16
|
|
@@ -36,10 +37,6 @@ module Katello
|
|
36
37
|
has_many :repositories, :through => :content_view_repositories, :class_name => "Katello::Repository",
|
37
38
|
:after_remove => :remove_repository
|
38
39
|
|
39
|
-
has_many :content_view_puppet_modules, :class_name => "Katello::ContentViewPuppetModule",
|
40
|
-
:dependent => :destroy
|
41
|
-
alias_method :puppet_modules, :content_view_puppet_modules
|
42
|
-
|
43
40
|
has_many :filters, :dependent => :destroy, :class_name => "Katello::ContentViewFilter"
|
44
41
|
|
45
42
|
has_many :activation_keys, :class_name => "Katello::ActivationKey", :dependent => :restrict_with_exception
|
@@ -62,7 +59,6 @@ module Katello
|
|
62
59
|
validates :name, :presence => true, :uniqueness => {:scope => :organization_id}
|
63
60
|
validates :organization_id, :presence => true
|
64
61
|
validate :check_non_composite_components
|
65
|
-
validate :check_puppet_conflicts
|
66
62
|
validate :check_docker_conflicts
|
67
63
|
validate :check_non_composite_auto_publish
|
68
64
|
validates :composite, :inclusion => [true, false]
|
@@ -119,6 +115,10 @@ module Katello
|
|
119
115
|
name == IMPORT_LIBRARY
|
120
116
|
end
|
121
117
|
|
118
|
+
def library_export?
|
119
|
+
name.start_with? EXPORT_LIBRARY
|
120
|
+
end
|
121
|
+
|
122
122
|
def content_host_count
|
123
123
|
hosts.count
|
124
124
|
end
|
@@ -197,18 +197,11 @@ module Katello
|
|
197
197
|
|
198
198
|
copy_components(new_view)
|
199
199
|
|
200
|
-
self.content_view_puppet_modules.each do |puppet_module|
|
201
|
-
new_view.content_view_puppet_modules << puppet_module.dup
|
202
|
-
end
|
203
200
|
copy_filters(new_view)
|
204
201
|
new_view.save!
|
205
202
|
new_view
|
206
203
|
end
|
207
204
|
|
208
|
-
def publish_puppet_environment?
|
209
|
-
force_puppet_environment? || puppet_modules.any? || component_modules_to_publish.present?
|
210
|
-
end
|
211
|
-
|
212
205
|
def promoted?
|
213
206
|
# if the view exists in more than 1 environment, it has been promoted
|
214
207
|
self.environments.many?
|
@@ -243,12 +236,6 @@ module Katello
|
|
243
236
|
Katello::Deb.in_repositories(self.repos(env)).count
|
244
237
|
end
|
245
238
|
|
246
|
-
def total_puppet_module_count(env)
|
247
|
-
repoids = self.repos(env).collect { |r| r.pulp_id }
|
248
|
-
result = Katello::PuppetModule.legacy_search('*', :page_size => 1, :repoids => repoids)
|
249
|
-
result.length > 0 ? result.total : 0
|
250
|
-
end
|
251
|
-
|
252
239
|
def in_environment?(env)
|
253
240
|
environments.include?(env)
|
254
241
|
end
|
@@ -265,10 +252,22 @@ module Katello
|
|
265
252
|
latest_version_object.try(:version)
|
266
253
|
end
|
267
254
|
|
255
|
+
def latest_version_id
|
256
|
+
latest_version_object.try(:id)
|
257
|
+
end
|
258
|
+
|
259
|
+
def latest_version_env
|
260
|
+
latest_version_object.try(:environments) || []
|
261
|
+
end
|
262
|
+
|
268
263
|
def latest_version_object
|
269
264
|
self.versions.order('major DESC').order('minor DESC').first
|
270
265
|
end
|
271
266
|
|
267
|
+
def last_task
|
268
|
+
history.order(:created_at).last
|
269
|
+
end
|
270
|
+
|
272
271
|
def history
|
273
272
|
Katello::ContentViewHistory.joins(:content_view_version).where(
|
274
273
|
"#{Katello::ContentViewVersion.table_name}.content_view_id" => self.id)
|
@@ -284,11 +283,6 @@ module Katello
|
|
284
283
|
(self.repositories.collect { |r| r.product }).uniq
|
285
284
|
end
|
286
285
|
|
287
|
-
def puppet_repos
|
288
|
-
# These are the repos that may contain puppet modules that can be associated with the content view
|
289
|
-
self.organization.library.repositories.puppet_type
|
290
|
-
end
|
291
|
-
|
292
286
|
def repos(env = nil)
|
293
287
|
if env
|
294
288
|
repo_ids = versions.flat_map { |version| version.repositories.in_environment(env) }.map(&:id)
|
@@ -298,15 +292,6 @@ module Katello
|
|
298
292
|
Repository.where(:id => repo_ids)
|
299
293
|
end
|
300
294
|
|
301
|
-
def puppet_env(env)
|
302
|
-
if env
|
303
|
-
ids = versions.flat_map { |version| version.content_view_puppet_environments.in_environment(env) }.map(&:id)
|
304
|
-
else
|
305
|
-
ids = []
|
306
|
-
end
|
307
|
-
ContentViewPuppetEnvironment.where(:id => ids).first
|
308
|
-
end
|
309
|
-
|
310
295
|
def library_repos
|
311
296
|
Repository.where(:id => library_repo_ids)
|
312
297
|
end
|
@@ -380,18 +365,6 @@ module Katello
|
|
380
365
|
end
|
381
366
|
end
|
382
367
|
|
383
|
-
# Returns actual puppet modules associated with all components
|
384
|
-
def component_modules_to_publish
|
385
|
-
composite? ? components.flat_map { |version| version.puppet_modules } : nil
|
386
|
-
end
|
387
|
-
|
388
|
-
# Returns the content view puppet modules associated with the content view
|
389
|
-
#
|
390
|
-
# @returns array of ContentViewPuppetModule
|
391
|
-
def puppet_modules_to_publish
|
392
|
-
composite? ? nil : content_view_puppet_modules
|
393
|
-
end
|
394
|
-
|
395
368
|
def component_repositories
|
396
369
|
components.map(&:archived_repos).flatten
|
397
370
|
end
|
@@ -459,14 +432,6 @@ module Katello
|
|
459
432
|
Repository.where(:id => ids)
|
460
433
|
end
|
461
434
|
|
462
|
-
def duplicate_puppet_modules
|
463
|
-
modules = puppet_modules_to_publish || component_modules_to_publish
|
464
|
-
counts = modules.each_with_object(Hash.new(0)) do |puppet_module, h|
|
465
|
-
h[puppet_module.name] += 1
|
466
|
-
end
|
467
|
-
counts.select { |_k, v| v > 1 }.keys
|
468
|
-
end
|
469
|
-
|
470
435
|
def duplicate_docker_repos
|
471
436
|
duplicate_repositories.docker_type
|
472
437
|
end
|
@@ -483,15 +448,6 @@ module Katello
|
|
483
448
|
end
|
484
449
|
end
|
485
450
|
|
486
|
-
def check_puppet_conflicts
|
487
|
-
duplicate_puppet_modules.each do |name|
|
488
|
-
versions = components.select { |v| v.puppet_modules.map(&:name).include?(name) }
|
489
|
-
names = versions.map(&:name).join(", ")
|
490
|
-
msg = _("Puppet module conflict: '%{mod}' is in %{versions}.") % {mod: name, versions: names}
|
491
|
-
errors.add(:base, msg)
|
492
|
-
end
|
493
|
-
end
|
494
|
-
|
495
451
|
def check_docker_conflicts
|
496
452
|
duplicate_docker_repos.each do |repo|
|
497
453
|
msg = _("Container Image repo '%{repo}' is present in multiple component content views.") % {repo: repo.name}
|
@@ -556,58 +512,6 @@ module Katello
|
|
556
512
|
version
|
557
513
|
end
|
558
514
|
|
559
|
-
def build_puppet_env(options)
|
560
|
-
if options[:environment] && options[:version]
|
561
|
-
fail "Cannot create into both an environment and a content view version archive"
|
562
|
-
end
|
563
|
-
|
564
|
-
to_env = options[:environment]
|
565
|
-
version = options[:version]
|
566
|
-
content_view = self
|
567
|
-
to_version = version || content_view.version(to_env)
|
568
|
-
|
569
|
-
ContentViewPuppetEnvironment.new(
|
570
|
-
:environment => to_env,
|
571
|
-
:content_view_version => to_version,
|
572
|
-
:name => self.name
|
573
|
-
)
|
574
|
-
end
|
575
|
-
|
576
|
-
def create_puppet_env(options)
|
577
|
-
build_puppet_env(options).save!
|
578
|
-
end
|
579
|
-
|
580
|
-
def computed_modules_by_repoid
|
581
|
-
names_and_authors = []
|
582
|
-
puppet_modules = []
|
583
|
-
|
584
|
-
if composite?
|
585
|
-
puppet_modules = component_modules_to_publish
|
586
|
-
else
|
587
|
-
puppet_modules_to_publish.each do |cvpm|
|
588
|
-
if cvpm.uuid
|
589
|
-
puppet_modules << cvpm.puppet_module
|
590
|
-
else
|
591
|
-
names_and_authors << { :name => cvpm.name, :author => cvpm.author }
|
592
|
-
end
|
593
|
-
end
|
594
|
-
end
|
595
|
-
|
596
|
-
if names_and_authors.present?
|
597
|
-
names_and_authors.each do |name_and_author|
|
598
|
-
puppet_module = ::Katello::PuppetModule.latest_module(
|
599
|
-
name_and_author[:name],
|
600
|
-
name_and_author[:author],
|
601
|
-
self.organization.library.repositories.puppet_type
|
602
|
-
)
|
603
|
-
puppet_modules << puppet_module if puppet_module
|
604
|
-
end
|
605
|
-
end
|
606
|
-
|
607
|
-
# In order to minimize the number of copy requests, organize the data by repoid.
|
608
|
-
PuppetModule.group_by_repoid(puppet_modules.flatten)
|
609
|
-
end
|
610
|
-
|
611
515
|
def check_ready_to_import!
|
612
516
|
fail _("Cannot import a composite content view") if composite?
|
613
517
|
fail _("This Content View must be set to Import-only before performing an import") unless import_only?
|
@@ -18,6 +18,11 @@ module Katello
|
|
18
18
|
|
19
19
|
before_validation :update_content_view, :on => :create
|
20
20
|
|
21
|
+
scoped_search :on => :name, :relation => :content_view, :complete_value => true
|
22
|
+
scoped_search :on => :organization_id, :relation => :content_view, :complete_value => true, :only_explicit => true, :validator => ScopedSearch::Validators::INTEGER
|
23
|
+
scoped_search :on => :label, :relation => :content_view, :complete_value => true
|
24
|
+
scoped_search :on => :composite, :relation => :content_view, :complete_value => true
|
25
|
+
|
21
26
|
def latest_version
|
22
27
|
if latest?
|
23
28
|
self.content_view.latest_version_object
|
@@ -10,6 +10,10 @@ module Katello
|
|
10
10
|
validates :name, :presence => true
|
11
11
|
validate :ensure_unique_attributes
|
12
12
|
validates_with Validators::ContentViewFilterVersionValidator
|
13
|
+
scoped_search :on => :version, :complete_value => true
|
14
|
+
scoped_search :on => :min_version, :complete_value => true
|
15
|
+
scoped_search :on => :max_version, :complete_value => true
|
16
|
+
scoped_search :on => :architecture, :complete_value => true
|
13
17
|
|
14
18
|
def ensure_unique_attributes
|
15
19
|
other = self.class.where(:name => self.name,
|
@@ -4,12 +4,11 @@ module Katello
|
|
4
4
|
Repository::DOCKER_TYPE,
|
5
5
|
Repository::OSTREE_TYPE,
|
6
6
|
Repository::FILE_TYPE,
|
7
|
-
Repository::DEB_TYPE
|
7
|
+
Repository::DEB_TYPE,
|
8
|
+
Repository::ANSIBLE_COLLECTION_TYPE
|
8
9
|
].freeze
|
9
10
|
|
10
|
-
ALLOWED_IMPORT_REPOSITORY_TYPES =
|
11
|
-
Repository::YUM_TYPE
|
12
|
-
].freeze
|
11
|
+
ALLOWED_IMPORT_REPOSITORY_TYPES = Repository::EXPORTABLE_TYPES
|
13
12
|
|
14
13
|
belongs_to :content_view, :inverse_of => :content_view_repositories,
|
15
14
|
:class_name => "Katello::ContentView"
|
@@ -17,7 +16,7 @@ module Katello
|
|
17
16
|
:class_name => "Katello::Repository"
|
18
17
|
|
19
18
|
validates_lengths_from_database
|
20
|
-
validates :repository_id, :uniqueness => {:scope => :content_view_id}
|
19
|
+
validates :repository_id, :uniqueness => {:scope => :content_view_id, :message => N_("already belongs to the content view") }
|
21
20
|
validate :content_view_composite
|
22
21
|
validate :ensure_repository_type
|
23
22
|
validate :check_repo_membership
|
@@ -1,5 +1,4 @@
|
|
1
1
|
module Katello
|
2
|
-
# rubocop:disable Metrics/ClassLength
|
3
2
|
class ContentViewVersion < Katello::Model
|
4
3
|
include Authorization::ContentViewVersion
|
5
4
|
include ForemanTasks::Concerns::ActionSubject
|
@@ -23,12 +22,11 @@ module Katello
|
|
23
22
|
has_many :triggered_histories, :class_name => "Katello::ContentViewHistory", :dependent => :destroy,
|
24
23
|
:inverse_of => :triggered_by, :foreign_key => :triggered_by_id
|
25
24
|
|
26
|
-
has_many :export_histories, :class_name => "Katello::ContentViewVersionExportHistory", :dependent => :destroy,
|
25
|
+
has_many :export_histories, :class_name => "::Katello::ContentViewVersionExportHistory", :dependent => :destroy,
|
26
|
+
:inverse_of => :content_view_version, :foreign_key => :content_view_version_id
|
27
|
+
has_many :import_histories, :class_name => "::Katello::ContentViewVersionImportHistory", :dependent => :destroy,
|
27
28
|
:inverse_of => :content_view_version, :foreign_key => :content_view_version_id
|
28
|
-
|
29
29
|
has_many :repositories, :class_name => "::Katello::Repository", :dependent => :destroy
|
30
|
-
has_many :content_view_puppet_environments, :class_name => "Katello::ContentViewPuppetEnvironment",
|
31
|
-
:dependent => :destroy
|
32
30
|
has_one :task_status, :class_name => "Katello::TaskStatus", :as => :task_owner, :dependent => :destroy
|
33
31
|
|
34
32
|
has_many :content_view_components, :class_name => "Katello::ContentViewComponent",
|
@@ -100,11 +98,6 @@ module Katello
|
|
100
98
|
query
|
101
99
|
end
|
102
100
|
|
103
|
-
def self.with_puppet_module(puppet_module)
|
104
|
-
joins(:content_view_puppet_environments)
|
105
|
-
.where("#{Katello::ContentViewPuppetEnvironment.table_name}.id" => puppet_module.content_view_puppet_environments)
|
106
|
-
end
|
107
|
-
|
108
101
|
def to_s
|
109
102
|
name
|
110
103
|
end
|
@@ -119,6 +112,10 @@ module Katello
|
|
119
112
|
self.history.order(:created_at).last
|
120
113
|
end
|
121
114
|
|
115
|
+
def env_promote_date(env)
|
116
|
+
Katello::ContentViewEnvironment.where(:environment_id => env.id, :content_view_version_id => self.id).pluck(:updated_at).try(:first)
|
117
|
+
end
|
118
|
+
|
122
119
|
def name
|
123
120
|
"#{content_view} #{version}"
|
124
121
|
end
|
@@ -159,14 +156,6 @@ module Katello
|
|
159
156
|
self.repositories.in_environment(env)
|
160
157
|
end
|
161
158
|
|
162
|
-
def puppet_env(env)
|
163
|
-
self.content_view_puppet_environments.in_environment(env).first
|
164
|
-
end
|
165
|
-
|
166
|
-
def promote_puppet_environment?
|
167
|
-
(!content_counts.blank? && content_counts.dig(PuppetModule::CONTENT_TYPE) > 0) || self.content_view.force_puppet_environment?
|
168
|
-
end
|
169
|
-
|
170
159
|
def archived_repos
|
171
160
|
self.default? ? self.repositories : self.repos(nil)
|
172
161
|
end
|
@@ -226,18 +215,6 @@ module Katello
|
|
226
215
|
end
|
227
216
|
end
|
228
217
|
|
229
|
-
def archive_puppet_environment
|
230
|
-
content_view_puppet_environments.archived.first
|
231
|
-
end
|
232
|
-
|
233
|
-
def puppet_modules
|
234
|
-
if archive_puppet_environment
|
235
|
-
archive_puppet_environment.puppet_modules
|
236
|
-
else
|
237
|
-
[]
|
238
|
-
end
|
239
|
-
end
|
240
|
-
|
241
218
|
def components_needing_errata(errata)
|
242
219
|
component_repos = Repository.where(:content_view_version_id => self.components)
|
243
220
|
library_repos = Repository.where(:id => component_repos.pluck(:library_instance_id)).with_errata(errata)
|
@@ -317,7 +294,6 @@ module Katello
|
|
317
294
|
content_counts[content_type::CONTENT_TYPE] = content_type.in_repositories(self.repositories.archived).count
|
318
295
|
end
|
319
296
|
end
|
320
|
-
self.content_counts[PuppetModule::CONTENT_TYPE] = self.puppet_modules.count
|
321
297
|
save!
|
322
298
|
end
|
323
299
|
|
@@ -361,9 +337,9 @@ module Katello
|
|
361
337
|
|
362
338
|
def importable_repositories
|
363
339
|
if default?
|
364
|
-
repositories.
|
340
|
+
repositories.exportable
|
365
341
|
else
|
366
|
-
archived_repos.
|
342
|
+
archived_repos.exportable
|
367
343
|
end
|
368
344
|
end
|
369
345
|
|
@@ -1,12 +1,15 @@
|
|
1
1
|
module Katello
|
2
2
|
class ContentViewVersionExportHistory < Katello::Model
|
3
3
|
include Authorization::ContentViewVersionExportHistory
|
4
|
+
audited except: :metadata
|
5
|
+
delegate :organization, to: :content_view_version
|
6
|
+
delegate :id, to: :organization, prefix: true
|
4
7
|
|
5
8
|
COMPLETE = "complete".freeze
|
6
9
|
INCREMENTAL = "incremental".freeze
|
7
10
|
EXPORT_TYPES = [COMPLETE, INCREMENTAL].freeze
|
8
11
|
|
9
|
-
belongs_to :content_view_version, :class_name => "Katello::ContentViewVersion", :inverse_of => :export_histories
|
12
|
+
belongs_to :content_view_version, :class_name => "::Katello::ContentViewVersion", :inverse_of => :export_histories, foreign_key: 'content_view_version_id'
|
10
13
|
validates_lengths_from_database
|
11
14
|
|
12
15
|
validates :content_view_version_id, :presence => true
|
@@ -19,7 +22,7 @@ module Katello
|
|
19
22
|
validates :metadata, :presence => true
|
20
23
|
serialize :metadata, Hash
|
21
24
|
|
22
|
-
before_validation :set_export_type
|
25
|
+
before_validation :set_export_type
|
23
26
|
|
24
27
|
scope :with_organization_id, ->(organization_id) do
|
25
28
|
where(:content_view_version_id => ContentViewVersion.with_organization_id(organization_id))
|
@@ -39,12 +42,23 @@ module Katello
|
|
39
42
|
destination_server: destination_server).order(:created_at).last
|
40
43
|
end
|
41
44
|
|
42
|
-
def export_type_from_metadata
|
45
|
+
def self.export_type_from_metadata(metadata)
|
43
46
|
metadata[:incremental] ? INCREMENTAL : COMPLETE
|
44
47
|
end
|
45
48
|
|
46
49
|
def set_export_type
|
47
|
-
self.export_type
|
50
|
+
self.export_type ||= self.class.export_type_from_metadata(metadata)
|
51
|
+
end
|
52
|
+
|
53
|
+
def self.generate_audit_comment(user:, content_view_version:, from_version: nil, metadata:)
|
54
|
+
export_type = export_type_from_metadata(metadata)
|
55
|
+
if content_view_version.content_view.library_export?
|
56
|
+
export_descriptor = "library export"
|
57
|
+
else
|
58
|
+
export_descriptor = "export of content view '#{content_view_version.content_view.name}' version #{content_view_version.version}"
|
59
|
+
export_descriptor += " from #{from_version.name}" if from_version
|
60
|
+
end
|
61
|
+
"#{export_type&.capitalize} #{export_descriptor} created by #{user.to_label}"
|
48
62
|
end
|
49
63
|
end
|
50
64
|
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
module Katello
|
2
|
+
class ContentViewVersionImportHistory < Katello::Model
|
3
|
+
include Authorization::ContentViewVersionImportHistory
|
4
|
+
|
5
|
+
audited except: :metadata
|
6
|
+
delegate :organization, to: :content_view_version
|
7
|
+
delegate :id, to: :organization, prefix: true
|
8
|
+
|
9
|
+
belongs_to :content_view_version, :class_name => "::Katello::ContentViewVersion", :inverse_of => :import_histories
|
10
|
+
validates_lengths_from_database
|
11
|
+
|
12
|
+
validates :content_view_version_id, presence: true
|
13
|
+
validates :metadata, presence: true
|
14
|
+
validates :path, presence: true
|
15
|
+
serialize :metadata, Hash
|
16
|
+
|
17
|
+
before_validation do |history|
|
18
|
+
history.import_type = ContentViewVersionExportHistory.export_type_from_metadata(history.metadata)
|
19
|
+
end
|
20
|
+
|
21
|
+
scope :with_organization_id, ->(organization_id) do
|
22
|
+
where(:content_view_version_id => ContentViewVersion.with_organization_id(organization_id))
|
23
|
+
end
|
24
|
+
|
25
|
+
scope :with_content_view_id, ->(cv_id) do
|
26
|
+
where(:content_view_version_id => ContentViewVersion.where(content_view_id: cv_id))
|
27
|
+
end
|
28
|
+
|
29
|
+
scoped_search :on => :content_view_id, :relation => :content_view_version, :validator => ScopedSearch::Validators::INTEGER, :only_explicit => true
|
30
|
+
scoped_search :on => :content_view_version_id, :only_explicit => true, :validator => ScopedSearch::Validators::INTEGER
|
31
|
+
scoped_search :on => :id, :only_explicit => true, :validator => ScopedSearch::Validators::INTEGER
|
32
|
+
scoped_search :on => :import_type, :rename => :type, :complete_value => ContentViewVersionExportHistory::EXPORT_TYPES
|
33
|
+
|
34
|
+
def self.generate_audit_comment(user:, path:, content_view_name:)
|
35
|
+
_("Content imported from %{path} into content view '%{name}' by %{user}") % {
|
36
|
+
path: path,
|
37
|
+
user: user.to_label,
|
38
|
+
name: content_view_name
|
39
|
+
}
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -19,7 +19,7 @@ module Katello
|
|
19
19
|
|
20
20
|
scoped_search :on => :errata_id, :only_explicit => true
|
21
21
|
scoped_search :on => :errata_id, :rename => :id, :complete_value => true, :only_explicit => true
|
22
|
-
scoped_search :on => :title
|
22
|
+
scoped_search :on => :title
|
23
23
|
scoped_search :on => :severity, :complete_value => true
|
24
24
|
scoped_search :on => :errata_type, :only_explicit => true
|
25
25
|
scoped_search :on => :errata_type, :rename => :type, :complete_value => true
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Katello
|
2
|
+
module Events
|
3
|
+
class DeletePool
|
4
|
+
EVENT_TYPE = 'delete_pool'.freeze
|
5
|
+
|
6
|
+
def initialize(pool_id)
|
7
|
+
@pool_id = pool_id
|
8
|
+
end
|
9
|
+
|
10
|
+
def run
|
11
|
+
if ::Katello::Pool.where(id: @pool_id).destroy_all.any?
|
12
|
+
Rails.logger.info("Deleted pool #{@pool_id}")
|
13
|
+
else
|
14
|
+
Rails.logger.info("Pool with id=#{@pool_id} has already been removed")
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -11,6 +11,13 @@ module Katello
|
|
11
11
|
Resources::Candlepin::Environment.find(self.cp_id)
|
12
12
|
end
|
13
13
|
|
14
|
+
def exists_in_candlepin?
|
15
|
+
candlepin_info
|
16
|
+
true
|
17
|
+
rescue RestClient::NotFound
|
18
|
+
false
|
19
|
+
end
|
20
|
+
|
14
21
|
def content_ids
|
15
22
|
self.candlepin_info['environmentContent'].collect { |c| c['id'] }
|
16
23
|
end
|
@@ -16,8 +16,19 @@ module Katello
|
|
16
16
|
end
|
17
17
|
|
18
18
|
module InstanceMethods
|
19
|
+
def find_owner
|
20
|
+
Resources::Candlepin::Owner.find(self.label)
|
21
|
+
end
|
22
|
+
|
23
|
+
def candlepin_owner_exists?
|
24
|
+
find_owner
|
25
|
+
true
|
26
|
+
rescue RestClient::ResourceNotFound
|
27
|
+
false
|
28
|
+
end
|
29
|
+
|
19
30
|
def owner_details
|
20
|
-
@owner_details ||=
|
31
|
+
@owner_details ||= find_owner
|
21
32
|
@owner_details['virt_who'] ||= self.subscriptions.using_virt_who.any?
|
22
33
|
|
23
34
|
@owner_details
|
@@ -10,7 +10,7 @@ module Katello
|
|
10
10
|
lazy_accessor :subscription_facts, :initializer => lambda { |_s| self.subscription ? self.subscription.attributes : {} }
|
11
11
|
|
12
12
|
lazy_accessor :pool_derived, :owner, :source_pool_id, :virt_limit, :arch, :description, :product_family,
|
13
|
-
:variant, :suggested_quantity, :support_type, :product_id, :type, :upstream_entitlement_id, :
|
13
|
+
:variant, :suggested_quantity, :support_type, :product_id, :type, :upstream_entitlement_id, :roles, :usage, :addons,
|
14
14
|
:initializer => :pool_facts
|
15
15
|
|
16
16
|
lazy_accessor :name, :support_level, :org, :sockets, :cores, :instance_multiplier,
|
@@ -27,8 +27,16 @@ module Katello
|
|
27
27
|
end
|
28
28
|
|
29
29
|
module ClassMethods
|
30
|
-
def candlepin_data(cp_id)
|
30
|
+
def candlepin_data(cp_id, rescue_gone = false)
|
31
31
|
Katello::Resources::Candlepin::Pool.find(cp_id)
|
32
|
+
rescue Katello::Errors::CandlepinPoolGone => e
|
33
|
+
raise e unless rescue_gone
|
34
|
+
|
35
|
+
if (pool_id = ::Katello::Pool.find_by_cp_id(cp_id)&.id)
|
36
|
+
Katello::EventQueue.push_event(::Katello::Events::DeletePool::EVENT_TYPE, pool_id)
|
37
|
+
Rails.logger.warn("Sending pool delete event for missing candlepin pool cp_id=#{cp_id}")
|
38
|
+
end
|
39
|
+
{}
|
32
40
|
end
|
33
41
|
|
34
42
|
def get_for_owner(organization)
|
@@ -36,19 +44,39 @@ module Katello
|
|
36
44
|
end
|
37
45
|
|
38
46
|
def import_pool(cp_pool_id, index_hosts = true)
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
pool
|
47
|
+
Katello::Logging.time("import candlepin pool", data: { cp_id: cp_pool_id }) do
|
48
|
+
json = candlepin_data(cp_pool_id)
|
49
|
+
|
50
|
+
org = Organization.find_by(label: json['owner']['key'])
|
51
|
+
fail("Organization with label #{json['owner']['key']} wasn't found while importing Candlepin pool") unless org
|
52
|
+
|
53
|
+
subscription = determine_subscription(
|
54
|
+
product_id: json['productId'],
|
55
|
+
source_stack_id: json['sourceStackId'],
|
56
|
+
organization: org
|
57
|
+
)
|
58
|
+
|
59
|
+
::Katello::Util::Support.active_record_retry do
|
60
|
+
pool = Katello::Pool.where(cp_id: cp_pool_id, organization: org, subscription: subscription).first_or_create!
|
61
|
+
pool.backend_data = json
|
62
|
+
pool.import_data(index_hosts)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
def determine_subscription(product_id: nil, source_stack_id: nil, organization:)
|
68
|
+
if source_stack_id
|
69
|
+
self.stacking_subscription(organization, source_stack_id)
|
70
|
+
# isn't it an error if we have a sourceStackID but no stacking subscription?
|
71
|
+
else
|
72
|
+
::Katello::Subscription.find_by(:cp_id => product_id, organization: organization)
|
44
73
|
end
|
45
74
|
end
|
46
75
|
|
47
|
-
def stacking_subscription(
|
48
|
-
org = Organization.find_by(:label => org_label)
|
76
|
+
def stacking_subscription(org, stacking_id)
|
49
77
|
subscription = ::Katello::Subscription.find_by(:organization_id => org.id, :cp_id => stacking_id)
|
50
78
|
if subscription.nil?
|
51
|
-
found_product = ::Katello::Resources::Candlepin::Product.find_for_stacking_id(
|
79
|
+
found_product = ::Katello::Resources::Candlepin::Product.find_for_stacking_id(org.label, stacking_id)
|
52
80
|
subscription = ::Katello::Subscription.find_by(:organization_id => org.id, :cp_id => found_product['id']) if found_product
|
53
81
|
end
|
54
82
|
subscription
|
@@ -57,7 +85,9 @@ module Katello
|
|
57
85
|
|
58
86
|
module InstanceMethods
|
59
87
|
def import_lazy_attributes
|
60
|
-
json = self.
|
88
|
+
json = self.class.candlepin_data(self.cp_id, true)
|
89
|
+
|
90
|
+
return {} if json.blank?
|
61
91
|
|
62
92
|
pool_attributes = json["attributes"] + json["productAttributes"]
|
63
93
|
json["virt_only"] = false
|
@@ -78,9 +108,7 @@ module Katello
|
|
78
108
|
json["product_id"] = json["productId"] if json["productId"]
|
79
109
|
json["upstream_entitlement_id"] = json["upstreamEntitlementId"]
|
80
110
|
|
81
|
-
|
82
|
-
subscription.backend_data["attributes"].map { |attr| json[attr["name"].underscore.to_sym] = attr["value"] }
|
83
|
-
end
|
111
|
+
subscription.backend_data["attributes"].map { |attr| json[attr["name"].underscore.to_sym] = attr["value"] }
|
84
112
|
json
|
85
113
|
end
|
86
114
|
|
@@ -93,24 +121,13 @@ module Katello
|
|
93
121
|
|
94
122
|
# rubocop:disable Metrics/MethodLength,Metrics/AbcSize
|
95
123
|
# rubocop:disable Metrics/CyclomaticComplexity
|
96
|
-
# rubocop:disable Metrics/PerceivedComplexity
|
97
124
|
def import_data(index_hosts_and_activation_keys = false)
|
98
125
|
pool_attributes = {}.with_indifferent_access
|
99
126
|
pool_json = self.backend_data
|
100
127
|
|
101
|
-
self.organization ||= Organization.find_by(:label => pool_json['owner']['key'])
|
102
128
|
product_attributes = pool_json["productAttributes"] + pool_json["attributes"]
|
103
|
-
|
104
129
|
product_attributes.map { |attr| pool_attributes[attr["name"].underscore.to_sym] = attr["value"] }
|
105
130
|
|
106
|
-
if pool_json["sourceStackId"]
|
107
|
-
subscription = Pool.stacking_subscription(pool_json['owner']['key'], pool_json["sourceStackId"])
|
108
|
-
else
|
109
|
-
subscription = ::Katello::Subscription.find_by(:cp_id => pool_json["productId"])
|
110
|
-
end
|
111
|
-
|
112
|
-
pool_attributes[:subscription_id] = subscription.id if subscription
|
113
|
-
|
114
131
|
%w(accountNumber contractNumber quantity startDate endDate accountNumber consumed).each do |json_attribute|
|
115
132
|
pool_attributes[json_attribute.underscore] = pool_json[json_attribute]
|
116
133
|
end
|