katello 3.6.0.1.rc2 → 3.7.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/activation_key_edit.js +2 -2
- data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +6 -4
- data/app/controllers/katello/api/v2/activation_keys_controller.rb +1 -3
- data/app/controllers/katello/api/v2/api_controller.rb +13 -3
- data/app/controllers/katello/api/v2/content_credentials_controller.rb +116 -0
- data/app/controllers/katello/api/v2/content_view_filter_rules_controller.rb +1 -1
- data/app/controllers/katello/api/v2/content_view_versions_controller.rb +6 -0
- data/app/controllers/katello/api/v2/content_views_controller.rb +2 -1
- data/app/controllers/katello/api/v2/environments_controller.rb +20 -3
- data/app/controllers/katello/api/v2/gpg_keys_controller.rb +5 -0
- data/app/controllers/katello/api/v2/host_subscriptions_controller.rb +14 -7
- data/app/controllers/katello/api/v2/products_controller.rb +31 -1
- data/app/controllers/katello/api/v2/repositories_controller.rb +103 -34
- data/app/controllers/katello/api/v2/repository_sets_controller.rb +22 -15
- data/app/controllers/katello/api/v2/subscriptions_controller.rb +31 -7
- data/app/controllers/katello/api/v2/upstream_subscriptions_controller.rb +93 -0
- data/app/controllers/katello/concerns/api/v2/repository_content_controller.rb +2 -2
- data/app/helpers/katello/katello_urls_helper.rb +21 -4
- data/app/jobs/create_pulp_disk_space_notifications.rb +4 -0
- data/app/jobs/send_expire_soon_notifications.rb +13 -0
- data/app/lib/actions/candlepin/import_pool_handler.rb +5 -4
- data/app/lib/actions/candlepin/owner/import_products.rb +4 -2
- data/app/lib/actions/helpers/notifications.rb +35 -0
- data/app/lib/actions/katello/capsule_content/sync.rb +12 -1
- data/app/lib/actions/katello/content_view/{capsule_generate_and_sync.rb → capsule_sync.rb} +1 -1
- data/app/lib/actions/katello/content_view/promote_to_environment.rb +1 -1
- data/app/lib/actions/katello/content_view/publish.rb +40 -11
- data/app/lib/actions/katello/content_view/remove.rb +2 -2
- data/app/lib/actions/katello/environment/publish_repositories.rb +41 -0
- data/app/lib/actions/katello/event_queue/poller_thread.rb +10 -8
- data/app/lib/actions/katello/host/attach_subscriptions.rb +1 -1
- data/app/lib/actions/katello/host/remove_subscriptions.rb +1 -1
- data/app/lib/actions/katello/organization/manifest_delete.rb +22 -0
- data/app/lib/actions/katello/organization/manifest_import.rb +22 -0
- data/app/lib/actions/katello/organization/manifest_refresh.rb +22 -0
- data/app/lib/actions/katello/product/create.rb +3 -6
- data/app/lib/actions/katello/product/reindex_subscriptions.rb +3 -4
- data/app/lib/actions/katello/repository/{capsule_generate_and_sync.rb → capsule_sync.rb} +1 -1
- data/app/lib/actions/katello/repository/clone_yum_metadata.rb +2 -1
- data/app/lib/actions/katello/repository/create.rb +2 -1
- data/app/lib/actions/katello/repository/filtered_index_content.rb +2 -0
- data/app/lib/actions/katello/repository/import_upload.rb +38 -6
- data/app/lib/actions/katello/repository/remove_content.rb +1 -1
- data/app/lib/actions/katello/repository/sync.rb +8 -1
- data/app/lib/actions/katello/repository/sync_hook.rb +11 -0
- data/app/lib/actions/katello/repository/update.rb +4 -1
- data/app/lib/actions/katello/sync_plan/add_products.rb +1 -1
- data/app/lib/actions/katello/upstream_subscriptions/bind_entitlement.rb +31 -0
- data/app/lib/actions/katello/upstream_subscriptions/bind_entitlements.rb +28 -0
- data/app/lib/actions/katello/upstream_subscriptions/remove_entitlement.rb +22 -0
- data/app/lib/actions/katello/upstream_subscriptions/remove_entitlements.rb +35 -0
- data/app/lib/actions/katello/upstream_subscriptions/update_entitlement.rb +23 -0
- data/app/lib/actions/katello/upstream_subscriptions/update_entitlements.rb +37 -0
- data/app/lib/actions/middleware/execute_if_contents_changed.rb +1 -1
- data/app/lib/actions/pulp/repository/create.rb +3 -0
- data/app/lib/actions/pulp/repository/ensure_sync_notification.rb +11 -0
- data/app/lib/actions/pulp/repository/import_upload.rb +2 -2
- data/app/lib/katello/resources/candlepin.rb +68 -801
- data/app/lib/katello/resources/candlepin/activation_key.rb +101 -0
- data/app/lib/katello/resources/candlepin/c_p_user.rb +17 -0
- data/app/lib/katello/resources/candlepin/candlepin_ping.rb +19 -0
- data/app/lib/katello/resources/candlepin/consumer.rb +204 -0
- data/app/lib/katello/resources/candlepin/content.rb +36 -0
- data/app/lib/katello/resources/candlepin/entitlement.rb +22 -0
- data/app/lib/katello/resources/candlepin/environment.rb +44 -0
- data/app/lib/katello/resources/candlepin/job.rb +25 -0
- data/app/lib/katello/resources/candlepin/owner.rb +130 -0
- data/app/lib/katello/resources/candlepin/owner_info.rb +18 -0
- data/app/lib/katello/resources/candlepin/pool.rb +39 -0
- data/app/lib/katello/resources/candlepin/product.rb +116 -0
- data/app/lib/katello/resources/candlepin/proxy.rb +41 -0
- data/app/lib/katello/resources/candlepin/subscription.rb +31 -0
- data/app/lib/katello/resources/candlepin/upstream_consumer.rb +41 -0
- data/app/lib/katello/resources/candlepin/upstream_entitlement.rb +19 -0
- data/app/lib/katello/resources/candlepin/upstream_owner.rb +15 -0
- data/app/lib/katello/resources/candlepin/upstream_pool.rb +17 -0
- data/app/lib/katello/util/data.rb +2 -4
- data/app/lib/katello/util/http_proxy.rb +29 -0
- data/app/lib/katello/util/model.rb +1 -1
- data/app/lib/katello/validators/container_image_name_validator.rb +18 -0
- data/app/lib/katello/validators/content_view_environment_org_validator.rb +14 -0
- data/app/lib/katello/validators/environment_docker_repositories_validator.rb +71 -0
- data/app/lib/katello/validators/gpg_key_content_type_validator.rb +22 -0
- data/app/models/katello/activation_key.rb +4 -2
- data/app/models/katello/authorization/content_view_history.rb +0 -1
- data/app/models/katello/authorization/pool.rb +0 -2
- data/app/models/katello/authorization/repository.rb +0 -2
- data/app/models/katello/capsule_lifecycle_environment.rb +2 -0
- data/app/models/katello/compliance_reason.rb +5 -0
- data/app/models/katello/concerns/content_facet_host_extensions.rb +5 -1
- data/app/models/katello/concerns/organization_extensions.rb +22 -0
- data/app/models/katello/concerns/smart_proxy_extensions.rb +3 -2
- data/app/models/katello/concerns/subscription_facet_host_extensions.rb +2 -0
- data/app/models/katello/content.rb +5 -0
- data/app/models/katello/content_facet_applicable_rpm.rb +1 -0
- data/app/models/katello/content_view.rb +50 -82
- data/app/models/katello/content_view_component.rb +1 -0
- data/app/models/katello/content_view_docker_filter_rule.rb +0 -1
- data/app/models/katello/content_view_environment.rb +5 -3
- data/app/models/katello/content_view_filter.rb +2 -1
- data/app/models/katello/content_view_history.rb +3 -0
- data/app/models/katello/content_view_puppet_environment.rb +12 -0
- data/app/models/katello/content_view_puppet_module.rb +1 -0
- data/app/models/katello/content_view_version.rb +18 -1
- data/app/models/katello/docker_manifest.rb +2 -1
- data/app/models/katello/docker_manifest_list.rb +2 -1
- data/app/models/katello/docker_meta_tag.rb +22 -1
- data/app/models/katello/erratum.rb +17 -5
- data/app/models/katello/event.rb +2 -0
- data/app/models/katello/glue/candlepin/activation_key.rb +2 -2
- data/app/models/katello/glue/candlepin/candlepin_object.rb +7 -6
- data/app/models/katello/glue/candlepin/owner.rb +4 -3
- data/app/models/katello/glue/candlepin/pool.rb +51 -20
- data/app/models/katello/glue/candlepin/product.rb +3 -2
- data/app/models/katello/glue/candlepin/subscription.rb +16 -35
- data/app/models/katello/glue/pulp/repo.rb +26 -6
- data/app/models/katello/glue/pulp/repos.rb +6 -3
- data/app/models/katello/gpg_key.rb +29 -4
- data/app/models/katello/host/content_facet.rb +5 -3
- data/app/models/katello/host/subscription_facet.rb +55 -23
- data/app/models/katello/host_collection.rb +1 -0
- data/app/models/katello/host_collection_hosts.rb +1 -1
- data/app/models/katello/installed_package.rb +4 -0
- data/app/models/katello/installed_product.rb +33 -0
- data/app/models/katello/key_host_collection.rb +2 -2
- data/app/models/katello/kt_environment.rb +8 -0
- data/app/models/katello/ostree_branch.rb +1 -1
- data/app/models/katello/ping.rb +1 -0
- data/app/models/katello/pool.rb +13 -7
- data/app/models/katello/pool_product.rb +6 -0
- data/app/models/katello/product.rb +16 -6
- data/app/models/katello/product_content.rb +4 -0
- data/app/models/katello/pulp_task_status.rb +0 -46
- data/app/models/katello/repository.rb +96 -19
- data/app/models/katello/repository_docker_manifest.rb +1 -1
- data/app/models/katello/repository_docker_manifest_list.rb +1 -1
- data/app/models/katello/repository_ostree_branch.rb +1 -1
- data/app/models/katello/rhsm_fact_importer.rb +2 -17
- data/app/models/katello/subscription.rb +5 -5
- data/app/models/katello/subscription_facet_installed_product.rb +6 -0
- data/app/models/katello/subscription_facet_pool.rb +2 -0
- data/app/models/katello/sync_plan.rb +1 -0
- data/app/models/katello/upstream_pool.rb +112 -0
- data/app/models/setting/content.rb +11 -7
- data/app/services/katello/candlepin/consumer.rb +9 -2
- data/app/services/katello/candlepin/message_handler.rb +18 -35
- data/app/services/katello/candlepin/pool_service.rb +17 -0
- data/app/services/katello/event_queue.rb +11 -6
- data/app/services/katello/pulp/server.rb +3 -1
- data/app/services/katello/registration_manager.rb +9 -2
- data/app/services/katello/repository_type_manager.rb +2 -1
- data/app/services/katello/ui_notifications/abstract_notification.rb +29 -0
- data/app/services/katello/ui_notifications/content_view/auto_publish_failure.rb +22 -0
- data/app/services/katello/ui_notifications/pulp/proxy_disk_space.rb +3 -4
- data/app/services/katello/ui_notifications/subscriptions/expire_soon.rb +65 -0
- data/app/services/katello/ui_notifications/subscriptions/manifest_delete_error.rb +13 -0
- data/app/services/katello/ui_notifications/subscriptions/manifest_delete_success.rb +13 -0
- data/app/services/katello/ui_notifications/subscriptions/manifest_import_error.rb +13 -0
- data/app/services/katello/ui_notifications/subscriptions/manifest_import_success.rb +13 -0
- data/app/services/katello/ui_notifications/subscriptions/manifest_refresh_error.rb +13 -0
- data/app/services/katello/ui_notifications/subscriptions/manifest_refresh_success.rb +13 -0
- data/app/services/katello/ui_notifications/task_notification.rb +26 -0
- data/app/views/foreman/job_templates/install_errata.erb +7 -2
- data/app/views/foreman/job_templates/install_errata_-_katello_ansible_default.erb +18 -0
- data/app/views/foreman/job_templates/install_group_-_katello_ansible_default.erb +16 -0
- data/app/views/foreman/job_templates/install_package_-_katello_ansible_default.erb +16 -0
- data/app/views/foreman/job_templates/remove_group_-_katello_ansible_default.erb +16 -0
- data/app/views/foreman/job_templates/remove_package_-_katello_ansible_default.erb +16 -0
- data/app/views/foreman/job_templates/restart_services_-_katello_ansible_default.erb +20 -0
- data/app/views/foreman/job_templates/update_group_-_katello_ansible_default.erb +16 -0
- data/app/views/foreman/job_templates/update_package_-_katello_ansible_default.erb +16 -0
- data/app/views/foreman/smart_proxies/_content_tab.html.erb +1 -1
- data/app/views/katello/api/v2/content_credentials/index.json.rabl +3 -0
- data/app/views/katello/api/v2/content_credentials/show.json.rabl +101 -0
- data/app/views/katello/api/v2/content_view_histories/show.json.rabl +13 -1
- data/app/views/katello/api/v2/content_views/base.json.rabl +1 -0
- data/app/views/katello/api/v2/environments/show.json.rabl +1 -0
- data/app/views/katello/api/v2/errata/{available_errata.rabl → available_errata.json.rabl} +0 -0
- data/app/views/katello/api/v2/errata/show.json.rabl +4 -0
- data/app/views/katello/api/v2/products/_product_content.json.rabl +6 -6
- data/app/views/katello/api/v2/products/base.json.rabl +3 -0
- data/app/views/katello/api/v2/products/show.json.rabl +12 -0
- data/app/views/katello/api/v2/repositories/base.json.rabl +2 -1
- data/app/views/katello/api/v2/repositories/show.json.rabl +19 -5
- data/app/views/katello/api/v2/subscription_facet/show.json.rabl +10 -14
- data/app/views/katello/api/v2/subscriptions/base.json.rabl +2 -1
- data/app/views/katello/api/v2/upstream_subscriptions/base.json.rabl +18 -0
- data/app/views/katello/api/v2/upstream_subscriptions/index.json.rabl +7 -0
- data/app/views/katello/sync_management/_products.html.erb +1 -1
- data/config/katello.yaml.example +10 -0
- data/config/routes.rb +3 -14
- data/config/routes/api/rhsm.rb +1 -0
- data/config/routes/api/v2.rb +16 -0
- data/db/migrate/20161014133811_move_content_view_version_description_to_histories.rb +2 -1
- data/db/migrate/20161214151548_move_content_source_id_to_content_facets.rb +2 -2
- data/db/migrate/20171110082124_add_ssl_certs_to_products_and_repos.rb +42 -0
- data/db/migrate/20171214050230_add_auto_publish_to_content_views.rb +5 -0
- data/db/migrate/20180117202932_sub_facet_add_installed_products.rb +20 -0
- data/db/migrate/20180119152210_add_compliance_reasons.rb +11 -0
- data/db/migrate/20180207232901_add_triggered_by_to_content_view_history.rb +7 -0
- data/db/migrate/20180218191449_add_manifest_refreshed_at_to_organization.rb +9 -0
- data/db/migrate/20180227094827_use_uuid_for_task_id.rb +26 -0
- data/db/migrate/20180323175122_add_registry_name_pattern_to_environment.rb +11 -0
- data/db/migrate/20180326145716_subscription_cp_id_change.rb +10 -0
- data/db/migrate/20180326150339_move_stacking_id.rb +25 -0
- data/db/migrate/20180326190408_move_subscription_products.rb +75 -0
- data/db/migrate/20180402160223_clean_up_force_post_sync_action_setting.rb +5 -0
- data/db/migrate/20180410140909_add_organization_id_to_pool.rb +15 -0
- data/db/migrate/20180413153126_content_facet_applicable_rpms_index.rb +5 -0
- data/db/migrate/20180417031215_add_ignorable_content_to_repository.rb +5 -0
- data/db/migrate/20180521200848_drop_repo_rpms_timestamp_not_null.rb +18 -0
- data/db/seeds.d/109-katello-notification-blueprints.rb +42 -0
- data/db/seeds.d/110-content-view-autopublish.rb +15 -0
- data/db/seeds.d/75-job_templates.rb +3 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-add-subscriptions.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-details-info.controller.js +34 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-subscriptions.controller.js +1 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-info.html +3 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/bastion-katello-bootstrap.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/bastion_katello.js +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/common/views/subscription-add-or-remove.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/content-credential.factory.js +83 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/{gpg-keys/gpg-keys.controller.js → content-credentials/content-credentials.controller.js} +8 -8
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/{gpg-keys/gpg-keys.module.js → content-credentials/content-credentials.module.js} +3 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/content-credentials.routes.js +76 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/content-type.filter.js +25 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/{gpg-keys/details/gpg-key-details-info.controller.js → content-credentials/details/content-credential-details-info.controller.js} +10 -10
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-details.controller.js +48 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-products.controller.js +36 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-repositories.controller.js +36 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/views/content-credential-details.html +36 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/{gpg-keys/details/views/gpg-key-info.html → content-credentials/details/views/content-credential-info.html} +21 -12
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/{gpg-keys/details/views/gpg-key-products.html → content-credentials/details/views/content-credential-products.html} +6 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/{gpg-keys/details/views/gpg-key-repositories.html → content-credentials/details/views/content-credential-repositories.html} +6 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/new/new-content-credential.controller.js +39 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/new/views/new-content-credential.html +53 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/views/content-credentials.html +55 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-errata-modal.controller.js +31 -19
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-host-collections-modal.controller.js +0 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-packages-modal.controller.js +4 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-environment-modal.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-errata-modal.html +108 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-host-collections-modal.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-packages-modal.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-subscriptions-modal.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-errata.controller.js +3 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-errata.html +9 -9
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-packages-applicable.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-packages-installed.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-add-subscriptions.controller.js +1 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-subscriptions.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-details.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-info.html +4 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-repository-sets.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/register.html +14 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/components/content-view-composite-available-content-views.controller.js +7 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-available-deb-repositories.controller.js +4 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-available-docker-repositories.controller.js +5 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-available-file-repositories.controller.js +4 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-available-ostree-repositories.controller.js +5 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-available-repositories.controller.js +4 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-deb-repositories-list.controller.js +4 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-details.controller.js +4 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-docker-repositories-list.controller.js +4 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-file-repositories-list.controller.js +4 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-ostree-repositories-list.controller.js +4 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-repositories-list.controller.js +4 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-versions.controller.js +5 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/date-type-errata-filter.controller.js +8 -9
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-helper.service.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/new-filter.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/date-type-errata.html +6 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/docker-filter.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/new-filter.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/histories/content-view-history.controller.js +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/puppet-modules/content-view-puppet-modules.controller.js +5 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-details.html +8 -7
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-docker-repositories.html +3 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-info.html +14 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-versions.html +12 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/views/content-view-new.html +16 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/content-view-version-content.controller.js +2 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-errata.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-tags/details/views/docker-tag-details.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-tags/details/views/docker-tag-environments.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-tags/details/views/docker-tag-info.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-tags/docker-tags.routes.js +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-tags/views/docker-tags.html +4 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/content.service.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/environment.controller.js +3 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment-details.html +8 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment-docker.html +9 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment-errata.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment.html +2 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/views/environments.html +18 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/erratum-content-hosts.controller.js +22 -8
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/erratum-repositories.controller.js +18 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/views/erratum-content-hosts.html +3 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/views/erratum-repositories.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/incremental-update.service.js +3 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/views/apply-errata-confirm.html +17 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/views/errata.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/README +4 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/bastion_katello.pot +3465 -1541
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/translations.js +10 -10
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/katello-features.run.js +5 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/fenced-pages.service.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/details/ostree-branch-repositories.controller.js +18 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/details/views/ostree-branch-repositories.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/package-repositories.controller.js +18 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/views/package-info.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/views/package-repositories.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/views/package.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/packages.routes.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/views/packages.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/product-details-info.controller.js +32 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.controller.js +34 -13
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.filter.js +16 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-manage-content.controller.js +15 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +42 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-debs.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-docker-manifest-lists.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-docker-manifests.html +7 -7
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-docker-tags.html +47 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-files.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-packages.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/new-repository.controller.js +10 -8
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/views/new-repository.html +43 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/repositories.routes.js +11 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/repository-types.service.js +39 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/views/product-repositories.html +6 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/yum-content-units.service.js +24 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/views/product-info.html +24 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/discovery/discovery-create.controller.js +7 -7
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/discovery/discovery.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/discovery/views/discovery-create.html +3 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/new/product-form.controller.js +7 -7
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/new/views/product-new-form.html +29 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/products.controller.js +9 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/products.module.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/views/products.html +2 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/subscription-details.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/manifest-import.controller.js +12 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/views/manifest-delete-modal.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/views/manifest-import.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/task.factory.js +4 -7
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/tasks-nutupane.factory.js +6 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/tasks-table.directive.js +6 -3
- data/engines/bastion_katello/lib/bastion_katello/engine.rb +1 -1
- data/lib/katello/apipie/validators.rb +0 -56
- data/lib/katello/engine.rb +6 -43
- data/lib/katello/permission_creator.rb +31 -4
- data/lib/katello/plugin.rb +124 -73
- data/lib/katello/scheduled_jobs.rb +10 -4
- data/lib/katello/tasks/job_templates.rake +16 -0
- data/lib/katello/tasks/reset.rake +0 -3
- data/lib/katello/tasks/upgrades/3.6/import_backend_consumer_attributes.rake +32 -0
- data/lib/katello/tasks/upgrades/3.7/make_all_ks_repos_bootable.rake +11 -0
- data/lib/katello/version.rb +1 -1
- data/locale/action_names.rb +52 -48
- data/locale/katello.pot +3136 -1999
- data/package.json +83 -0
- data/webpack/__mocks__/foremanReact/common/helpers.js +5 -0
- data/webpack/__mocks__/foremanReact/components/common/table.js +6 -0
- data/webpack/__mocks__/react-bootstrap-tooltip-button.js +6 -0
- data/webpack/components/MultiSelect/index.js +35 -0
- data/webpack/components/PaginationRow/PaginationRow.test.js +25 -0
- data/webpack/components/PaginationRow/__snapshots__/PaginationRow.test.js.snap +35 -0
- data/webpack/components/PaginationRow/index.js +90 -0
- data/webpack/components/Search/Search.test.js +20 -0
- data/webpack/components/Search/__snapshots__/Search.test.js.snap +18 -0
- data/webpack/components/Search/helpers.js +6 -0
- data/webpack/components/Search/index.js +86 -0
- data/webpack/containers/Application/Routes.js +11 -0
- data/webpack/containers/Application/config.js +21 -0
- data/webpack/containers/Application/index.js +39 -0
- data/webpack/containers/Application/overrides.scss +38 -0
- data/webpack/index.js +18 -0
- data/webpack/mockRequest.js +32 -0
- data/webpack/move_to_foreman/Settings/SettingsActions.js +28 -0
- data/webpack/move_to_foreman/Settings/SettingsConstants.js +3 -0
- data/webpack/move_to_foreman/Settings/__tests__/SettingsActions.test.js +41 -0
- data/webpack/move_to_foreman/Settings/__tests__/settings.fixtures.js +34 -0
- data/webpack/move_to_foreman/__mocks__/foreman_toast_notifications.js +3 -0
- data/webpack/move_to_foreman/common/helpers.js +36 -0
- data/webpack/move_to_foreman/components/common/ConfirmDialog/ConfirmDialog.js +50 -0
- data/webpack/move_to_foreman/components/common/ConfirmDialog/__tests__/ConfirmDialog.test.js +40 -0
- data/webpack/move_to_foreman/components/common/ConfirmDialog/__tests__/__snapshots__/ConfirmDialog.test.js.snap +125 -0
- data/webpack/move_to_foreman/components/common/ConfirmDialog/index.js +3 -0
- data/webpack/move_to_foreman/components/common/Dialog/Dialog.js +65 -0
- data/webpack/move_to_foreman/components/common/Dialog/__tests__/Dialog.test.js +61 -0
- data/webpack/move_to_foreman/components/common/Dialog/__tests__/__snapshots__/Dialog.test.js.snap +349 -0
- data/webpack/move_to_foreman/components/common/Dialog/index.js +3 -0
- data/webpack/move_to_foreman/components/common/ModalProgressBar/ModalProgressBar.js +43 -0
- data/webpack/move_to_foreman/components/common/ModalProgressBar/ModalProgressBar.scss +15 -0
- data/webpack/move_to_foreman/components/common/ModalProgressBar/__tests__/ModalProgressBar.test.js +22 -0
- data/webpack/move_to_foreman/components/common/ModalProgressBar/__tests__/__snapshots__/ModalProgressBar.test.js.snap +60 -0
- data/webpack/move_to_foreman/components/common/ModalProgressBar/index.js +4 -0
- data/webpack/move_to_foreman/components/common/emptyState/index.js +49 -0
- data/webpack/move_to_foreman/components/common/table/index.js +88 -0
- data/webpack/move_to_foreman/foreman_toast_notifications.js +22 -0
- data/webpack/move_to_pf/TypeAhead/TypeAhead.js +125 -0
- data/webpack/move_to_pf/TypeAhead/TypeAhead.scss +7 -0
- data/webpack/move_to_pf/TypeAhead/TypeAheadInput.js +47 -0
- data/webpack/move_to_pf/TypeAhead/TypeAheadItems.js +60 -0
- data/webpack/move_to_pf/TypeAhead/helpers.js +5 -0
- data/webpack/move_to_pf/react-bootstrap-select/index.js +65 -0
- data/webpack/redux/actions/RedHatRepositories/enabled.js +53 -0
- data/webpack/redux/actions/RedHatRepositories/helpers.js +38 -0
- data/webpack/redux/actions/RedHatRepositories/repositorySetRepositories.js +50 -0
- data/webpack/redux/actions/RedHatRepositories/sets.js +42 -0
- data/webpack/redux/consts.js +18 -0
- data/webpack/redux/index.js +9 -0
- data/webpack/redux/reducers/RedHatRepositories/enabled.fixtures.js +149 -0
- data/webpack/redux/reducers/RedHatRepositories/enabled.js +80 -0
- data/webpack/redux/reducers/RedHatRepositories/enabled.test.js +36 -0
- data/webpack/redux/reducers/RedHatRepositories/filters.fixtures.js +5 -0
- data/webpack/redux/reducers/RedHatRepositories/index.js +10 -0
- data/webpack/redux/reducers/RedHatRepositories/repositorySetRepositories.fixtures.js +135 -0
- data/webpack/redux/reducers/RedHatRepositories/repositorySetRepositories.js +97 -0
- data/webpack/redux/reducers/RedHatRepositories/repositorySetRepositories.test.js +66 -0
- data/webpack/redux/reducers/RedHatRepositories/sets.fixtures.js +123 -0
- data/webpack/redux/reducers/RedHatRepositories/sets.js +41 -0
- data/webpack/redux/reducers/RedHatRepositories/sets.test.js +36 -0
- data/webpack/redux/reducers/index.js +14 -0
- data/webpack/scenes/Organizations/OrganizationActions.js +60 -0
- data/webpack/scenes/Organizations/OrganizationConstants.js +7 -0
- data/webpack/scenes/Organizations/OrganizationReducer.js +32 -0
- data/webpack/scenes/Organizations/__tests__/OrganizationActions.test.js +59 -0
- data/webpack/scenes/Organizations/__tests__/OrganizationReducer.test.js +56 -0
- data/webpack/scenes/Organizations/__tests__/organizations.fixtures.js +99 -0
- data/webpack/scenes/RedHatRepositories/components/EnabledRepository.js +114 -0
- data/webpack/scenes/RedHatRepositories/components/EnabledRepository.stories.js +13 -0
- data/webpack/scenes/RedHatRepositories/components/RepositorySet.js +35 -0
- data/webpack/scenes/RedHatRepositories/components/RepositorySetRepositories.js +64 -0
- data/webpack/scenes/RedHatRepositories/components/RepositorySetRepository.js +127 -0
- data/webpack/scenes/RedHatRepositories/components/RepositoryTypeIcon.js +33 -0
- data/webpack/scenes/RedHatRepositories/components/Search.js +91 -0
- data/webpack/scenes/RedHatRepositories/components/SearchBar.js +145 -0
- data/webpack/scenes/RedHatRepositories/components/__tests__/RepositoryTypeIcon.test.js +28 -0
- data/webpack/scenes/RedHatRepositories/components/__tests__/__snapshots__/RepositoryTypeIcon.test.js.snap +143 -0
- data/webpack/scenes/RedHatRepositories/helpers.js +72 -0
- data/webpack/scenes/RedHatRepositories/index.js +91 -0
- data/webpack/scenes/RedHatRepositories/index.scss +63 -0
- data/webpack/scenes/Subscriptions/EntitlementsInlineEditFormatter.js +87 -0
- data/webpack/scenes/Subscriptions/Manifest/DeleteManifestModalText.js +22 -0
- data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +243 -0
- data/webpack/scenes/Subscriptions/Manifest/Manifest.scss +3 -0
- data/webpack/scenes/Subscriptions/Manifest/ManifestActions.js +114 -0
- data/webpack/scenes/Subscriptions/Manifest/ManifestConstants.js +15 -0
- data/webpack/scenes/Subscriptions/Manifest/ManifestHistoryReducer.js +34 -0
- data/webpack/scenes/Subscriptions/Manifest/ManifestHistoryTableSchema.js +46 -0
- data/webpack/scenes/Subscriptions/Manifest/__tests__/ManageManifestModal.test.js +26 -0
- data/webpack/scenes/Subscriptions/Manifest/__tests__/ManifestActions.test.js +113 -0
- data/webpack/scenes/Subscriptions/Manifest/__tests__/ManifestHistoryReducer.test.js +36 -0
- data/webpack/scenes/Subscriptions/Manifest/__tests__/__snapshots__/ManageManifestModal.test.js.snap +363 -0
- data/webpack/scenes/Subscriptions/Manifest/__tests__/manifest.fixtures.js +216 -0
- data/webpack/scenes/Subscriptions/Manifest/index.js +28 -0
- data/webpack/scenes/Subscriptions/SubscriptionActions.js +119 -0
- data/webpack/scenes/Subscriptions/SubscriptionConstants.js +27 -0
- data/webpack/scenes/Subscriptions/SubscriptionHelpers.js +3 -0
- data/webpack/scenes/Subscriptions/SubscriptionReducer.js +123 -0
- data/webpack/scenes/Subscriptions/SubscriptionValidations.js +25 -0
- data/webpack/scenes/Subscriptions/Subscriptions.scss +14 -0
- data/webpack/scenes/Subscriptions/SubscriptionsPage.js +275 -0
- data/webpack/scenes/Subscriptions/SubscriptionsTable.js +336 -0
- data/webpack/scenes/Subscriptions/SubscriptionsTableSchema.js +117 -0
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsActions.js +61 -0
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsContstants.js +7 -0
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsPage.js +246 -0
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsReducer.js +59 -0
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsTableSchema.js +120 -0
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/UpstreamSubscriptionsActions.test.js +64 -0
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/UpstreamSubscriptionsPage.test.js +22 -0
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/UpstreamSubscriptionsReducer.test.js +57 -0
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/__snapshots__/UpstreamSubscriptionsPage.test.js.snap +226 -0
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/upstreamSubscriptions.fixtures.js +162 -0
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/index.js +20 -0
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionValidations.test.js +66 -0
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionsActions.test.js +126 -0
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionsPage.test.js +26 -0
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionsReducer.test.js +67 -0
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionsTable.test.js +47 -0
- data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsPage.test.js.snap +198 -0
- data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsTable.test.js.snap +419 -0
- data/webpack/scenes/Subscriptions/__tests__/subscriptions.fixtures.js +364 -0
- data/webpack/scenes/Subscriptions/index.js +27 -0
- data/webpack/scenes/Tasks/TaskActions.js +75 -0
- data/webpack/scenes/Tasks/TaskConstants.js +7 -0
- data/webpack/scenes/Tasks/__tests__/TaskActions.test.js +81 -0
- data/webpack/scenes/Tasks/__tests__/task.fixtures.js +123 -0
- data/webpack/services/api/fixtures.js +353 -0
- data/webpack/services/api/index.js +105 -0
- data/webpack/services/api/setupMocks.js +17 -0
- data/webpack/services/index.js +59 -0
- data/webpack/stories/index.js +12 -0
- data/webpack/test_setup.js +9 -0
- metadata +265 -61
- data/app/assets/javascripts/katello/providers/provider_redhat.js +0 -185
- data/app/assets/javascripts/katello/providers/redhat/index.js +0 -3
- data/app/controllers/katello/products_controller.rb +0 -106
- data/app/controllers/katello/providers_controller.rb +0 -64
- data/app/helpers/katello/providers_helper.rb +0 -93
- data/app/models/katello/subscription_product.rb +0 -6
- data/app/views/foreman/unattended/finish-katello.erb +0 -60
- data/app/views/foreman/unattended/kickstart-katello-atomic.erb +0 -51
- data/app/views/foreman/unattended/kickstart-katello.erb +0 -139
- data/app/views/foreman/unattended/snippets/_subscription_manager_registration.erb +0 -18
- data/app/views/foreman/unattended/userdata-katello.erb +0 -92
- data/app/views/katello/providers/redhat/_enable_errors.html.erb +0 -12
- data/app/views/katello/providers/redhat/_errors.html.erb +0 -19
- data/app/views/katello/providers/redhat/_repo_sets.html.erb +0 -56
- data/app/views/katello/providers/redhat/_repos.html.erb +0 -60
- data/app/views/katello/providers/redhat/_tab.html.erb +0 -9
- data/app/views/katello/providers/redhat/show.html.erb +0 -35
- data/db/seeds.d/103-provisioning_templates.rb +0 -42
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/errata-content-hosts.html +0 -28
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/errata-details.html +0 -59
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-details.controller.js +0 -48
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-products.controller.js +0 -36
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-repositories.controller.js +0 -36
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/views/gpg-key-details.html +0 -36
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/gpg-key.factory.js +0 -43
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/gpg-keys.routes.js +0 -76
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/new/new-gpg-key.controller.js +0 -39
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/new/views/new-gpg-key.html +0 -44
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/views/gpg-keys.html +0 -46
@@ -1,5 +1,6 @@
|
|
1
1
|
module Katello
|
2
2
|
class ContentViewComponent < Katello::Model
|
3
|
+
audited :associated_with => :composite_content_view
|
3
4
|
belongs_to :composite_content_view, :class_name => "Katello::ContentView",
|
4
5
|
:inverse_of => :content_view_components
|
5
6
|
belongs_to :content_view_version, :class_name => "Katello::ContentViewVersion",
|
@@ -1,5 +1,6 @@
|
|
1
1
|
module Katello
|
2
2
|
class ContentViewEnvironment < Katello::Model
|
3
|
+
audited :associated_with => :content_view
|
3
4
|
include ForemanTasks::Concerns::ActionSubject
|
4
5
|
include Glue::Candlepin::Environment if SETTINGS[:katello][:use_cp]
|
5
6
|
include Glue if SETTINGS[:katello][:use_cp]
|
@@ -8,11 +9,12 @@ module Katello
|
|
8
9
|
belongs_to :content_view, :class_name => "Katello::ContentView", :inverse_of => :content_view_environments
|
9
10
|
belongs_to :environment, :class_name => "Katello::KTEnvironment", :inverse_of => :content_view_environments
|
10
11
|
belongs_to :content_view_version, :class_name => "Katello::ContentViewVersion",
|
11
|
-
|
12
|
+
:inverse_of => :content_view_environments
|
12
13
|
|
13
14
|
validates_lengths_from_database
|
14
15
|
validates :environment_id, uniqueness: {scope: :content_view_id}, presence: true
|
15
16
|
validates :content_view_id, presence: true
|
17
|
+
validates_with Validators::ContentViewEnvironmentOrgValidator
|
16
18
|
|
17
19
|
before_save :generate_info
|
18
20
|
|
@@ -43,10 +45,10 @@ module Katello
|
|
43
45
|
|
44
46
|
if content_view.default?
|
45
47
|
self.label ||= environment.label
|
46
|
-
self.cp_id ||= Katello::Util::Data.
|
48
|
+
self.cp_id ||= Katello::Util::Data.hexdigest(environment.organization.label)
|
47
49
|
else
|
48
50
|
self.label ||= [environment.label, content_view.label].join('/')
|
49
|
-
self.cp_id ||= Katello::Util::Data.
|
51
|
+
self.cp_id ||= Katello::Util::Data.hexdigest([environment.id, content_view.id].join('-'))
|
50
52
|
end
|
51
53
|
end
|
52
54
|
end
|
@@ -1,12 +1,13 @@
|
|
1
1
|
module Katello
|
2
2
|
class ContentViewFilter < Katello::Model
|
3
|
+
audited :associations => [:repositories]
|
3
4
|
DOCKER = 'docker'.freeze
|
4
5
|
RPM = Rpm::CONTENT_TYPE
|
5
6
|
PACKAGE_GROUP = PackageGroup::CONTENT_TYPE
|
6
7
|
ERRATA = Erratum::CONTENT_TYPE
|
7
8
|
DEB = Deb::CONTENT_TYPE
|
8
9
|
CONTENT_TYPES = [RPM, PACKAGE_GROUP, ERRATA, DOCKER, DEB].freeze
|
9
|
-
CONTENT_OPTIONS = { _('Packages') => RPM, _('Package Groups') => PACKAGE_GROUP, _('Errata') => ERRATA, _('
|
10
|
+
CONTENT_OPTIONS = { _('Packages') => RPM, _('Package Groups') => PACKAGE_GROUP, _('Errata') => ERRATA, _('Container Images') => DOCKER, _('deb Packages') => DEB }.freeze
|
10
11
|
|
11
12
|
belongs_to :content_view,
|
12
13
|
:class_name => "Katello::ContentView",
|
@@ -5,6 +5,9 @@ module Katello
|
|
5
5
|
belongs_to :environment, :class_name => "Katello::KTEnvironment", :inverse_of => :content_view_histories,
|
6
6
|
:foreign_key => :katello_environment_id
|
7
7
|
belongs_to :content_view_version, :class_name => "Katello::ContentViewVersion", :foreign_key => :katello_content_view_version_id, :inverse_of => :history
|
8
|
+
|
9
|
+
belongs_to :triggered_by, :class_name => "Katello::ContentViewVersion", :inverse_of => :triggered_histories
|
10
|
+
|
8
11
|
belongs_to :task, :class_name => "ForemanTasks::Task::DynflowTask", :foreign_key => :task_id
|
9
12
|
|
10
13
|
IN_PROGRESS = 'in progress'.freeze
|
@@ -3,6 +3,8 @@ module Katello
|
|
3
3
|
include Authorization::ContentViewVersion
|
4
4
|
include ForemanTasks::Concerns::ActionSubject
|
5
5
|
|
6
|
+
define_model_callbacks :promote, :only => [:before, :after]
|
7
|
+
audited :associations => [:repositories, :environments]
|
6
8
|
before_destroy :validate_destroyable!
|
7
9
|
|
8
10
|
belongs_to :content_view, :class_name => "Katello::ContentView", :inverse_of => :content_view_versions
|
@@ -15,12 +17,17 @@ module Katello
|
|
15
17
|
|
16
18
|
has_many :history, :class_name => "Katello::ContentViewHistory", :inverse_of => :content_view_version,
|
17
19
|
:dependent => :destroy, :foreign_key => :katello_content_view_version_id
|
20
|
+
|
21
|
+
has_many :triggered_histories, :class_name => "Katello::ContentViewHistory", :dependent => :destroy,
|
22
|
+
:inverse_of => :triggered_by, :foreign_key => :triggered_by_id
|
23
|
+
|
18
24
|
has_many :repositories, :class_name => "Katello::Repository", :dependent => :destroy
|
19
25
|
has_many :content_view_puppet_environments, :class_name => "Katello::ContentViewPuppetEnvironment",
|
20
26
|
:dependent => :destroy
|
21
27
|
has_one :task_status, :class_name => "Katello::TaskStatus", :as => :task_owner, :dependent => :destroy
|
22
28
|
|
23
|
-
has_many :content_view_components, :
|
29
|
+
has_many :content_view_components, :class_name => "Katello::ContentViewComponent",
|
30
|
+
:inverse_of => :content_view_version, :dependent => :destroy
|
24
31
|
has_many :composite_content_views, :through => :content_view_components, :source => :composite_content_view
|
25
32
|
|
26
33
|
has_many :content_view_version_components, :inverse_of => :composite_version, :dependent => :destroy, :foreign_key => :composite_version_id,
|
@@ -43,6 +50,11 @@ module Katello
|
|
43
50
|
joins(:content_view).where("#{Katello::ContentView.table_name}.organization_id" => organization_id)
|
44
51
|
end
|
45
52
|
|
53
|
+
scope :triggered_by, ->(content_view_version_id) do
|
54
|
+
sql = Katello::ContentViewHistory.where(:triggered_by_id => content_view_version_id).select(:katello_content_view_version_id).to_sql
|
55
|
+
where("#{Katello::ContentViewVersion.table_name}.id in (#{sql})")
|
56
|
+
end
|
57
|
+
|
46
58
|
scoped_search :on => :content_view_id, :only_explicit => true, :validator => ScopedSearch::Validators::INTEGER
|
47
59
|
scoped_search :on => :major, :rename => :version, :complete_value => true, :ext_method => :find_by_version
|
48
60
|
scoped_search :relation => :repositories, :on => :name, :rename => :repository, :complete_value => true
|
@@ -314,6 +326,7 @@ module Katello
|
|
314
326
|
def check_ready_to_promote!(to_env)
|
315
327
|
fail _("Default content view versions cannot be promoted") if default?
|
316
328
|
content_view.check_composite_action_allowed!(to_env)
|
329
|
+
content_view.check_docker_repository_names!(to_env)
|
317
330
|
end
|
318
331
|
|
319
332
|
def validate_destroyable!(skip_environment_check = false)
|
@@ -348,5 +361,9 @@ module Katello
|
|
348
361
|
def related_resources
|
349
362
|
[self.content_view]
|
350
363
|
end
|
364
|
+
|
365
|
+
class Jail < ::Safemode::Jail
|
366
|
+
allow :name, :label, :version
|
367
|
+
end
|
351
368
|
end
|
352
369
|
end
|
@@ -2,7 +2,8 @@ module Katello
|
|
2
2
|
class DockerManifest < Katello::Model
|
3
3
|
include Concerns::PulpDatabaseUnit
|
4
4
|
has_many :docker_tags, :as => :docker_taggable, :class_name => "Katello::DockerTag", :dependent => :destroy
|
5
|
-
has_many :repository_docker_manifests, :
|
5
|
+
has_many :repository_docker_manifests, :class_name => "Katello::RepositoryDockerManifest",
|
6
|
+
:dependent => :destroy, :inverse_of => :docker_manifest
|
6
7
|
has_many :repositories, :through => :repository_docker_manifests, :inverse_of => :docker_manifests
|
7
8
|
|
8
9
|
has_many :docker_manifest_list_manifests, :class_name => "Katello::DockerManifestListManifest",
|
@@ -3,7 +3,8 @@ module Katello
|
|
3
3
|
include Concerns::PulpDatabaseUnit
|
4
4
|
|
5
5
|
has_many :docker_tags, :as => :docker_taggable, :class_name => "Katello::DockerTag", :dependent => :destroy
|
6
|
-
has_many :repository_docker_manifest_lists, :
|
6
|
+
has_many :repository_docker_manifest_lists, :class_name => "Katello::RepositoryDockerManifestList",
|
7
|
+
:dependent => :destroy, :inverse_of => :docker_manifest_list
|
7
8
|
has_many :repositories, :through => :repository_docker_manifest_lists, :inverse_of => :docker_manifest_lists
|
8
9
|
|
9
10
|
has_many :docker_manifest_list_manifests, :class_name => "Katello::DockerManifestListManifest",
|
@@ -13,7 +13,28 @@ module Katello
|
|
13
13
|
scoped_search :on => :schema_version, :rename => :schema_version, :complete_value => { "1" => "1", "2" => "2"},
|
14
14
|
:only_explicit => true, :ext_method => :find_by_schema_version, :operators => ["="]
|
15
15
|
scoped_search :relation => :repository, :on => :name, :rename => :repository,
|
16
|
-
|
16
|
+
:complete_value => true, :only_explicit => true
|
17
|
+
scoped_search :relation => :repository, :on => :container_repository_name, :rename => :image,
|
18
|
+
:complete_value => true, :only_explicit => true
|
19
|
+
scoped_search :on => :digest, :rename => :digest, :complete_value => false,
|
20
|
+
:only_explicit => true, :ext_method => :find_by_digest, :operators => ["="]
|
21
|
+
|
22
|
+
def self.meta_tags_by_digest_query(operator, digest, manifest_klass)
|
23
|
+
search = "digest #{operator} ?"
|
24
|
+
query = DockerMetaTag.search_in_tags(DockerTag.where(:docker_taggable_type => manifest_klass.name,
|
25
|
+
:docker_taggable_id => manifest_klass.where(search, digest))).select(:id).to_sql
|
26
|
+
"#{DockerMetaTag.table_name}.id in (#{query})"
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.find_by_digest(_key, operator, value)
|
30
|
+
if operator == '='
|
31
|
+
conditions = meta_tags_by_digest_query(operator, value, DockerManifest) + " OR " + meta_tags_by_digest_query(operator, value, DockerManifestList)
|
32
|
+
else
|
33
|
+
#failure condition. No such value so must return 0
|
34
|
+
conditions = "1=0"
|
35
|
+
end
|
36
|
+
{ :conditions => conditions }
|
37
|
+
end
|
17
38
|
|
18
39
|
def self.find_by_schema_version(_key, operator, value)
|
19
40
|
conditions = ""
|
@@ -2,11 +2,11 @@ module Katello
|
|
2
2
|
class Erratum < Katello::Model
|
3
3
|
include Concerns::PulpDatabaseUnit
|
4
4
|
|
5
|
-
SECURITY = "security".freeze
|
6
|
-
BUGZILLA = "bugfix".freeze
|
7
|
-
ENHANCEMENT = "enhancement".freeze
|
5
|
+
SECURITY = ["security"].freeze
|
6
|
+
BUGZILLA = ["bugfix", "recommended"].freeze
|
7
|
+
ENHANCEMENT = ["enhancement", "optional"].freeze
|
8
8
|
|
9
|
-
TYPES = [SECURITY, BUGZILLA, ENHANCEMENT].freeze
|
9
|
+
TYPES = [SECURITY, BUGZILLA, ENHANCEMENT].flatten.freeze
|
10
10
|
CONTENT_TYPE = Pulp::Erratum::CONTENT_TYPE
|
11
11
|
|
12
12
|
has_many :content_facet_errata, :class_name => "Katello::ContentFacetErratum", :dependent => :destroy, :inverse_of => :content_facet
|
@@ -82,7 +82,7 @@ module Katello
|
|
82
82
|
def hosts_available(org_id = nil)
|
83
83
|
self.hosts_applicable(org_id).joins("INNER JOIN #{Katello::RepositoryErratum.table_name} on \
|
84
84
|
#{Katello::RepositoryErratum.table_name}.erratum_id = #{self.id}").joins(:content_facet_repositories).
|
85
|
-
where("#{Katello::ContentFacetRepository.table_name}.repository_id = #{Katello::RepositoryErratum.table_name}.repository_id")
|
85
|
+
where("#{Katello::ContentFacetRepository.table_name}.repository_id = #{Katello::RepositoryErratum.table_name}.repository_id")
|
86
86
|
end
|
87
87
|
|
88
88
|
def self.installable_for_hosts(hosts = nil)
|
@@ -118,6 +118,10 @@ module Katello
|
|
118
118
|
keys = %w(title id severity issued type description reboot_suggested solution updated summary)
|
119
119
|
custom_json = json.slice(*keys)
|
120
120
|
|
121
|
+
# handle SUSE epoch dates
|
122
|
+
custom_json["issued"] = convert_date_if_epoch(custom_json["issued"])
|
123
|
+
custom_json["updated"] = convert_date_if_epoch(custom_json["updated"]) unless custom_json["updated"].blank?
|
124
|
+
|
121
125
|
if self.updated.blank? || (custom_json['updated'].to_datetime != self.updated.to_datetime)
|
122
126
|
custom_json['errata_id'] = custom_json.delete('id')
|
123
127
|
custom_json['errata_type'] = custom_json.delete('type')
|
@@ -145,6 +149,14 @@ module Katello
|
|
145
149
|
|
146
150
|
private
|
147
151
|
|
152
|
+
def convert_date_if_epoch(date)
|
153
|
+
date.to_i.to_s == date ? epoch_to_date(date) : date
|
154
|
+
end
|
155
|
+
|
156
|
+
def epoch_to_date(epoch)
|
157
|
+
Time.at(epoch.to_i).to_s
|
158
|
+
end
|
159
|
+
|
148
160
|
def run_until(needed_function, action_function)
|
149
161
|
needed = needed_function.call
|
150
162
|
retries = needed.length
|
data/app/models/katello/event.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
module Katello
|
2
2
|
class Event < Katello::Model
|
3
3
|
validate :validate_event_type
|
4
|
+
# Note: Do not use active record call backs or dependent references on this class
|
5
|
+
# Direct deletes are made in EventQueue#clear_events (instead of destroys).
|
4
6
|
|
5
7
|
def validate_event_type
|
6
8
|
unless EventQueue.supported_event_types.include?(self.event_type)
|
@@ -49,7 +49,7 @@ module Katello
|
|
49
49
|
def subscribe(pool_id, quantity = 1)
|
50
50
|
pool = Katello::Pool.with_identifier(pool_id)
|
51
51
|
subscription = pool.subscription
|
52
|
-
add_custom_product(subscription.
|
52
|
+
add_custom_product(subscription.cp_id) unless subscription.redhat?
|
53
53
|
Resources::Candlepin::ActivationKey.add_pools self.cp_id, pool.cp_id, quantity
|
54
54
|
self.import_pools
|
55
55
|
end
|
@@ -58,7 +58,7 @@ module Katello
|
|
58
58
|
fail _("Subscription id is nil.") unless pool_id
|
59
59
|
pool = Katello::Pool.with_identifier(pool_id)
|
60
60
|
subscription = pool.subscription
|
61
|
-
remove_custom_product(subscription.
|
61
|
+
remove_custom_product(subscription.cp_id) unless subscription.redhat?
|
62
62
|
Resources::Candlepin::ActivationKey.remove_pools self.cp_id, pool.cp_id
|
63
63
|
self.import_pools
|
64
64
|
end
|
@@ -10,14 +10,15 @@ module Katello
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def get_candlepin_ids(organization)
|
13
|
-
self.get_for_owner(organization).map { |subscription| subscription["id"] }
|
13
|
+
self.get_for_owner(organization.label).map { |subscription| subscription["id"] }
|
14
14
|
end
|
15
15
|
|
16
16
|
def import_candlepin_ids(organization)
|
17
17
|
candlepin_ids = self.get_candlepin_ids(organization)
|
18
18
|
candlepin_ids.each do |cp_id|
|
19
|
-
self.where(:cp_id => cp_id).first_or_create unless cp_id.nil?
|
19
|
+
self.where(:cp_id => cp_id, :organization_id => organization.id).first_or_create unless cp_id.nil?
|
20
20
|
end
|
21
|
+
candlepin_ids
|
21
22
|
end
|
22
23
|
|
23
24
|
def with_identifier(ids)
|
@@ -35,13 +36,13 @@ module Katello
|
|
35
36
|
organizations = organization ? [organization] : Organization.all
|
36
37
|
|
37
38
|
organizations.each do |org|
|
38
|
-
import_candlepin_ids(org
|
39
|
-
candlepin_ids = get_candlepin_ids(org.label)
|
39
|
+
candlepin_ids = import_candlepin_ids(org)
|
40
40
|
|
41
|
-
objects = self.in_organization(org)
|
42
|
-
objects.
|
41
|
+
objects = self.in_organization(org)
|
42
|
+
objects.each do |item|
|
43
43
|
if candlepin_ids.include?(item.cp_id)
|
44
44
|
item.import_data
|
45
|
+
item.import_managed_associations if item.respond_to?(:import_managed_associations)
|
45
46
|
else
|
46
47
|
item.destroy
|
47
48
|
end
|
@@ -21,9 +21,10 @@ module Katello
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def owner_details
|
24
|
-
|
25
|
-
|
26
|
-
|
24
|
+
@owner_details ||= Resources::Candlepin::Owner.find self.label
|
25
|
+
@owner_details['virt_who'] ||= self.subscriptions.using_virt_who.any?
|
26
|
+
|
27
|
+
@owner_details
|
27
28
|
end
|
28
29
|
|
29
30
|
def service_level
|
@@ -9,16 +9,18 @@ module Katello
|
|
9
9
|
lazy_accessor :pool_facts, :initializer => lambda { |_s| self.import_lazy_attributes }
|
10
10
|
lazy_accessor :subscription_facts, :initializer => lambda { |_s| self.subscription ? self.subscription.attributes : {} }
|
11
11
|
|
12
|
-
lazy_accessor :pool_derived, :owner, :source_pool_id, :virt_limit, :arch, :description,
|
13
|
-
:product_family, :variant, :suggested_quantity, :support_type, :product_id, :type,
|
12
|
+
lazy_accessor :pool_derived, :owner, :source_pool_id, :virt_limit, :arch, :description, :upstream_pool_id,
|
13
|
+
:product_family, :variant, :suggested_quantity, :support_type, :product_id, :type, :upstream_entitlement_id,
|
14
14
|
:initializer => :pool_facts
|
15
15
|
|
16
|
-
lazy_accessor :name, :support_level, :org, :sockets, :cores, :
|
16
|
+
lazy_accessor :name, :support_level, :org, :sockets, :cores, :instance_multiplier,
|
17
17
|
:initializer => :subscription_facts
|
18
18
|
|
19
19
|
lazy_accessor :active, :initializer => lambda { |_s| self.pool_facts["activeSubscription"] }
|
20
20
|
|
21
21
|
lazy_accessor :available, :initializer => lambda { |_s| self.quantity_available }
|
22
|
+
|
23
|
+
lazy_accessor :backend_data, :initializer => lambda { |_s| self.class.candlepin_data(self.cp_id) }
|
22
24
|
end
|
23
25
|
end
|
24
26
|
|
@@ -63,9 +65,11 @@ module Katello
|
|
63
65
|
end
|
64
66
|
|
65
67
|
json["product_id"] = json["productId"] if json["productId"]
|
68
|
+
json["upstream_entitlement_id"] = json["upstreamEntitlementId"]
|
69
|
+
json["upstream_pool_id"] = json["upstreamPoolId"]
|
66
70
|
|
67
71
|
if self.subscription
|
68
|
-
subscription.backend_data["
|
72
|
+
subscription.backend_data["attributes"].map { |attr| json[attr["name"].underscore.to_sym] = attr["value"] }
|
69
73
|
end
|
70
74
|
json
|
71
75
|
end
|
@@ -77,24 +81,22 @@ module Katello
|
|
77
81
|
providers.any?
|
78
82
|
end
|
79
83
|
|
80
|
-
def backend_data
|
81
|
-
self.class.candlepin_data(self.cp_id)
|
82
|
-
end
|
83
|
-
|
84
84
|
def stacking_subscription(org_label, stacking_id)
|
85
85
|
org = Organization.find_by(:label => org_label)
|
86
86
|
subscription = ::Katello::Subscription.find_by(:organization_id => org.id, :product_id => stacking_id)
|
87
87
|
if subscription.nil?
|
88
88
|
found_product = ::Katello::Resources::Candlepin::Product.find_for_stacking_id(org_label, stacking_id)
|
89
|
-
subscription = ::Katello::Subscription.find_by(:organization_id => org.id, :
|
89
|
+
subscription = ::Katello::Subscription.find_by(:organization_id => org.id, :cp_id => found_product['id']) if found_product
|
90
90
|
end
|
91
91
|
subscription
|
92
92
|
end
|
93
93
|
|
94
94
|
# rubocop:disable MethodLength
|
95
|
-
def import_data(index_hosts =
|
95
|
+
def import_data(index_hosts = false)
|
96
96
|
pool_attributes = {}.with_indifferent_access
|
97
97
|
pool_json = self.backend_data
|
98
|
+
|
99
|
+
self.organization ||= Organization.find_by(:label => pool_json['owner']['key'])
|
98
100
|
product_attributes = pool_json["productAttributes"] + pool_json["attributes"]
|
99
101
|
|
100
102
|
product_attributes.map { |attr| pool_attributes[attr["name"].underscore.to_sym] = attr["value"] }
|
@@ -102,7 +104,7 @@ module Katello
|
|
102
104
|
if pool_json["sourceStackId"]
|
103
105
|
subscription = stacking_subscription(pool_json['owner']['key'], pool_json["sourceStackId"])
|
104
106
|
else
|
105
|
-
subscription = ::Katello::Subscription.find_by(:cp_id => pool_json["
|
107
|
+
subscription = ::Katello::Subscription.find_by(:cp_id => pool_json["productId"])
|
106
108
|
end
|
107
109
|
|
108
110
|
pool_attributes[:subscription_id] = subscription.id if subscription
|
@@ -135,24 +137,52 @@ module Katello
|
|
135
137
|
pool_attributes[:virt_who] = false
|
136
138
|
end
|
137
139
|
|
140
|
+
pool_attributes['stack_id'] = pool_json['stackId']
|
138
141
|
exceptions = pool_attributes.keys.map(&:to_sym) - self.attribute_names.map(&:to_sym)
|
139
142
|
self.update_attributes(pool_attributes.except!(*exceptions))
|
140
143
|
self.save!
|
141
144
|
self.create_activation_key_associations
|
145
|
+
self.create_product_associations
|
142
146
|
self.import_hosts if index_hosts
|
143
147
|
end
|
144
148
|
|
149
|
+
def create_product_associations
|
150
|
+
products = self.backend_data["providedProducts"] + self.backend_data["derivedProvidedProducts"]
|
151
|
+
cp_product_ids = products.map { |product| product["productId"] }
|
152
|
+
cp_product_ids << self.subscription.cp_id if self.subscription
|
153
|
+
|
154
|
+
cp_product_ids.each do |cp_id|
|
155
|
+
product = ::Katello::Product.where(:cp_id => cp_id, :organization_id => self.organization.id)
|
156
|
+
if product.any?
|
157
|
+
::Katello::Util::Support.active_record_retry do
|
158
|
+
::Katello::PoolProduct.where(:pool_id => self.id, :product_id => product.first.id).first_or_create
|
159
|
+
end
|
160
|
+
end
|
161
|
+
end
|
162
|
+
end
|
163
|
+
|
145
164
|
def import_hosts
|
146
165
|
entitlements = Resources::Candlepin::Pool.entitlements(self.cp_id, ["consumer.uuid"])
|
147
166
|
uuids = entitlements.map { |ent| ent["consumer"]["uuid"] }
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
167
|
+
|
168
|
+
sub_facet_ids_from_cp = Katello::Host::SubscriptionFacet.where(:uuid => uuids).select(:id).pluck(:id)
|
169
|
+
sub_facet_ids_from_pool_table = Katello::SubscriptionFacetPool.where(:pool_id => self.id).select(:subscription_facet_id).pluck(:subscription_facet_id)
|
170
|
+
entries_to_add = sub_facet_ids_from_cp - sub_facet_ids_from_pool_table
|
171
|
+
unless entries_to_add.empty?
|
172
|
+
ActiveRecord::Base.transaction do
|
173
|
+
entries_to_add.each do |sub_facet_id|
|
174
|
+
query = "INSERT INTO #{Katello::SubscriptionFacetPool.table_name} (pool_id, subscription_facet_id) VALUES (#{self.id}, #{sub_facet_id})"
|
175
|
+
ActiveRecord::Base.connection.execute(query)
|
176
|
+
end
|
177
|
+
end
|
178
|
+
end
|
179
|
+
|
180
|
+
entries_to_remove = sub_facet_ids_from_pool_table - sub_facet_ids_from_cp
|
181
|
+
Katello::SubscriptionFacetPool.where(:pool_id => self.id, :subscription_facet_id => entries_to_remove).delete_all
|
182
|
+
end
|
183
|
+
|
184
|
+
def import_managed_associations
|
185
|
+
import_hosts
|
156
186
|
end
|
157
187
|
|
158
188
|
def hosts
|
@@ -171,7 +201,8 @@ module Katello
|
|
171
201
|
end
|
172
202
|
|
173
203
|
def hypervisor
|
174
|
-
::Host.find_by(id: self.hypervisor_id) if self.hypervisor_id
|
204
|
+
host = ::Host.unscoped.find_by(id: self.hypervisor_id) if self.hypervisor_id
|
205
|
+
return host if (host && host.authorized?(:view_hosts))
|
175
206
|
end
|
176
207
|
end
|
177
208
|
end
|