katello 3.5.0.rc1 → 3.5.0.rc2
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/containers/container.js +6 -6
- data/app/assets/javascripts/katello/hosts/host_and_hostgroup_edit.js +2 -1
- data/app/assets/javascripts/katello/sync_management/sync_management.js +8 -6
- data/app/controllers/katello/api/v2/activation_keys_controller.rb +23 -16
- data/app/controllers/katello/api/v2/api_controller.rb +7 -2
- data/app/controllers/katello/api/v2/capsule_content_controller.rb +10 -2
- data/app/controllers/katello/api/v2/content_uploads_controller.rb +5 -5
- data/app/controllers/katello/api/v2/content_view_components_controller.rb +9 -9
- data/app/controllers/katello/api/v2/content_view_filter_rules_controller.rb +14 -16
- data/app/controllers/katello/api/v2/content_view_filters_controller.rb +8 -8
- data/app/controllers/katello/api/v2/content_view_puppet_modules_controller.rb +7 -7
- data/app/controllers/katello/api/v2/content_view_versions_controller.rb +12 -12
- data/app/controllers/katello/api/v2/content_views_controller.rb +5 -5
- data/app/controllers/katello/api/v2/errata_controller.rb +2 -2
- data/app/controllers/katello/api/v2/gpg_keys_controller.rb +2 -2
- data/app/controllers/katello/api/v2/host_collections_controller.rb +7 -7
- data/app/controllers/katello/api/v2/host_errata_controller.rb +4 -4
- data/app/controllers/katello/api/v2/host_packages_controller.rb +5 -5
- data/app/controllers/katello/api/v2/host_subscriptions_controller.rb +9 -4
- data/app/controllers/katello/api/v2/host_tracer_controller.rb +1 -1
- data/app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb +9 -1
- data/app/controllers/katello/api/v2/organizations_controller.rb +17 -3
- data/app/controllers/katello/api/v2/packages_controller.rb +2 -2
- data/app/controllers/katello/api/v2/products_controller.rb +3 -3
- data/app/controllers/katello/api/v2/repositories_controller.rb +11 -11
- data/app/controllers/katello/api/v2/repository_sets_controller.rb +1 -10
- data/app/controllers/katello/concerns/api/v2/hosts_controller_extensions.rb +1 -1
- data/app/controllers/katello/concerns/api/v2/repository_content_controller.rb +3 -3
- data/app/helpers/katello/providers_helper.rb +4 -1
- data/app/lib/actions/candlepin/abstract.rb +1 -0
- data/app/lib/actions/katello/host/hypervisors_update.rb +1 -0
- data/app/lib/actions/katello/host/update_release_version.rb +29 -0
- data/app/lib/actions/katello/product/create.rb +3 -6
- data/app/lib/actions/katello/product/reindex_subscriptions.rb +1 -1
- data/app/lib/actions/katello/repository/scheduled_sync.rb +15 -0
- data/app/lib/actions/katello/repository/upload_files.rb +4 -0
- data/app/lib/actions/middleware/keep_session_id.rb +29 -0
- data/app/lib/katello/resources/candlepin.rb +22 -5
- data/app/lib/katello/validators/hostgroup_kickstart_repository_validator.rb +30 -0
- data/app/models/katello/activation_key.rb +3 -33
- data/app/models/katello/candlepin/product_content.rb +1 -14
- data/app/models/katello/concerns/content_facet_host_extensions.rb +5 -1
- data/app/models/katello/concerns/content_view_filter_rule_common.rb +13 -0
- data/app/models/katello/concerns/hostgroup_extensions.rb +1 -0
- data/app/models/katello/concerns/subscription_facet_host_extensions.rb +2 -1
- data/app/models/katello/content_view_docker_filter_rule.rb +2 -1
- data/app/models/katello/content_view_erratum_filter_rule.rb +2 -1
- data/app/models/katello/content_view_package_filter_rule.rb +2 -1
- data/app/models/katello/content_view_package_group_filter_rule.rb +2 -1
- data/app/models/katello/erratum.rb +4 -5
- data/app/models/katello/glue/candlepin/owner.rb +32 -0
- data/app/models/katello/glue/pulp/repos.rb +1 -1
- data/app/models/katello/host/subscription_facet.rb +16 -0
- data/app/models/katello/repository.rb +2 -2
- data/app/models/katello/subscription.rb +4 -1
- data/app/models/katello/subscription_status.rb +8 -4
- data/app/presenters/katello/product_content_presenter.rb +7 -2
- data/app/services/katello/candlepin/consumer.rb +0 -28
- data/app/services/katello/product_content_finder.rb +37 -0
- data/app/views/foreman/smart_proxies/_content_sync.html.erb +0 -2
- data/app/views/katello/api/v2/activation_keys/base.json.rabl +34 -0
- data/app/views/katello/api/v2/activation_keys/index.json.rabl +4 -1
- data/app/views/katello/api/v2/activation_keys/product_content.json.rabl +3 -3
- data/app/views/katello/api/v2/activation_keys/show.json.rabl +2 -38
- data/app/views/katello/api/v2/common/releases.json.rabl +7 -0
- data/config/routes/api/v2.rb +1 -0
- data/config/routes/overrides.rb +1 -0
- data/db/migrate/20171010170443_add_index_to_katello_content_facet_errata.rb +5 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/activation-key.factory.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-add-host-collections.controller.js +8 -8
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-add-subscriptions.controller.js +5 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-copy.controller.js +3 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-details.controller.js +7 -10
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-host-collections.controller.js +7 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-repository-sets.controller.js +5 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-subscriptions.controller.js +5 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-host-collections-table.html +1 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/capsule-content/capsule-content.controller.js +7 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/capsule-content/capsule-content.factory.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/capsules/capsule.factory.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/common/api-error-handler.service.js +6 -16
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-environment-modal.controller.js +4 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-errata-modal.controller.js +5 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-host-collections-modal.controller.js +5 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-packages-modal.controller.js +5 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-release-version-modal.controller.js +62 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-repository-sets-modal.controller.js +4 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-subscriptions-modal.controller.js +4 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-release-version-modal.html +56 -0
- 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-host-modal-helper.service.js +11 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts.controller.js +10 -9
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-packages.controller.js +6 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-traces.controller.js +0 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-add-host-collections.controller.js +3 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-add-subscriptions.controller.js +5 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-base-subscriptions.controller.js +5 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-details-info.controller.js +0 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-details.controller.js +8 -9
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-host-collections.controller.js +10 -8
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-repository-sets.controller.js +5 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-subscriptions.controller.js +5 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-repository-sets.html +0 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts.html +6 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/content-view.factory.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/deletion/content-view-deletion.controller.js +3 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/deletion/content-view-version-deletion-confirm.controller.js +5 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/components/content-view-component.factory.js +3 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-details.controller.js +6 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-promotion.controller.js +5 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-publish.controller.js +3 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-versions.controller.js +6 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/available-errata-filter.controller.js +5 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/available-package-group-filter.controller.js +5 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/date-type-errata-filter.controller.js +11 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/docker-tag-filter.controller.js +6 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/edit-filter.controller.js +4 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/errata-filter-list.controller.js +5 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-repositories.controller.js +6 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter.factory.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filters.controller.js +4 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/new-filter.controller.js +3 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/package-filter.controller.js +6 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/package-group-list-filter.controller.js +5 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/rule.factory.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/histories/content-view-history.factory.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/puppet-modules/content-view-puppet-module-versions.controller.js +5 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/puppet-modules/content-view-puppet-module.factory.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/puppet-modules/content-view-puppet-modules.controller.js +5 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/content-view-version.factory.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-manifests/docker-manifest.factory.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-tags/details/docker-tag-details.controller.js +0 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-tags/details/views/docker-tag-details.html +0 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-tags/docker-tags.factory.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/environment.controller.js +5 -7
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/environment.factory.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/new-environment.controller.js +3 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/views/new-environment.html +0 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/apply-errata.controller.js +9 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/erratum-content-hosts.controller.js +0 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/erratum.factory.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/views/apply-errata-confirm.html +0 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/files/details/file.controller.js +0 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/files/file.factory.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-details-info.controller.js +6 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-details.controller.js +4 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/gpg-key.factory.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/new/new-gpg-key.controller.js +6 -9
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/host-collection-add-hosts.controller.js +3 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/host-collection-copy.controller.js +3 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/host-collection-details.controller.js +13 -22
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/host-collection-hosts.controller.js +6 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/views/host-collection-info.html +3 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/host-collection.factory.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host-bulk-action.factory.js +2 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host-erratum.factory.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host-package.factory.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host-subscription.factory.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host-traces.factory.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host.factory.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/organization.factory.js +7 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/ostree-branch.factory.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/package-groups/package-group.factory.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/package.factory.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/bulk/product-bulk-action.factory.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/bulk/products-bulk-advanced-sync-modal.controller.js +5 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/bulk/products-bulk-sync-plan-modal.controller.js +6 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/product-details-info.controller.js +5 -8
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/product-details.controller.js +6 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/product-repositories.controller.js +15 -14
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-advanced-sync.controller.js +6 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.controller.js +9 -9
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-manage-content.controller.js +5 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details.controller.js +7 -7
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-advanced-sync.html +0 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +0 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-docker-manifests.html +0 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-files.html +0 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-ostree-branches.html +0 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-packages.html +0 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-puppet-modules.html +0 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/new-repository.controller.js +5 -8
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/views/new-repository.html +0 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/repository.factory.js +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/views/product-repositories.html +0 -20
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/views/product-info.html +0 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/discovery/discovery-create.controller.js +4 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/discovery/discovery.controller.js +5 -8
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/discovery/views/discovery-base.html +0 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/new/product-form.controller.js +3 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/product.factory.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/products.controller.js +7 -7
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/puppet-modules/details/puppet-module.controller.js +0 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/puppet-modules/puppet-module.factory.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/repository-sets/repository-set.factory.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/settings/setting.factory.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/subscription-details.controller.js +0 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/views/subscription-details.html +0 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/manifest-import.controller.js +9 -9
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/views/manifest-import.html +0 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/subscriptions.factory.js +4 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/details/sync-plan-add-products.controller.js +6 -8
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/details/sync-plan-details-info.controller.js +5 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/details/sync-plan-details.controller.js +5 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/details/sync-plan-products.controller.js +8 -8
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/details/views/sync-plan-info.html +0 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/details/views/sync-plan-products.html +0 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/new/new-sync-plan.controller.js +4 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/sync-plan.factory.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/task.factory.js +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/tasks.module.js +3 -3
- data/lib/katello/permission_creator.rb +3 -2
- data/lib/katello/permissions/host_permissions.rb +1 -0
- data/lib/katello/permissions/organization_permissions.rb +1 -0
- data/lib/katello/tasks/clean_installed_packages.rake +20 -3
- data/lib/katello/version.rb +1 -1
- metadata +17 -6
@@ -2,7 +2,7 @@ module Katello
|
|
2
2
|
class Candlepin::ProductContent
|
3
3
|
include ForemanTasks::Triggers
|
4
4
|
|
5
|
-
attr_accessor :content, :enabled, :product
|
5
|
+
attr_accessor :content, :enabled, :product, :product_id
|
6
6
|
|
7
7
|
def initialize(params = {}, product_id = nil)
|
8
8
|
params = params.with_indifferent_access
|
@@ -30,19 +30,6 @@ module Katello
|
|
30
30
|
@repos ||= self.product.repos(self.product.organization.library).where(:content_id => self.content.id)
|
31
31
|
end
|
32
32
|
|
33
|
-
def legacy_content_override(activation_key)
|
34
|
-
override = activation_key.content_overrides.find { |pc| pc.content_label == content.label && pc.name == "enabled" }
|
35
|
-
override.nil? ? 'default' : override.value
|
36
|
-
end
|
37
|
-
|
38
|
-
def content_overrides(activation_key)
|
39
|
-
activation_key.content_overrides.select { |pc| pc.content_label == content.label }
|
40
|
-
end
|
41
|
-
|
42
|
-
def enabled_content_override(activation_key)
|
43
|
-
activation_key.content_overrides.find { |pc| pc.content_label == content.label && pc.name == "enabled" }
|
44
|
-
end
|
45
|
-
|
46
33
|
def content_type
|
47
34
|
self.content.type
|
48
35
|
end
|
@@ -45,8 +45,12 @@ module Katello
|
|
45
45
|
accepts_nested_attributes_for(
|
46
46
|
:content_facet,
|
47
47
|
self.nested_attributes_options[:content_facet].merge(
|
48
|
-
:reject_if =>
|
48
|
+
:reject_if => :content_facet_ignore_update?)
|
49
49
|
)
|
50
|
+
|
51
|
+
def content_facet_ignore_update?(attributes)
|
52
|
+
self.content_facet.blank? && attributes.blank?
|
53
|
+
end
|
50
54
|
end
|
51
55
|
|
52
56
|
module ClassMethods
|
@@ -12,6 +12,7 @@ module Katello
|
|
12
12
|
belongs_to :lifecycle_environment, :inverse_of => :hostgroups, :class_name => "::Katello::KTEnvironment"
|
13
13
|
|
14
14
|
validates_with Katello::Validators::ContentViewEnvironmentValidator
|
15
|
+
validates_with Katello::Validators::HostgroupKickstartRepositoryValidator
|
15
16
|
|
16
17
|
scoped_search :relation => :content_source, :on => :name, :complete_value => true, :rename => :content_source
|
17
18
|
scoped_search :relation => :content_view, :on => :name, :complete_value => true, :rename => :content_view
|
@@ -9,7 +9,8 @@ module Katello
|
|
9
9
|
:valid => Katello::SubscriptionStatus::VALID,
|
10
10
|
:partial => Katello::SubscriptionStatus::PARTIAL,
|
11
11
|
:invalid => Katello::SubscriptionStatus::INVALID,
|
12
|
-
:unknown => Katello::SubscriptionStatus::UNKNOWN
|
12
|
+
:unknown => Katello::SubscriptionStatus::UNKNOWN,
|
13
|
+
:unsubscribed_hypervisor => Katello::SubscriptionStatus::UNSUBSCRIBED_HYPERVISOR
|
13
14
|
}.freeze
|
14
15
|
|
15
16
|
accepts_nested_attributes_for :subscription_facet, :update_only => true, :reject_if => lambda { |attrs| attrs.values.compact.empty? }
|
@@ -1,11 +1,12 @@
|
|
1
1
|
module Katello
|
2
2
|
class ContentViewDockerFilterRule < Katello::Model
|
3
|
+
include ::Katello::Concerns::ContentViewFilterRuleCommon
|
4
|
+
|
3
5
|
belongs_to :filter,
|
4
6
|
:class_name => "Katello::ContentViewDockerFilter",
|
5
7
|
:inverse_of => :docker_rules,
|
6
8
|
:foreign_key => :content_view_filter_id
|
7
9
|
|
8
|
-
validates_lengths_from_database
|
9
10
|
validates :name, :presence => true
|
10
11
|
validate :ensure_unique_attributes
|
11
12
|
|
@@ -1,5 +1,7 @@
|
|
1
1
|
module Katello
|
2
2
|
class ContentViewErratumFilterRule < Katello::Model
|
3
|
+
include ::Katello::Concerns::ContentViewFilterRuleCommon
|
4
|
+
|
3
5
|
before_create :default_types
|
4
6
|
|
5
7
|
ISSUED = "issued".freeze
|
@@ -13,7 +15,6 @@ module Katello
|
|
13
15
|
|
14
16
|
serialize :types, Array
|
15
17
|
|
16
|
-
validates_lengths_from_database
|
17
18
|
validates :errata_id, :uniqueness => { :scope => :content_view_filter_id }, :allow_blank => true
|
18
19
|
validates_with Validators::ContentViewErratumFilterRuleValidator
|
19
20
|
|
@@ -1,11 +1,12 @@
|
|
1
1
|
module Katello
|
2
2
|
class ContentViewPackageFilterRule < Katello::Model
|
3
|
+
include ::Katello::Concerns::ContentViewFilterRuleCommon
|
4
|
+
|
3
5
|
belongs_to :filter,
|
4
6
|
:class_name => "Katello::ContentViewPackageFilter",
|
5
7
|
:inverse_of => :package_rules,
|
6
8
|
:foreign_key => :content_view_filter_id
|
7
9
|
|
8
|
-
validates_lengths_from_database
|
9
10
|
validates :name, :presence => true
|
10
11
|
validate :ensure_unique_attributes
|
11
12
|
validates_with Validators::ContentViewFilterVersionValidator
|
@@ -1,11 +1,12 @@
|
|
1
1
|
module Katello
|
2
2
|
class ContentViewPackageGroupFilterRule < Katello::Model
|
3
|
+
include ::Katello::Concerns::ContentViewFilterRuleCommon
|
4
|
+
|
3
5
|
belongs_to :filter,
|
4
6
|
:class_name => "Katello::ContentViewPackageGroupFilter",
|
5
7
|
:inverse_of => :package_group_rules,
|
6
8
|
:foreign_key => :content_view_filter_id
|
7
9
|
|
8
|
-
validates_lengths_from_database
|
9
10
|
validates :uuid, :presence => true, :uniqueness => { :scope => :content_view_filter_id }
|
10
11
|
end
|
11
12
|
end
|
@@ -52,13 +52,11 @@ module Katello
|
|
52
52
|
# which is calculated elsewhere.
|
53
53
|
|
54
54
|
self.joins(:content_facets).
|
55
|
-
where("#{Katello::Host::ContentFacet.table_name}.host_id" => hosts)
|
55
|
+
where("#{Katello::Host::ContentFacet.table_name}.host_id" => hosts.pluck(:id))
|
56
56
|
end
|
57
57
|
|
58
58
|
def self.applicable_to_hosts_dashboard(hosts)
|
59
|
-
|
60
|
-
self.joins(:content_facets).
|
61
|
-
where("#{Katello::Host::ContentFacet.table_name}.host_id IN (#{ids})").
|
59
|
+
applicable_to_hosts(hosts).
|
62
60
|
select("DISTINCT ON (#{self.table_name}.updated, #{self.table_name}.id) #{self.table_name}.*").
|
63
61
|
order("#{self.table_name}.updated desc").limit(6)
|
64
62
|
end
|
@@ -108,7 +106,8 @@ module Katello
|
|
108
106
|
#{Katello::ContentFacetRepository.table_name}.repository_id = host_repo_errata.repository_id")
|
109
107
|
|
110
108
|
if hosts
|
111
|
-
query = query.where("#{Katello::ContentFacetRepository.table_name}.content_facet_id" => hosts.joins(:content_facet)
|
109
|
+
query = query.where("#{Katello::ContentFacetRepository.table_name}.content_facet_id" => hosts.joins(:content_facet)
|
110
|
+
.select("#{Katello::Host::ContentFacet.table_name}.id"))
|
112
111
|
else
|
113
112
|
query = query.joins(:content_facet_errata)
|
114
113
|
end
|
@@ -38,6 +38,38 @@ module Katello
|
|
38
38
|
self.owner_details['contentAccessMode']
|
39
39
|
end
|
40
40
|
|
41
|
+
def enabled_product_content_for(repositories)
|
42
|
+
return [] if repositories.blank?
|
43
|
+
content_ids = repositories.pluck(:content_id)
|
44
|
+
|
45
|
+
filtered_product_content do |pc|
|
46
|
+
content_ids.include?(pc.content.id) && pc.product.enabled?
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
def enabled_product_content
|
51
|
+
filtered_product_content do |pc|
|
52
|
+
pc.product.enabled? && pc.product.redhat?
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
def filtered_product_content
|
57
|
+
cp_products = Katello::Resources::Candlepin::Product.all(self.label, ['id', 'productContent.enabled', 'productContent.content.name', 'productContent.content.id',
|
58
|
+
'productContent.content.type', 'productContent.content.contentUrl', 'productContent.content.label'])
|
59
|
+
to_return = []
|
60
|
+
|
61
|
+
cp_products.each do |product_hash|
|
62
|
+
product = ::Katello::Product.find_by(:organization_id => self.id, :cp_id => product_hash['id'])
|
63
|
+
if product
|
64
|
+
product_hash['productContent'].each do |pc_hash|
|
65
|
+
pc = Katello::Candlepin::ProductContent.new(pc_hash, product.id)
|
66
|
+
to_return << pc if !block_given? || yield(pc)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
to_return.sort_by { |pc| pc.content.name.downcase }
|
71
|
+
end
|
72
|
+
|
41
73
|
def pools(consumer_uuid = nil)
|
42
74
|
if consumer_uuid
|
43
75
|
Resources::Candlepin::Owner.pools self.label, :consumer => consumer_uuid
|
@@ -161,7 +161,7 @@ module Katello
|
|
161
161
|
all_repos = repos(self.library, nil, false)
|
162
162
|
ForemanTasks::Task::DynflowTask
|
163
163
|
.select("#{ForemanTasks::Task::DynflowTask.table_name}.*")
|
164
|
-
.
|
164
|
+
.where(:label => [::Actions::Katello::Repository::Sync.name, ::Actions::Katello::Repository::ScheduledSync.name])
|
165
165
|
.joins(:locks).where("foreman_tasks_locks.resource_id in (?) and foreman_tasks_locks.resource_type = ?", all_repos.pluck(:id), ::Katello::Repository.name)
|
166
166
|
.order("started_at desc")
|
167
167
|
end
|
@@ -108,6 +108,18 @@ module Katello
|
|
108
108
|
end
|
109
109
|
end
|
110
110
|
|
111
|
+
def content_view
|
112
|
+
self.host.content_facet.try(:content_view) || self.organization.default_content_view
|
113
|
+
end
|
114
|
+
|
115
|
+
def lifecycle_environment
|
116
|
+
self.host.content_facet.try(:lifecycle_environment) || self.organization.library
|
117
|
+
end
|
118
|
+
|
119
|
+
def organization
|
120
|
+
self.host.organization
|
121
|
+
end
|
122
|
+
|
111
123
|
def update_subscription_status(status_override = nil)
|
112
124
|
status = host.get_status(::Katello::SubscriptionStatus)
|
113
125
|
if status_override
|
@@ -172,6 +184,10 @@ module Katello
|
|
172
184
|
name.downcase
|
173
185
|
end
|
174
186
|
|
187
|
+
def products
|
188
|
+
Katello::Product.joins(:subscriptions => {:pools => :subscription_facets}).where("#{Katello::Host::SubscriptionFacet.table_name}.id" => self.id).enabled.uniq
|
189
|
+
end
|
190
|
+
|
175
191
|
def remove_subscriptions(pools_with_quantities)
|
176
192
|
ForemanTasks.sync_task(Actions::Katello::Host::RemoveSubscriptions, self.host, pools_with_quantities)
|
177
193
|
end
|
@@ -142,7 +142,7 @@ module Katello
|
|
142
142
|
scoped_search :on => :content_type, :complete_value => -> do
|
143
143
|
Katello::RepositoryTypeManager.repository_types.keys.each_with_object({}) { |value, hash| hash[value.to_sym] = value }
|
144
144
|
end
|
145
|
-
scoped_search :on => :content_view_id, :relation => :content_view_repositories, :validator => ScopedSearch::Validators::INTEGER
|
145
|
+
scoped_search :on => :content_view_id, :relation => :content_view_repositories, :validator => ScopedSearch::Validators::INTEGER, :only_explicit => true
|
146
146
|
scoped_search :on => :distribution_version, :complete_value => true
|
147
147
|
scoped_search :on => :distribution_arch, :complete_value => true
|
148
148
|
scoped_search :on => :distribution_family, :complete_value => true
|
@@ -472,7 +472,7 @@ module Katello
|
|
472
472
|
end
|
473
473
|
|
474
474
|
def latest_dynflow_sync
|
475
|
-
@latest_dynflow_sync ||= ForemanTasks::Task::DynflowTask.
|
475
|
+
@latest_dynflow_sync ||= ForemanTasks::Task::DynflowTask.where(:label => [::Actions::Katello::Repository::Sync.name, ::Actions::Katello::Repository::ScheduledSync.name]).
|
476
476
|
for_resource(self).order(:started_at).last
|
477
477
|
end
|
478
478
|
|
@@ -22,7 +22,10 @@ module Katello
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def redhat?
|
25
|
-
|
25
|
+
# for custom subscriptions, there is no separate marketing and engineering product
|
26
|
+
# so query our Products table and check there
|
27
|
+
product = Katello::Product.where(:cp_id => self.product_id, :organization => self.organization).first
|
28
|
+
product.nil? || product.redhat?
|
26
29
|
end
|
27
30
|
|
28
31
|
def active?
|
@@ -1,5 +1,6 @@
|
|
1
1
|
module Katello
|
2
2
|
class SubscriptionStatus < HostStatus::Status
|
3
|
+
UNSUBSCRIBED_HYPERVISOR = 4
|
3
4
|
UNKNOWN = 3
|
4
5
|
INVALID = 2
|
5
6
|
PARTIAL = 1
|
@@ -17,6 +18,8 @@ module Katello
|
|
17
18
|
N_("Partially entitled")
|
18
19
|
when INVALID
|
19
20
|
N_("Unentitled")
|
21
|
+
when UNSUBSCRIBED_HYPERVISOR
|
22
|
+
N_("Unsubscribed hypervisor")
|
20
23
|
else
|
21
24
|
N_("Unknown subscription status")
|
22
25
|
end
|
@@ -26,18 +29,17 @@ module Katello
|
|
26
29
|
case status
|
27
30
|
when INVALID
|
28
31
|
::HostStatus::Global::ERROR
|
29
|
-
when PARTIAL
|
30
|
-
::HostStatus::Global::WARN
|
31
32
|
when VALID
|
32
33
|
::HostStatus::Global::OK
|
33
|
-
|
34
|
+
else
|
34
35
|
::HostStatus::Global::WARN
|
35
36
|
end
|
36
37
|
end
|
37
38
|
|
38
39
|
def to_status(options = {})
|
39
40
|
return UNKNOWN unless host.subscription_facet.try(:uuid)
|
40
|
-
status_override =
|
41
|
+
status_override = 'unsubscribed_hypervisor' if host.subscription_facet.hypervisor && host.subscription_facet.candlepin_consumer.entitlements.empty?
|
42
|
+
status_override ||= options.fetch(:status_override, nil)
|
41
43
|
status = status_override || Katello::Candlepin::Consumer.new(host.subscription_facet.uuid, host.organization.label).entitlement_status
|
42
44
|
|
43
45
|
case status
|
@@ -47,6 +49,8 @@ module Katello
|
|
47
49
|
PARTIAL
|
48
50
|
when Katello::Candlepin::Consumer::ENTITLEMENTS_INVALID
|
49
51
|
INVALID
|
52
|
+
when 'unsubscribed_hypervisor'
|
53
|
+
UNSUBSCRIBED_HYPERVISOR
|
50
54
|
else
|
51
55
|
UNKNOWN
|
52
56
|
end
|
@@ -1,11 +1,11 @@
|
|
1
1
|
module Katello
|
2
|
-
class ProductContentPresenter
|
2
|
+
class ProductContentPresenter < SimpleDelegator
|
3
3
|
attr_accessor :product_content, :overrides
|
4
|
-
delegate :content, :enabled, :product, :to => :product_content
|
5
4
|
|
6
5
|
def initialize(product_content, overrides)
|
7
6
|
@product_content = product_content
|
8
7
|
@overrides = overrides
|
8
|
+
super(@product_content)
|
9
9
|
end
|
10
10
|
|
11
11
|
def override
|
@@ -20,5 +20,10 @@ module Katello
|
|
20
20
|
def content_overrides
|
21
21
|
overrides.select { |pc| pc.content_label == content.label }
|
22
22
|
end
|
23
|
+
|
24
|
+
def legacy_content_override
|
25
|
+
override = @overrides.find { |pc| pc.content_label == content.label && pc.name == "enabled" }
|
26
|
+
override.nil? ? 'default' : override.value
|
27
|
+
end
|
23
28
|
end
|
24
29
|
end
|
@@ -116,34 +116,6 @@ module Katello
|
|
116
116
|
end
|
117
117
|
end
|
118
118
|
|
119
|
-
def products
|
120
|
-
pool_ids = self.entitlements.map { |entitlement| entitlement['pool']['id'] }
|
121
|
-
Katello::Product.joins(:subscriptions => :pools).where("#{Katello::Pool.table_name}.cp_id" => pool_ids).enabled.uniq
|
122
|
-
end
|
123
|
-
|
124
|
-
def all_products
|
125
|
-
::Katello::Host::SubscriptionFacet.find_by_uuid(self.uuid).host.organization.products.enabled.uniq
|
126
|
-
end
|
127
|
-
|
128
|
-
def available_product_content(content_access_mode_all = false, content_access_mode_env = false)
|
129
|
-
if content_access_mode_env
|
130
|
-
host = ::Katello::Host::ContentFacet.find_by_uuid(self.uuid)
|
131
|
-
return [] unless host.lifecycle_environment_id && host.content_view_id
|
132
|
-
version = ContentViewVersion.in_environment(host.lifecycle_environment_id).where(:content_view_id => host.content_view_id).first
|
133
|
-
content_view_version_id = version.id
|
134
|
-
end
|
135
|
-
if content_access_mode_all
|
136
|
-
content = all_products.flat_map do |product|
|
137
|
-
product.available_content(content_view_version_id)
|
138
|
-
end
|
139
|
-
else
|
140
|
-
content = products.flat_map do |product|
|
141
|
-
product.available_content(content_view_version_id)
|
142
|
-
end
|
143
|
-
end
|
144
|
-
content.uniq
|
145
|
-
end
|
146
|
-
|
147
119
|
def compliance_reasons
|
148
120
|
Resources::Candlepin::Consumer.compliance(uuid)['reasons'].map do |reason|
|
149
121
|
"#{reason['attributes']['name']}: #{reason['message']}"
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module Katello
|
2
|
+
class ProductContentFinder
|
3
|
+
attr_accessor :match_environment, :match_subscription, :consumable
|
4
|
+
|
5
|
+
#consumable must implement:
|
6
|
+
# content_view
|
7
|
+
# lifecycle_environment
|
8
|
+
# organization
|
9
|
+
# products
|
10
|
+
def initialize(params = {})
|
11
|
+
self.match_subscription = false
|
12
|
+
self.match_environment = false
|
13
|
+
|
14
|
+
params.each_pair { |k, v| instance_variable_set("@#{k}", v) unless v.nil? }
|
15
|
+
end
|
16
|
+
|
17
|
+
def product_content
|
18
|
+
if match_environment
|
19
|
+
environment = consumable.lifecycle_environment
|
20
|
+
view = consumable.content_view
|
21
|
+
return [] unless environment && view
|
22
|
+
version = ContentViewVersion.in_environment(environment).where(:content_view_id => view).first
|
23
|
+
end
|
24
|
+
|
25
|
+
considered_products = match_subscription ? consumable.products : consumable.organization.products.enabled.uniq
|
26
|
+
|
27
|
+
repositories = Katello::Repository.where(:product_id => considered_products).subscribable
|
28
|
+
repositories = repositories.where(:content_view_version_id => version .id) if version
|
29
|
+
|
30
|
+
consumable.organization.enabled_product_content_for(repositories)
|
31
|
+
end
|
32
|
+
|
33
|
+
def presenter_with_overrides(overrides)
|
34
|
+
product_content.map { |pc| ProductContentPresenter.new(pc, overrides) }
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -1,8 +1,6 @@
|
|
1
1
|
<div>
|
2
2
|
<h3><%= _('Content Sync') %></h3>
|
3
3
|
|
4
|
-
<div bst-alerts error-messages="syncErrorMessages"></div>
|
5
|
-
|
6
4
|
{{ syncStatusText(syncState, syncStatus) }}
|
7
5
|
<div ng-show="syncState.is(syncState.SYNCING, syncState.SYNC_TRIGGERED, syncState.CANCEL_TRIGGERED, syncState.FAILURE)">
|
8
6
|
{{ syncTask.progressbar.value || 0 | number: 0 }}%
|
@@ -0,0 +1,34 @@
|
|
1
|
+
extends 'katello/api/v2/common/org_reference'
|
2
|
+
extends 'katello/api/v2/common/timestamps'
|
3
|
+
|
4
|
+
attributes :id, :name, :description, :unlimited_hosts, :auto_attach
|
5
|
+
|
6
|
+
attributes :content_view_id
|
7
|
+
|
8
|
+
child :content_view => :content_view do
|
9
|
+
attributes :id, :name
|
10
|
+
end
|
11
|
+
|
12
|
+
child :environment => :environment do
|
13
|
+
attributes :name, :id
|
14
|
+
end
|
15
|
+
attributes :environment_id
|
16
|
+
|
17
|
+
attributes :usage_count, :user_id, :max_hosts, :system_template_id, :release_version
|
18
|
+
|
19
|
+
node :permissions do |activation_key|
|
20
|
+
{
|
21
|
+
:view_activation_keys => activation_key.readable?,
|
22
|
+
:edit_activation_keys => activation_key.editable?,
|
23
|
+
:destroy_activation_keys => activation_key.deletable?
|
24
|
+
}
|
25
|
+
end
|
26
|
+
|
27
|
+
child :products => :products do |_product|
|
28
|
+
attributes :id, :name
|
29
|
+
end
|
30
|
+
|
31
|
+
child :host_collections => :host_collections do
|
32
|
+
attributes :id
|
33
|
+
attributes :name
|
34
|
+
end
|