katello 3.1.0.1 → 3.2.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/README.md +8 -47
- data/app/assets/javascripts/katello/common/index.js +0 -1
- data/app/assets/javascripts/katello/providers/redhat/index.js +0 -1
- data/app/assets/stylesheets/katello/_katello_colors.scss +0 -2
- data/app/assets/stylesheets/katello/katello.scss +0 -2
- data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +45 -42
- data/app/controllers/katello/api/v2/activation_keys_controller.rb +7 -19
- data/app/controllers/katello/api/v2/api_controller.rb +3 -3
- data/app/controllers/katello/api/v2/capsule_content_controller.rb +3 -3
- data/app/controllers/katello/api/v2/content_uploads_controller.rb +2 -2
- data/app/controllers/katello/api/v2/content_view_filter_rules_controller.rb +29 -18
- data/app/controllers/katello/api/v2/content_view_filters_controller.rb +2 -2
- data/app/controllers/katello/api/v2/content_view_histories_controller.rb +1 -1
- data/app/controllers/katello/api/v2/content_view_puppet_modules_controller.rb +2 -2
- data/app/controllers/katello/api/v2/content_view_versions_controller.rb +10 -8
- data/app/controllers/katello/api/v2/content_views_controller.rb +5 -5
- data/app/controllers/katello/api/v2/environments_controller.rb +10 -9
- data/app/controllers/katello/api/v2/file_units_controller.rb +16 -0
- data/app/controllers/katello/api/v2/gpg_keys_controller.rb +4 -4
- data/app/controllers/katello/api/v2/host_autocomplete_controller.rb +2 -2
- data/app/controllers/katello/api/v2/host_collections_controller.rb +41 -13
- data/app/controllers/katello/api/v2/host_errata_controller.rb +12 -5
- data/app/controllers/katello/api/v2/host_packages_controller.rb +4 -4
- data/app/controllers/katello/api/v2/host_subscriptions_controller.rb +9 -9
- data/app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb +52 -13
- data/app/controllers/katello/api/v2/organizations_controller.rb +3 -3
- data/app/controllers/katello/api/v2/packages_controller.rb +1 -1
- data/app/controllers/katello/api/v2/ping_controller.rb +2 -2
- data/app/controllers/katello/api/v2/products_bulk_actions_controller.rb +2 -2
- data/app/controllers/katello/api/v2/products_controller.rb +6 -16
- data/app/controllers/katello/api/v2/repositories_bulk_actions_controller.rb +1 -1
- data/app/controllers/katello/api/v2/repositories_controller.rb +60 -21
- data/app/controllers/katello/api/v2/repository_sets_controller.rb +3 -3
- data/app/controllers/katello/api/v2/root_controller.rb +2 -2
- data/app/controllers/katello/api/v2/subscriptions_controller.rb +19 -10
- data/app/controllers/katello/api/v2/sync_controller.rb +3 -3
- data/app/controllers/katello/api/v2/sync_plans_controller.rb +2 -2
- data/app/controllers/katello/api/v2/uebercerts_controller.rb +1 -1
- data/app/controllers/katello/application_controller.rb +7 -7
- data/app/controllers/katello/auto_complete_search_controller.rb +1 -1
- data/app/controllers/katello/concerns/api/api_controller.rb +1 -1
- data/app/controllers/katello/concerns/api/v2/hostgroups_controller_extensions.rb +19 -16
- data/app/controllers/katello/concerns/api/v2/repository_content_controller.rb +8 -6
- data/app/controllers/katello/concerns/authorization/api/v2/content_views_controller.rb +10 -6
- data/app/controllers/katello/concerns/organizations_controller_extensions.rb +1 -1
- data/app/controllers/katello/concerns/smart_proxies_controller_extensions.rb +1 -1
- data/app/controllers/katello/errors_controller.rb +2 -2
- data/app/controllers/katello/organizations_controller.rb +1 -1
- data/app/controllers/katello/products_controller.rb +4 -4
- data/app/controllers/katello/providers_controller.rb +2 -2
- data/app/helpers/katello/application_helper.rb +0 -240
- data/app/helpers/katello/concerns/hosts_and_hostgroups_helper_extensions.rb +19 -0
- data/app/lib/actions/candlepin/import_pool_handler.rb +11 -6
- data/app/lib/actions/katello/capsule_content/create_repos.rb +3 -3
- data/app/lib/actions/katello/capsule_content/sync.rb +23 -9
- data/app/lib/actions/katello/content_view/add_to_environment.rb +1 -1
- data/app/lib/actions/katello/content_view/errata_mail.rb +2 -2
- data/app/lib/actions/katello/content_view/incremental_updates.rb +60 -1
- data/app/lib/actions/katello/content_view/remove.rb +2 -2
- data/app/lib/actions/katello/content_view_environment/destroy.rb +1 -1
- data/app/lib/actions/katello/content_view_environment/reassign_objects.rb +2 -2
- data/app/lib/actions/katello/content_view_puppet_environment/create.rb +3 -1
- data/app/lib/actions/katello/host/attach_subscriptions.rb +13 -6
- data/app/lib/actions/katello/host/destroy.rb +0 -19
- data/app/lib/actions/katello/host/generate_applicability.rb +8 -3
- data/app/lib/actions/katello/host/hypervisors.rb +17 -9
- data/app/lib/actions/katello/host/hypervisors_update.rb +19 -44
- data/app/lib/actions/katello/host/reassign.rb +14 -0
- data/app/lib/actions/katello/host/register.rb +3 -22
- data/app/lib/actions/katello/host/remove_subscriptions.rb +15 -2
- data/app/lib/actions/katello/host/update.rb +0 -6
- data/app/lib/actions/katello/organization/destroy.rb +2 -2
- data/app/lib/actions/katello/product/content_destroy.rb +7 -9
- data/app/lib/actions/katello/product/destroy.rb +23 -7
- data/app/lib/actions/katello/repository/clear.rb +1 -0
- data/app/lib/actions/katello/repository/clone_file_content.rb +17 -0
- data/app/lib/actions/katello/repository/clone_to_environment.rb +2 -0
- data/app/lib/actions/katello/repository/clone_to_version.rb +2 -0
- data/app/lib/actions/katello/repository/create.rb +2 -1
- data/app/lib/actions/katello/repository/destroy.rb +20 -10
- data/app/lib/actions/katello/repository/errata_mail.rb +2 -2
- data/app/lib/actions/katello/repository/filtered_index_content.rb +2 -0
- data/app/lib/actions/katello/repository/import_upload.rb +6 -2
- data/app/lib/actions/katello/repository/{refresh_repostiory.rb → refresh_repository.rb} +0 -0
- data/app/lib/actions/katello/repository/remove_content.rb +2 -0
- data/app/lib/actions/katello/repository/sync.rb +8 -12
- data/app/lib/actions/katello/repository_set/disable_repository.rb +6 -5
- data/app/lib/actions/katello/repository_set/enable_repository.rb +1 -1
- data/app/lib/actions/katello/repository_set/scan_cdn.rb +1 -1
- data/app/lib/actions/pulp/abstract_async_task.rb +1 -1
- data/app/lib/actions/pulp/consumer/unassociate_units.rb +20 -0
- data/app/lib/actions/pulp/repository/copy_files.rb +11 -0
- data/app/lib/actions/pulp/repository/create.rb +5 -1
- data/app/lib/actions/pulp/repository/presenters/file_presenter.rb +1 -1
- data/app/lib/actions/pulp/repository/refresh.rb +4 -2
- data/app/lib/actions/pulp/repository/remove_file.rb +15 -0
- data/app/lib/actions/pulp/repository/sync.rb +3 -1
- data/app/lib/actions/pulp/repository_group/export.rb +1 -1
- data/app/lib/katello/errors.rb +1 -1
- data/app/lib/katello/lazy_accessor.rb +1 -1
- data/app/lib/katello/resources/candlepin.rb +14 -0
- data/app/lib/katello/util/cdn_var_substitutor.rb +5 -2
- data/app/lib/katello/util/model.rb +1 -2
- data/app/lib/katello/util/package.rb +2 -2
- data/app/models/katello/activation_key.rb +0 -49
- data/app/models/katello/authorization/content_view_version.rb +7 -0
- data/app/models/katello/candlepin/content.rb +15 -3
- data/app/models/katello/concerns/container_extensions.rb +1 -2
- data/app/models/katello/concerns/content_facet_host_extensions.rb +11 -1
- data/app/models/katello/concerns/host_managed_extensions.rb +4 -13
- data/app/models/katello/concerns/hostgroup_extensions.rb +0 -2
- data/app/models/katello/concerns/medium_extensions.rb +2 -2
- data/app/models/katello/concerns/organization_extensions.rb +0 -5
- data/app/models/katello/concerns/pulp_database_unit.rb +5 -1
- data/app/models/katello/concerns/smart_proxy_extensions.rb +21 -1
- data/app/models/katello/concerns/subscription_facet_host_extensions.rb +1 -2
- data/app/models/katello/content_view.rb +12 -6
- data/app/models/katello/content_view_component.rb +0 -3
- data/app/models/katello/content_view_environment.rb +2 -2
- data/app/models/katello/content_view_package_filter_rule.rb +13 -0
- data/app/models/katello/content_view_puppet_environment.rb +2 -2
- data/app/models/katello/content_view_repository.rb +2 -1
- data/app/models/katello/content_view_version.rb +9 -2
- data/app/models/katello/erratum.rb +1 -5
- data/app/models/katello/file_unit.rb +41 -0
- data/app/models/katello/glue/candlepin/activation_key.rb +2 -2
- data/app/models/katello/glue/candlepin/pool.rb +19 -14
- data/app/models/katello/glue/pulp/repo.rb +44 -10
- data/app/models/katello/host/content_facet.rb +6 -6
- data/app/models/katello/host/subscription_facet.rb +6 -8
- data/app/models/katello/kt_environment.rb +3 -5
- data/app/models/katello/package_group.rb +1 -3
- data/app/models/katello/pool.rb +7 -2
- data/app/models/katello/pool_with_quantities.rb +12 -0
- data/app/models/katello/product.rb +6 -0
- data/app/models/katello/provider.rb +1 -1
- data/app/models/katello/puppet_module.rb +1 -2
- data/app/models/katello/repository.rb +7 -3
- data/app/models/katello/repository_file.rb +9 -0
- data/app/models/katello/rpm.rb +1 -1
- data/app/models/katello/subscription_status.rb +1 -1
- data/app/models/katello/sync_plan.rb +2 -1
- data/app/models/katello/task_status.rb +3 -36
- data/app/models/setting/content.rb +4 -1
- data/app/overrides/add_activation_keys_input.rb +2 -2
- data/app/presenters/katello/activation_key_subscriptions_presenter.rb +10 -0
- data/app/services/katello/candlepin/consumer.rb +5 -1
- data/app/services/katello/pulp/file_unit.rb +13 -0
- data/app/views/dashboard/_errata_widget.html.erb +1 -1
- data/app/views/dashboard/_subscription_widget.html.erb +30 -8
- data/app/views/foreman/job_templates/install_errata.erb +1 -1
- data/app/views/katello/api/v2/activation_keys/product_content.json.rabl +1 -0
- data/app/views/katello/api/v2/capsule_content/sync_status.json.rabl +2 -2
- data/app/views/katello/api/v2/content_facet/base.json.rabl +2 -4
- data/app/views/katello/api/v2/{systems → content_facet}/erratum.json.rabl +0 -0
- data/app/views/katello/api/v2/content_facet/show.json.rabl +1 -1
- data/app/views/katello/api/v2/content_view_versions/base.json.rabl +5 -4
- data/app/views/katello/api/v2/environments/show.json.rabl +1 -1
- data/app/views/katello/api/v2/file_units/base.json.rabl +7 -0
- data/app/views/katello/api/v2/{systems → file_units}/index.json.rabl +1 -1
- data/app/views/katello/api/v2/file_units/show.json.rabl +3 -0
- data/app/views/katello/api/v2/host_errata/index.json.rabl +1 -1
- data/app/views/katello/api/v2/host_errata/show.json.rabl +1 -1
- data/app/views/katello/api/v2/package_groups/base.json.rabl +1 -1
- data/app/views/katello/api/v2/ping/show.json.rabl +1 -1
- data/app/views/katello/api/v2/repositories/base.json.rabl +2 -1
- data/app/views/katello/api/v2/repositories/show.json.rabl +1 -1
- data/app/views/katello/api/v2/subscription_facet/base.json.rabl +1 -1
- data/app/views/katello/api/v2/subscription_facet/base_with_root.json.rabl +0 -4
- data/app/views/katello/api/v2/subscription_facet/show.json.rabl +1 -5
- data/app/views/katello/api/v2/subscriptions/base.json.rabl +3 -3
- data/app/views/katello/api/v2/subscriptions/index.json.rabl +1 -0
- data/app/views/katello/api/v2/tasks/task_status_show.json.rabl +0 -1
- data/app/views/katello/providers/redhat/show.html.erb +1 -1
- data/app/views/katello/sync_management/_products.html.erb +5 -1
- data/app/views/overrides/activation_keys/_host_environment_select.html.erb +1 -9
- data/app/views/overrides/activation_keys/_host_synced_content_select.html.erb +1 -0
- data/config/routes/api/v2.rb +9 -2
- data/config/routes/overrides.rb +9 -0
- data/db/migrate/20150930183738_migrate_content_hosts.rb +1 -1
- data/db/migrate/20160617124149_remove_duplicate_view_filters.rb +38 -0
- data/db/migrate/20160627125310_delete_system.rb +7 -0
- data/db/migrate/20160722193256_add_verify_ssl_on_sync_to_repository.rb +9 -0
- data/db/migrate/20160727144242_add_registered_through_to_katello_subscription_facets.rb +5 -0
- data/db/migrate/20160808002834_add_files.rb +30 -0
- data/db/migrate/20160906181923_add_puppet_path_to_smart_proxy.rb +5 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/activation-keys.module.js +1 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-associations.controller.js +7 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-add-subscriptions.html +6 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-associations-content-hosts.html +4 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-details.html +101 -102
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-subscriptions-list.html +3 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/new/views/activation-key-new.html +82 -83
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/views/activation-keys.html +4 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/bastion-katello-bootstrap.js +1 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/capsule-content/capsule-content.module.js +3 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/capsules/capsules.module.js +4 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/common/common.module.js +2 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/common/views/registration.html +1 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-action-subscriptions.controller.js +46 -72
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-action.controller.js +1 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/bulk-actions-errata.html +5 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/bulk-actions-host-collections.html +5 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/bulk-actions-subscriptions.html +79 -33
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts.module.js +1 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-errata.controller.js +10 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-errata.html +27 -15
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-packages.html +57 -45
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-add-subscriptions.controller.js +5 -18
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-base-subscriptions.controller.js +2 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-details.controller.js +2 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-subscriptions.controller.js +3 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-add-subscriptions.html +4 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-details.html +117 -118
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-info.html +13 -8
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-subscriptions-list.html +5 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts.html +5 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/content-views.module.js +1 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/content-views.routes.js +26 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/deletion/content-view-version-deletion-content-hosts.controller.js +11 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/deletion/content-view-version-deletion-environments.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/deletion/content-view-version-deletion.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/deletion/views/content-view-deletion.html +3 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/deletion/views/version-deletion-content-hosts.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/deletion/views/version-deletion-environments.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-available-file-repositories.controller.js +47 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-details.controller.js +8 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-file-repositories-list.controller.js +45 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/errata-filter-details.html +4 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/filters.html +3 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/package-filter-details.html +6 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/puppet-modules/views/content-view-puppet-module-names.html +6 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/puppet-modules/views/content-view-puppet-modules.html +4 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-composite-available-content-views.html +2 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-composite-content-views-list.html +2 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-details.html +151 -140
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-docker-repositories.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-file-repositories.html +118 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-ostree-repositories.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-repositories.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-versions.html +13 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/content-view-version-content.controller.js +8 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/content-view-versions.module.js +1 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-details.html +8 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-file.html +22 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version.html +6 -16
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/views/content-views.html +4 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-manifests/docker-manifests.module.js +6 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-tags/details/views/docker-tags-details.html +59 -61
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-tags/docker-tags.module.js +3 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-tags/views/docker-tags.html +4 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment-content-views.html +5 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment-docker.html +4 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment-errata.html +4 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment-ostree.html +4 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment-packages.html +4 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment-puppet-modules.html +4 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment-repositories.html +4 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/environments.module.js +1 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/errata-content-hosts.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/views/errata-details-content-hosts.html +6 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/views/errata-details-repositories.html +4 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/views/errata-details.html +44 -45
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/errata.module.js +2 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/views/errata.html +5 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-details-info.controller.js +11 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/gpg-key-details.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/views/gpg-key-details.html +52 -48
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/views/gpg-key-info.html +1 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/views/gpg-key-products.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/details/views/gpg-key-repositories.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/gpg-keys.module.js +1 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/new/views/gpg-key-new.html +62 -63
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/gpg-keys/views/gpg-keys.html +6 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/views/host-collection-add-hosts.html +4 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/views/host-collection-details.html +85 -86
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/views/host-collection-hosts-list.html +4 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/host-collections.module.js +1 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/new/views/host-collection-new.html +16 -17
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/views/host-collections.html +5 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host-bulk-action.factory.js +28 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host-erratum.factory.js +1 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host.factory.js +1 -27
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/hosts.module.js +3 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/organization.factory.js +0 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/organizations.module.js +4 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/details/ostree-branches-details-repositories.controller.js +60 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/details/ostree-branches-details.controller.js +31 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/details/views/ostree-branches-details-info.html +23 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/details/views/ostree-branches-details-repositories.html +83 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/details/views/ostree-branches-details.html +43 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/ostree-branches.controller.js +67 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/ostree-branches.module.js +5 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/ostree-branches.routes.js +53 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/views/ostree-branches-table-collapsed.html +19 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/views/ostree-branches-table-full.html +21 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/views/ostree-branches.html +19 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/package-groups/package-groups.module.js +7 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/package-details.controller.js +17 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/views/packages-details-info.html +10 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/views/packages-details-repositories.html +4 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/views/packages-details.html +51 -52
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/packages.module.js +3 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/views/packages.html +5 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/views/product-details.html +72 -73
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/views/product-repositories.html +19 -7
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/discovery/views/discovery-create.html +144 -145
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/new/views/product-new.html +17 -18
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/products.module.js +1 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/views/products.html +4 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/puppet-modules/details/views/puppet-modules-details.html +44 -40
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/puppet-modules/puppet-modules.module.js +7 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/puppet-modules/views/puppet-modules.html +4 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/repositories/details/repository-details-info.controller.js +11 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/repositories/details/views/repository-info.html +343 -324
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/repositories/new/new-repository.controller.js +4 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/repositories/new/views/repository-new.html +10 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/repositories/repositories.module.js +1 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/settings/settings.module.js +2 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/views/subscription-associations-content-hosts.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/views/subscription-details.html +46 -47
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/manifest-import.controller.js +10 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/views/manifest-import.html +1 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/manifest/views/manifest.html +41 -42
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/subscriptions-helper.service.js +15 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/subscriptions.module.js +1 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/subscriptions.html +4 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/details/views/sync-plan-details.html +54 -55
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/sync-plans.module.js +1 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/views/sync-plans.html +4 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/tasks.module.js +3 -1
- data/engines/bastion_katello/lib/bastion_katello/engine.rb +1 -0
- data/lib/katello/engine.rb +11 -1
- data/lib/katello/permissions/host_permissions.rb +13 -1
- data/lib/katello/plugin.rb +20 -1
- data/lib/katello/tasks/reimport.rake +1 -0
- data/lib/katello/tasks/test.rake +8 -0
- data/lib/katello/tasks/unify_hosts.rake +91 -0
- data/lib/katello/tasks/upgrade_check.rake +3 -2
- data/lib/katello/tasks/upgrades/3.0/update_subscription_facet_backend_data.rake +2 -4
- data/lib/katello/version.rb +1 -1
- data/lib/proxy_api/pulp.rb +7 -0
- data/lib/proxy_api/pulp_node.rb +7 -0
- metadata +79 -67
- data/app/assets/javascripts/katello/common/jquery.jeditable.custominputs.js +0 -180
- data/app/assets/javascripts/katello/widgets/jquery.jeditable.helpers.js +0 -247
- data/app/assets/stylesheets/katello/widgets/_scrollpane.scss +0 -66
- data/app/controllers/katello/api/v2/systems_controller.rb +0 -213
- data/app/helpers/katello/activation_keys_helper.rb +0 -4
- data/app/helpers/katello/host_collection_events_helper.rb +0 -7
- data/app/helpers/katello/katello_form_builder.rb +0 -150
- data/app/helpers/katello/packages_helper.rb +0 -67
- data/app/helpers/katello/subscriptions_helper.rb +0 -32
- data/app/helpers/katello/system_events_helper.rb +0 -4
- data/app/helpers/katello/system_packages_helper.rb +0 -42
- data/app/lib/actions/katello/repository/incremental_import.rb +0 -61
- data/app/lib/actions/katello/subscription/subscribe.rb +0 -26
- data/app/lib/actions/katello/system/destroy.rb +0 -17
- data/app/lib/actions/katello/system/reassign.rb +0 -14
- data/app/models/katello/authorization/system.rb +0 -53
- data/app/models/katello/glue/candlepin/consumer.rb +0 -386
- data/app/models/katello/glue/pulp/consumer.rb +0 -171
- data/app/models/katello/hypervisor.rb +0 -15
- data/app/models/katello/system.rb +0 -283
- data/app/models/katello/system_activation_key.rb +0 -8
- data/app/models/katello/system_repository.rb +0 -8
- data/app/presenters/katello/activation_key_subscription_presenter.rb +0 -10
- data/app/views/katello/api/v2/errata/_applicable_errata.json.rabl +0 -3
- data/app/views/katello/api/v2/subscriptions/create.json.rabl +0 -3
- data/app/views/katello/api/v2/systems/_pool.json.rabl +0 -6
- data/app/views/katello/api/v2/systems/activate.json.rabl +0 -3
- data/app/views/katello/api/v2/systems/add_host_collections.json.rabl +0 -3
- data/app/views/katello/api/v2/systems/available_host_collections.json.rabl +0 -5
- data/app/views/katello/api/v2/systems/base.json.rabl +0 -35
- data/app/views/katello/api/v2/systems/enabled_repos.json.rabl +0 -3
- data/app/views/katello/api/v2/systems/events.json.rabl +0 -3
- data/app/views/katello/api/v2/systems/package.json.rabl +0 -5
- data/app/views/katello/api/v2/systems/package_profile.json.rabl +0 -7
- data/app/views/katello/api/v2/systems/pools.json.rabl +0 -7
- data/app/views/katello/api/v2/systems/regenerate_identity_certificates.json.rabl +0 -3
- data/app/views/katello/api/v2/systems/remove_host_collections.json.rabl +0 -3
- data/app/views/katello/api/v2/systems/show.json.rabl +0 -64
- data/app/views/katello/api/v2/systems/subscriptions.json.rabl +0 -8
- data/app/views/katello/api/v2/systems/upload_package_profile.json.rabl +0 -3
- data/db/seeds.d/105-roles_permissions.rb +0 -71
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host.factory.js +0 -25
- data/lib/katello/permissions/content_host_permissions.rb +0 -30
- data/lib/katello/tasks/yard.rake +0 -9
- data/vendor/assets/stylesheets/katello/jquery.jscrollpane.css +0 -120
@@ -86,7 +86,7 @@ module Actions
|
|
86
86
|
|
87
87
|
def content
|
88
88
|
return @content if defined? @content
|
89
|
-
if product_content = product.product_content_by_id(input[:content_id])
|
89
|
+
if (product_content = product.product_content_by_id(input[:content_id]))
|
90
90
|
@content = product_content.content
|
91
91
|
else
|
92
92
|
fail "Couldn't find content '%s'" % input[:content_id]
|
@@ -117,7 +117,7 @@ module Actions
|
|
117
117
|
task["task_id"].nil? || (task["tags"] && (task["tags"] & ignored_tags).present?)
|
118
118
|
end
|
119
119
|
output[:pulp_tasks].each do |pulp_task|
|
120
|
-
if pulp_exception = ::Katello::Errors::PulpError.from_task(pulp_task)
|
120
|
+
if (pulp_exception = ::Katello::Errors::PulpError.from_task(pulp_task))
|
121
121
|
fail pulp_exception
|
122
122
|
end
|
123
123
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Actions
|
2
|
+
module Pulp
|
3
|
+
module Consumer
|
4
|
+
class UnassociateUnits < ::Actions::Pulp::AbstractAsyncTask
|
5
|
+
input_format do
|
6
|
+
param :capsule_id, Integer
|
7
|
+
param :repo_pulp_id, String
|
8
|
+
end
|
9
|
+
|
10
|
+
def humanized_name
|
11
|
+
_("Unassociate units in repository")
|
12
|
+
end
|
13
|
+
|
14
|
+
def invoke_external_task
|
15
|
+
pulp_resources.repository.unassociate_units(input[:repo_pulp_id])
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -20,6 +20,7 @@ module Actions
|
|
20
20
|
param :download_policy
|
21
21
|
param :capsule_id
|
22
22
|
param :mirror_on_sync
|
23
|
+
param :ssl_validation
|
23
24
|
end
|
24
25
|
|
25
26
|
def run
|
@@ -56,6 +57,7 @@ module Actions
|
|
56
57
|
importer.ssl_ca_cert = input[:ssl_ca_cert]
|
57
58
|
importer.ssl_client_cert = input[:ssl_client_cert]
|
58
59
|
importer.ssl_client_key = input[:ssl_client_key]
|
60
|
+
importer.ssl_validation = input[:ssl_validation]
|
59
61
|
importer.download_policy = input[:download_policy] if input[:content_type] == ::Katello::Repository::YUM_TYPE
|
60
62
|
importer.remove_missing = input[:mirror_on_sync] if input[:content_type] == ::Katello::Repository::YUM_TYPE
|
61
63
|
importer
|
@@ -67,6 +69,7 @@ module Actions
|
|
67
69
|
importer.ssl_ca_cert = input[:ssl_ca_cert]
|
68
70
|
importer.ssl_client_cert = input[:ssl_client_cert]
|
69
71
|
importer.ssl_client_key = input[:ssl_client_key]
|
72
|
+
importer.ssl_validation = input[:ssl_validation]
|
70
73
|
importer
|
71
74
|
end
|
72
75
|
|
@@ -76,7 +79,7 @@ module Actions
|
|
76
79
|
importer.ssl_ca_cert = input[:ssl_ca_cert]
|
77
80
|
importer.ssl_client_cert = input[:ssl_client_cert]
|
78
81
|
importer.ssl_client_key = input[:ssl_client_key]
|
79
|
-
|
82
|
+
importer.ssl_validation = input[:ssl_validation]
|
80
83
|
importer
|
81
84
|
end
|
82
85
|
|
@@ -85,6 +88,7 @@ module Actions
|
|
85
88
|
importer.upstream_name = input[:docker_upstream_name] if input[:docker_upstream_name]
|
86
89
|
importer.feed = input[:feed]
|
87
90
|
importer.enable_v1 = false
|
91
|
+
importer.ssl_validation = input[:ssl_validation]
|
88
92
|
importer
|
89
93
|
end
|
90
94
|
|
@@ -39,7 +39,8 @@ module Actions
|
|
39
39
|
def update_or_associate_distributors(capsule_id, repository, repository_details)
|
40
40
|
concurrence do
|
41
41
|
existing_distributors = repository_details["distributors"]
|
42
|
-
|
42
|
+
capsule = capsule_id ? SmartProxy.find(capsule_id) : nil
|
43
|
+
repository.generate_distributors(capsule).each do |distributor|
|
43
44
|
found = existing_distributors.find { |i| i['distributor_type_id'] == distributor.type_id }
|
44
45
|
if found
|
45
46
|
plan_action(::Actions::Pulp::Repository::RefreshDistributor,
|
@@ -64,7 +65,8 @@ module Actions
|
|
64
65
|
def remove_unnecessary_distributors(capsule_id, repository, repository_details)
|
65
66
|
concurrence do
|
66
67
|
existing_distributors = repository_details["distributors"]
|
67
|
-
|
68
|
+
capsule = capsule_id ? SmartProxy.find(capsule_id) : nil
|
69
|
+
generated_distributors = repository.generate_distributors(capsule)
|
68
70
|
existing_distributors.each do |distributor|
|
69
71
|
found = generated_distributors.find { |dist| dist.type_id == distributor['distributor_type_id'] }
|
70
72
|
unless found
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Actions
|
2
|
+
module Pulp
|
3
|
+
module Repository
|
4
|
+
class RemoveFile < Pulp::Repository::AbstractRemoveContent
|
5
|
+
def content_extension
|
6
|
+
pulp_extensions.file
|
7
|
+
end
|
8
|
+
|
9
|
+
def criteria
|
10
|
+
super.merge(fields: { :unit => ::Katello::Pulp::FileUnit::PULP_SELECT_FIELDS})
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -28,6 +28,8 @@ module Actions
|
|
28
28
|
|
29
29
|
sync_options[:feed] = input[:source_url] if input[:source_url]
|
30
30
|
|
31
|
+
sync_options[:remove_missing] = input[:remove_missing] if input.key? :remove_missing
|
32
|
+
|
31
33
|
sync_options[:validate] = !(SETTINGS[:katello][:pulp][:skip_checksum_validation])
|
32
34
|
|
33
35
|
output[:pulp_tasks] = pulp_tasks =
|
@@ -86,7 +88,7 @@ module Actions
|
|
86
88
|
elsif repo.try(:yum?)
|
87
89
|
Presenters::YumPresenter.new(self)
|
88
90
|
elsif repo.try(:file?)
|
89
|
-
Presenters::
|
91
|
+
Presenters::FileUnitPresenter.new(self)
|
90
92
|
elsif repo.try(:docker?)
|
91
93
|
Presenters::DockerPresenter.new(self)
|
92
94
|
elsif repo.try(:ostree?)
|
data/app/lib/katello/errors.rb
CHANGED
@@ -92,7 +92,7 @@ module Katello
|
|
92
92
|
# as the message set it
|
93
93
|
def self.from_exception(exception)
|
94
94
|
error_data = MultiJson.load(exception.response)
|
95
|
-
if display_message = error_data["displayMessage"]
|
95
|
+
if (display_message = error_data["displayMessage"])
|
96
96
|
self.new(display_message).tap { |e| exception.set_backtrace(e.backtrace) }
|
97
97
|
end
|
98
98
|
rescue StandardError
|
@@ -518,6 +518,11 @@ module Katello
|
|
518
518
|
self.delete(path(id), self.default_headers).code.to_i
|
519
519
|
end
|
520
520
|
|
521
|
+
def entitlements(pool_id)
|
522
|
+
entitlement_json = self.get("#{path(pool_id)}/entitlements", self.default_headers).body
|
523
|
+
JSON.parse(entitlement_json)
|
524
|
+
end
|
525
|
+
|
521
526
|
def path(id = nil)
|
522
527
|
"/candlepin/pools/#{id}"
|
523
528
|
end
|
@@ -614,6 +619,15 @@ module Katello
|
|
614
619
|
JSON.parse(Candlepin::CandlepinResource.get(path, self.default_headers).body)
|
615
620
|
end
|
616
621
|
|
622
|
+
def find_for_stacking_id(owner_key, stacking_id)
|
623
|
+
Subscription.get_for_owner(owner_key).each do |subscription|
|
624
|
+
if subscription['product']['attributes'].any? { |attr| attr['name'] == 'stacking_id' && attr['value'] == stacking_id }
|
625
|
+
return subscription['product']
|
626
|
+
end
|
627
|
+
end
|
628
|
+
nil
|
629
|
+
end
|
630
|
+
|
617
631
|
def create(attr)
|
618
632
|
JSON.parse(self.post(path, attr.to_json, self.default_headers).body).with_indifferent_access
|
619
633
|
end
|
@@ -100,8 +100,7 @@ module Katello
|
|
100
100
|
{ substitutions: substitutions_needed(real_path).join(', '),
|
101
101
|
content_url: real_path }
|
102
102
|
else
|
103
|
-
|
104
|
-
unless is_valid
|
103
|
+
unless any_valid_metadata_file?(real_path)
|
105
104
|
@resource.log :error, "No valid metadata files found for #{real_path}"
|
106
105
|
fail Errors::CdnSubstitutionError, _("%{substitutions} are not valid substitutions for %{content_url}."\
|
107
106
|
" No valid metadata files found for %{real_path}") %
|
@@ -110,6 +109,10 @@ module Katello
|
|
110
109
|
end
|
111
110
|
end
|
112
111
|
|
112
|
+
def any_valid_metadata_file?(repo_path)
|
113
|
+
['repodata/repomd.xml', 'PULP_MANIFEST', '.treeinfo', 'treeinfo'].any? { |filename| valid_path?(repo_path, filename) }
|
114
|
+
end
|
115
|
+
|
113
116
|
protected
|
114
117
|
|
115
118
|
def substitutions_needed(content_url)
|
@@ -14,7 +14,7 @@ module Katello
|
|
14
14
|
name, arch = extract_arch(name)
|
15
15
|
return unless arch
|
16
16
|
|
17
|
-
if nvre = parse_nvre(name)
|
17
|
+
if (nvre = parse_nvre(name))
|
18
18
|
nvre.merge(:suffix => suffix, :arch => arch).delete_if { |_k, v| v.nil? }
|
19
19
|
end
|
20
20
|
end
|
@@ -24,7 +24,7 @@ module Katello
|
|
24
24
|
def self.parse_nvre(name)
|
25
25
|
name, suffix = extract_suffix(name)
|
26
26
|
|
27
|
-
if match = NVRE_RE.match(name)
|
27
|
+
if (match = NVRE_RE.match(name))
|
28
28
|
{:suffix => suffix,
|
29
29
|
:epoch => match[1],
|
30
30
|
:name => match[2],
|
@@ -15,9 +15,6 @@ module Katello
|
|
15
15
|
has_many :key_host_collections, :class_name => "Katello::KeyHostCollection", :dependent => :destroy
|
16
16
|
has_many :host_collections, :through => :key_host_collections
|
17
17
|
|
18
|
-
has_many :system_activation_keys, :class_name => "Katello::SystemActivationKey", :dependent => :destroy
|
19
|
-
has_many :systems, :through => :system_activation_keys
|
20
|
-
|
21
18
|
has_many :pools, :through => :pool_activation_keys, :class_name => "Katello::Pool"
|
22
19
|
has_many :pool_activation_keys, :class_name => "Katello::PoolActivationKey", :dependent => :destroy, :inverse_of => :activation_key
|
23
20
|
has_many :subscription_facet_activation_keys, :class_name => "Katello::SubscriptionFacetActivationKey", :dependent => :destroy
|
@@ -129,52 +126,6 @@ module Katello
|
|
129
126
|
return consumption
|
130
127
|
end
|
131
128
|
|
132
|
-
# subscribe to each product according the entitlements remaining
|
133
|
-
# TODO: break up method
|
134
|
-
# rubocop:disable MethodLength
|
135
|
-
def subscribe_system(system)
|
136
|
-
already_subscribed = []
|
137
|
-
begin
|
138
|
-
# sanity check before we start subscribing
|
139
|
-
self.pools.each do |pool|
|
140
|
-
fail _("Pool %s has no product associated") % pool.cp_id unless pool.product_id
|
141
|
-
fail _("Unable to determine quantity for pool %s") % pool.cp_id unless pool.quantity
|
142
|
-
end
|
143
|
-
|
144
|
-
allocate = system.sockets.to_i
|
145
|
-
Rails.logger.debug "Number of sockets for registration: #{allocate}"
|
146
|
-
fail _("Number of sockets must be higher than 0 for system %s") % system.name if allocate <= 0
|
147
|
-
|
148
|
-
# we sort just to make the order deterministig.
|
149
|
-
self.pools.group_by(&:product_id).sort_by(&:first).each do |product_id, pools|
|
150
|
-
product = Product.find_by_cp_id(product_id, self.organization)
|
151
|
-
consumption = calculate_consumption(product, pools, allocate)
|
152
|
-
|
153
|
-
Rails.logger.debug "Autosubscribing pools: #{consumption.map { |pool, amount| "#{pool.cp_id} => #{amount}" }.join(", ")}"
|
154
|
-
consumption.each do |pool, amount|
|
155
|
-
Rails.logger.debug "Subscribing #{system.name} to product: #{product_id}, consuming pool #{pool.cp_id} of amount: #{amount}"
|
156
|
-
if entitlements_array = system.subscribe(pool.cp_id, amount)
|
157
|
-
# store for possible rollback
|
158
|
-
entitlements_array.each do |ent|
|
159
|
-
already_subscribed << ent['id']
|
160
|
-
end
|
161
|
-
end
|
162
|
-
end
|
163
|
-
end
|
164
|
-
rescue => e
|
165
|
-
Rails.logger.error "Autosubscription failed, rolling back: #{already_subscribed.inspect}"
|
166
|
-
already_subscribed.each do |entitlement_id|
|
167
|
-
begin
|
168
|
-
Rails.logger.debug "Rolling back: #{entitlement_id}"
|
169
|
-
system.unsubscribe(entitlement_id)
|
170
|
-
rescue => re
|
171
|
-
Rails.logger.fatal "Rollback failed, skipping: #{re.message}"
|
172
|
-
end
|
173
|
-
end
|
174
|
-
raise e
|
175
|
-
end
|
176
|
-
end
|
177
|
-
|
178
129
|
def copy(new_name)
|
179
130
|
new_key = ActivationKey.new
|
180
131
|
new_key.name = new_name
|
@@ -2,6 +2,13 @@ module Katello
|
|
2
2
|
module Authorization::ContentViewVersion
|
3
3
|
extend ActiveSupport::Concern
|
4
4
|
|
5
|
+
def all_hosts_editable?(lifecycle_environment)
|
6
|
+
total_hosts = ::Host.in_content_view_environment(:content_view => self.content_view, :lifecycle_environment => lifecycle_environment)
|
7
|
+
authorized_hosts = ::Host.authorized("view_hosts").in_content_view_environment(:content_view => self.content_view,
|
8
|
+
:lifecycle_environment => lifecycle_environment)
|
9
|
+
total_hosts.count == authorized_hosts.count
|
10
|
+
end
|
11
|
+
|
5
12
|
module ClassMethods
|
6
13
|
def readable
|
7
14
|
view_ids = ContentView.readable.collect { |v| v.id }
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Katello
|
2
2
|
class Candlepin::Content
|
3
|
-
attr_accessor :name, :id, :type, :label, :vendor, :contentUrl, :gpgUrl
|
3
|
+
attr_accessor :name, :id, :type, :label, :vendor, :contentUrl, :gpgUrl, :modifiedProductIds
|
4
4
|
|
5
5
|
def initialize(params = {})
|
6
6
|
load_attributes(params)
|
@@ -51,6 +51,8 @@ module Katello
|
|
51
51
|
end
|
52
52
|
|
53
53
|
def build_repository
|
54
|
+
certificate_and_key = get_certificate_and_key(product, @content.modifiedProductIds)
|
55
|
+
|
54
56
|
repository = Repository.new(
|
55
57
|
:environment => product.organization.library,
|
56
58
|
:product => product,
|
@@ -65,8 +67,8 @@ module Katello
|
|
65
67
|
:label => label,
|
66
68
|
:url => feed_url,
|
67
69
|
:feed_ca => ca,
|
68
|
-
:feed_cert =>
|
69
|
-
:feed_key =>
|
70
|
+
:feed_cert => certificate_and_key[:cert],
|
71
|
+
:feed_key => certificate_and_key[:key],
|
70
72
|
:content_type => katello_content_type,
|
71
73
|
:preserve_metadata => true, #preserve repo metadata when importing from cp
|
72
74
|
:unprotected => unprotected?,
|
@@ -79,6 +81,16 @@ module Katello
|
|
79
81
|
repository
|
80
82
|
end
|
81
83
|
|
84
|
+
def get_certificate_and_key(product, modified_product_ids = [])
|
85
|
+
modified_product_ids.each do |modified_product_id|
|
86
|
+
modified_product = Product.where(:cp_id => modified_product_id).first
|
87
|
+
product = modified_product if modified_product &&
|
88
|
+
modified_product.certificate &&
|
89
|
+
modified_product.key
|
90
|
+
end
|
91
|
+
{:cert => product.certificate, :key => product.key}
|
92
|
+
end
|
93
|
+
|
82
94
|
def validate!
|
83
95
|
return if katello_content_type == Repository::OSTREE_TYPE
|
84
96
|
substitutor.valid_substitutions(content, substitutions)
|
@@ -6,7 +6,6 @@ module Katello
|
|
6
6
|
included do
|
7
7
|
belongs_to :capsule, :inverse_of => :containers, :foreign_key => :capsule_id,
|
8
8
|
:class_name => "SmartProxy"
|
9
|
-
attr_accessible :capsule_id
|
10
9
|
|
11
10
|
alias_method_chain :repository_pull_url, :katello
|
12
11
|
end
|
@@ -15,7 +14,7 @@ module Katello
|
|
15
14
|
repo_url = repository_pull_url_without_katello
|
16
15
|
if Repository.where(:pulp_id => repository_name).count > 0
|
17
16
|
manifest_capsule = self.capsule || CapsuleContent.default_capsule.capsule
|
18
|
-
"#{URI(manifest_capsule.url).hostname}
|
17
|
+
"#{URI(manifest_capsule.url).hostname}:#{Setting['pulp_docker_registry_port']}/#{repo_url}"
|
19
18
|
else
|
20
19
|
repo_url
|
21
20
|
end
|
@@ -30,7 +30,6 @@ module Katello
|
|
30
30
|
scoped_search :in => :applicable_errata, :on => :errata_id, :rename => :installable_errata, :complete_value => true, :ext_method => :find_by_installable_errata
|
31
31
|
|
32
32
|
accepts_nested_attributes_for :content_facet, :reject_if => proc { |attributes| attributes['content_view_id'].blank? && attributes['lifecycle_environment_id'].blank? }
|
33
|
-
attr_accessible :content_facet_attributes
|
34
33
|
end
|
35
34
|
|
36
35
|
module ClassMethods
|
@@ -53,6 +52,17 @@ module Katello
|
|
53
52
|
{ :conditions => "#{::Host::Managed.table_name}.id IN (#{facets.pluck(:host_id).join(',')})" }
|
54
53
|
end
|
55
54
|
end
|
55
|
+
|
56
|
+
def in_content_view_environment(content_view: nil, lifecycle_environment: nil)
|
57
|
+
relation = self.joins(:content_facet)
|
58
|
+
relation = relation.where("#{::Katello::Host::ContentFacet.table_name}.content_view_id" => content_view) if content_view
|
59
|
+
relation = relation.where("#{::Katello::Host::ContentFacet.table_name}.lifecycle_environment_id" => lifecycle_environment) if lifecycle_environment
|
60
|
+
relation
|
61
|
+
end
|
62
|
+
|
63
|
+
def in_environment(lifecycle_environment)
|
64
|
+
in_content_view_environment(:lifecycle_environment => lifecycle_environment)
|
65
|
+
end
|
56
66
|
end
|
57
67
|
end
|
58
68
|
end
|
@@ -7,11 +7,9 @@ module Katello
|
|
7
7
|
|
8
8
|
included do
|
9
9
|
alias_method_chain :validate_media?, :capsule
|
10
|
-
alias_method_chain :
|
10
|
+
alias_method_chain :inherited_attributes, :katello
|
11
11
|
alias_method_chain :info, :katello
|
12
12
|
alias_method_chain :smart_proxy_ids, :katello
|
13
|
-
has_one :content_host, :class_name => "Katello::System", :foreign_key => :host_id,
|
14
|
-
:dependent => :destroy, :inverse_of => :foreman_host
|
15
13
|
belongs_to :content_source, :class_name => "::SmartProxy", :foreign_key => :content_source_id, :inverse_of => :hosts
|
16
14
|
|
17
15
|
has_many :host_installed_packages, :class_name => "::Katello::HostInstalledPackage", :foreign_key => :host_id, :dependent => :destroy
|
@@ -27,8 +25,6 @@ module Katello
|
|
27
25
|
scoped_search :in => :host_collections, :on => :name, :complete_value => true, :rename => :host_collection
|
28
26
|
scoped_search :in => :installed_packages, :on => :nvra, :complete_value => true, :rename => :installed_package
|
29
27
|
scoped_search :in => :installed_packages, :on => :name, :complete_value => true, :rename => :installed_package_name
|
30
|
-
|
31
|
-
attr_accessible :content_source_id, :host_collection_ids
|
32
28
|
end
|
33
29
|
|
34
30
|
def validate_media_with_capsule?
|
@@ -78,14 +74,9 @@ module Katello
|
|
78
74
|
content_facet.lifecycle_environment_id == self.environment.try(:lifecycle_environment).try(:id)
|
79
75
|
end
|
80
76
|
|
81
|
-
def
|
82
|
-
|
83
|
-
|
84
|
-
self.content_facet.kickstart_repository_id ||= hostgroup.inherited_kickstart_repository_id
|
85
|
-
end
|
86
|
-
assign_hostgroup_attributes(%w(content_source_id content_view_id lifecycle_environment_id environment_id))
|
87
|
-
end
|
88
|
-
set_hostgroup_defaults_without_katello_attributes
|
77
|
+
def inherited_attributes_with_katello
|
78
|
+
self.content_facet.kickstart_repository_id ||= hostgroup.inherited_kickstart_repository_id if content_facet.present?
|
79
|
+
inherited_attributes_without_katello.concat(%w(content_source_id content_view_id lifecycle_environment_id))
|
89
80
|
end
|
90
81
|
|
91
82
|
def import_package_profile(simple_packages)
|