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
@@ -2,8 +2,8 @@ module Katello
|
|
2
2
|
class Api::V2::ContentViewFiltersController < Api::V2::ApiController
|
3
3
|
include Katello::Concerns::FilteredAutoCompleteSearch
|
4
4
|
|
5
|
-
|
6
|
-
|
5
|
+
before_action :find_content_view
|
6
|
+
before_action :find_filter, :except => [:index, :create, :auto_complete_search]
|
7
7
|
|
8
8
|
wrap_parameters :include => (ContentViewFilter.attribute_names + %w(repository_ids))
|
9
9
|
|
@@ -2,7 +2,7 @@ module Katello
|
|
2
2
|
class Api::V2::ContentViewHistoriesController < Api::V2::ApiController
|
3
3
|
include Katello::Concerns::FilteredAutoCompleteSearch
|
4
4
|
|
5
|
-
|
5
|
+
before_action :find_content_view
|
6
6
|
|
7
7
|
api :GET, "/content_views/:id/history", N_("Show a content view's history")
|
8
8
|
param :id, :number, :desc => N_("content view numeric identifier"), :required => true
|
@@ -2,8 +2,8 @@ module Katello
|
|
2
2
|
class Api::V2::ContentViewPuppetModulesController < Api::V2::ApiController
|
3
3
|
include Katello::Concerns::FilteredAutoCompleteSearch
|
4
4
|
|
5
|
-
|
6
|
-
|
5
|
+
before_action :find_content_view, :except => [:autocomplete_search]
|
6
|
+
before_action :find_content_view_puppet_module, :only => [:show, :update, :destroy]
|
7
7
|
|
8
8
|
api :GET, "/content_views/:content_view_id/content_view_puppet_modules", N_("List content view puppet modules")
|
9
9
|
param :content_view_id, :identifier, :desc => N_("content view identifier"), :required => true
|
@@ -3,13 +3,13 @@ module Katello
|
|
3
3
|
include Concerns::Api::V2::BulkHostsExtensions
|
4
4
|
include Katello::Concerns::FilteredAutoCompleteSearch
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
6
|
+
before_action :find_content_view_version, :only => [:show, :promote, :destroy, :export]
|
7
|
+
before_action :find_content_view, :except => [:incremental_update]
|
8
|
+
before_action :find_environment, :only => [:promote, :index]
|
9
|
+
before_action :authorize_promotable, :only => [:promote]
|
10
|
+
before_action :authorize_destroy, :only => [:destroy]
|
11
|
+
before_action :find_version_environments, :only => [:incremental_update]
|
12
|
+
before_action :find_puppet_module, :only => [:index]
|
13
13
|
|
14
14
|
api :GET, "/content_view_versions", N_("List content view versions")
|
15
15
|
api :GET, "/content_views/:content_view_id/content_view_versions", N_("List content view versions")
|
@@ -18,6 +18,7 @@ module Katello
|
|
18
18
|
param :puppet_module_id, :identifier, :desc => N_("Filter versions by puppet module"), :required => false
|
19
19
|
param :version, String, :desc => N_("Filter versions by version number"), :required => false
|
20
20
|
param :composite_version_id, :identifier, :desc => N_("Filter versions that are components in the specified composite version"), :required => false
|
21
|
+
param :organization_id, :identifier, :desc => N_("Organization identifier")
|
21
22
|
param_group :search, Api::V2::ApiController
|
22
23
|
def index
|
23
24
|
options = {
|
@@ -30,6 +31,7 @@ module Katello
|
|
30
31
|
def index_relation
|
31
32
|
version_number = params.permit(:version)[:version]
|
32
33
|
versions = ContentViewVersion.readable
|
34
|
+
versions = versions.with_organization_id(params[:organization_id]) if params[:organization_id]
|
33
35
|
versions = versions.where(:content_view_id => @view.id) if @view
|
34
36
|
versions = versions.for_version(version_number) if version_number
|
35
37
|
versions = versions.in_environment(@environment) if @environment
|
@@ -214,7 +216,7 @@ module Katello
|
|
214
216
|
|
215
217
|
version_environments_for_systems_map.values
|
216
218
|
else
|
217
|
-
@version_environments.select { |ve| !ve[:
|
219
|
+
@version_environments.select { |ve| !ve[:environments].blank? }
|
218
220
|
end
|
219
221
|
end
|
220
222
|
|
@@ -3,10 +3,10 @@ module Katello
|
|
3
3
|
include Concerns::Authorization::Api::V2::ContentViewsController
|
4
4
|
include Katello::Concerns::FilteredAutoCompleteSearch
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
before_action :find_content_view, :except => [:index, :create, :auto_complete_search]
|
7
|
+
before_action :find_organization, :only => [:create]
|
8
|
+
before_action :find_optional_organization, :only => [:index, :auto_complete_search]
|
9
|
+
before_action :find_environment, :only => [:index, :remove_from_environment]
|
10
10
|
|
11
11
|
wrap_parameters :include => (ContentView.attribute_names + %w(repository_ids component_ids))
|
12
12
|
|
@@ -22,7 +22,7 @@ module Katello
|
|
22
22
|
|
23
23
|
api :GET, "/organizations/:organization_id/content_views", N_("List content views")
|
24
24
|
api :GET, "/content_views", N_("List content views")
|
25
|
-
param :organization_id, :number, :desc => N_("organization identifier")
|
25
|
+
param :organization_id, :number, :desc => N_("organization identifier")
|
26
26
|
param :environment_id, :identifier, :desc => N_("environment identifier")
|
27
27
|
param :nondefault, :bool, :desc => N_("Filter out default content views")
|
28
28
|
param :noncomposite, :bool, :desc => N_("Filter out composite content views")
|
@@ -6,8 +6,8 @@ module Katello
|
|
6
6
|
description <<-DESC
|
7
7
|
# Description
|
8
8
|
|
9
|
-
An environment is a basic organization structure that groups
|
10
|
-
products, repositories, etc. Every
|
9
|
+
An environment is a basic organization structure that groups hosts,
|
10
|
+
products, repositories, etc. Every host belongs to one environment
|
11
11
|
and it's isolated inside so that it can see only content that is in its
|
12
12
|
environment.
|
13
13
|
|
@@ -34,17 +34,17 @@ module Katello
|
|
34
34
|
end
|
35
35
|
|
36
36
|
respond_to :json
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
37
|
+
before_action :find_organization, :only => [:create, :paths, :auto_complete_search]
|
38
|
+
before_action :find_optional_organization, :only => [:index, :show, :update, :destroy]
|
39
|
+
before_action :find_prior, :only => [:create]
|
40
|
+
before_action :find_environment, :only => [:show, :update, :destroy, :repositories]
|
41
|
+
before_action :find_content_view, :only => [:repositories]
|
42
42
|
|
43
43
|
wrap_parameters :include => (KTEnvironment.attribute_names + %w(prior prior_id new_name))
|
44
44
|
|
45
45
|
api :GET, "/environments", N_("List environments in an organization")
|
46
46
|
api :GET, "/organizations/:organization_id/environments", N_("List environments in an organization")
|
47
|
-
param :organization_id, :number, :desc => N_("organization identifier")
|
47
|
+
param :organization_id, :number, :desc => N_("organization identifier")
|
48
48
|
param :library, [true, false], :desc => N_("set true if you want to see only library environments")
|
49
49
|
param :name, String, :desc => N_("filter only environments containing this name")
|
50
50
|
def index
|
@@ -52,7 +52,8 @@ module Katello
|
|
52
52
|
end
|
53
53
|
|
54
54
|
def index_relation
|
55
|
-
query = KTEnvironment.readable
|
55
|
+
query = KTEnvironment.readable
|
56
|
+
query = query.where(organization: @organization) if @organization
|
56
57
|
query = query.where(:name => params[:name]) if params[:name]
|
57
58
|
query = query.where(:library => params[:library]) if params[:library]
|
58
59
|
query
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Katello
|
2
|
+
class Api::V2::FileUnitsController < Api::V2::ApiController
|
3
|
+
apipie_concern_subst(:a_resource => N_("a file"), :resource => "files")
|
4
|
+
include Katello::Concerns::Api::V2::RepositoryContentController
|
5
|
+
|
6
|
+
def default_sort
|
7
|
+
%w(name asc)
|
8
|
+
end
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
def repo_association
|
13
|
+
:repository_id
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -1,10 +1,10 @@
|
|
1
1
|
module Katello
|
2
2
|
class Api::V2::GpgKeysController < Api::V2::ApiController
|
3
3
|
include Katello::Concerns::FilteredAutoCompleteSearch
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
before_action :authorize
|
5
|
+
before_action :find_organization, :only => [:create, :index, :auto_complete_search]
|
6
|
+
before_action :find_gpg_key, :only => [:show, :update, :destroy, :content]
|
7
|
+
skip_before_action :check_content_type, :only => [:create, :content]
|
8
8
|
|
9
9
|
def_param_group :gpg_key do
|
10
10
|
param :name, :identifier, :action_aware => true, :required => true, :desc => N_("identifier of the gpg key")
|
@@ -1,9 +1,9 @@
|
|
1
1
|
module Katello
|
2
2
|
class Api::V2::HostAutocompleteController < ::Api::V2::BaseController
|
3
3
|
include ::Api::TaxonomyScope
|
4
|
-
include Foreman::Controller::AutoCompleteSearch
|
4
|
+
include ::Foreman::Controller::AutoCompleteSearch
|
5
5
|
|
6
|
-
|
6
|
+
before_action :find_optional_nested_object
|
7
7
|
|
8
8
|
resource_description do
|
9
9
|
api_version 'v2'
|
@@ -1,12 +1,12 @@
|
|
1
1
|
module Katello
|
2
2
|
class Api::V2::HostCollectionsController < Api::V2::ApiController
|
3
3
|
include Katello::Concerns::FilteredAutoCompleteSearch
|
4
|
-
|
4
|
+
before_action :find_host_collection, :only => [:copy, :show, :update, :destroy, :destroy_hosts,
|
5
5
|
:add_hosts, :remove_hosts, :hosts]
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
before_action :find_activation_key
|
7
|
+
before_action :find_host
|
8
|
+
before_action :find_optional_organization, :only => [:index]
|
9
|
+
before_action :find_organization, :only => [:create, :auto_complete_search]
|
10
10
|
|
11
11
|
wrap_parameters :include => (HostCollection.attribute_names + %w(host_ids))
|
12
12
|
|
@@ -85,18 +85,32 @@ module Katello
|
|
85
85
|
param :id, :identifier, :desc => N_("Id of the host collection"), :required => true
|
86
86
|
param :host_ids, Array, :desc => N_("Array of host ids")
|
87
87
|
def add_hosts
|
88
|
-
|
88
|
+
host_ids = params[:host_ids].map(&:to_i)
|
89
|
+
|
90
|
+
@hosts = ::Host::Managed.where(id: host_ids)
|
89
91
|
@editable_hosts = @hosts.authorized(:edit_host)
|
90
|
-
|
92
|
+
|
93
|
+
already_added_host_ids = @host_collection.host_ids & host_ids
|
94
|
+
unfound_host_ids = host_ids - @hosts.pluck(:id)
|
95
|
+
|
96
|
+
@host_collection.host_ids += @editable_hosts.pluck(:id)
|
91
97
|
@host_collection.save!
|
92
98
|
|
93
99
|
messages = format_bulk_action_messages(
|
94
100
|
:success => _("Successfully added %s Host(s)."),
|
95
101
|
:error => _("You were not allowed to add %s"),
|
96
|
-
:models => @hosts,
|
97
|
-
:authorized => @editable_hosts
|
102
|
+
:models => @hosts.pluck(:id) - already_added_host_ids,
|
103
|
+
:authorized => @editable_hosts.pluck(:id) - already_added_host_ids
|
98
104
|
)
|
99
105
|
|
106
|
+
already_added_host_ids.each do |host_id|
|
107
|
+
messages[:error] << _("Host with ID %s already exists in the host collection.") % host_id
|
108
|
+
end
|
109
|
+
|
110
|
+
unfound_host_ids.each do |host_id|
|
111
|
+
messages[:error] << _("Host with ID %s not found.") % host_id
|
112
|
+
end
|
113
|
+
|
100
114
|
respond_for_show :template => 'bulk_action', :resource_name => 'common',
|
101
115
|
:resource => { 'displayMessages' => messages }
|
102
116
|
end
|
@@ -105,18 +119,32 @@ module Katello
|
|
105
119
|
param :id, :identifier, :desc => N_("Id of the host collection"), :required => true
|
106
120
|
param :host_ids, Array, :desc => N_("Array of host ids")
|
107
121
|
def remove_hosts
|
108
|
-
|
122
|
+
host_ids = params[:host_ids].map(&:to_i)
|
123
|
+
|
124
|
+
@hosts = ::Host::Managed.where(id: host_ids)
|
109
125
|
@editable_hosts = @hosts.authorized(:edit_host)
|
110
|
-
|
126
|
+
|
127
|
+
already_removed_host_ids = @hosts.pluck(:id) - @host_collection.host_ids
|
128
|
+
unfound_host_ids = host_ids - @hosts.pluck(:id)
|
129
|
+
|
130
|
+
@host_collection.host_ids -= @editable_hosts.pluck(:id)
|
111
131
|
@host_collection.save!
|
112
132
|
|
113
133
|
messages = format_bulk_action_messages(
|
114
134
|
:success => _("Successfully removed %s Host(s)."),
|
115
135
|
:error => _("You were not allowed to sync %s"),
|
116
|
-
:models => @hosts,
|
117
|
-
:authorized => @editable_hosts
|
136
|
+
:models => @hosts.pluck(:id) - already_removed_host_ids,
|
137
|
+
:authorized => @editable_hosts.pluck(:id) - already_removed_host_ids
|
118
138
|
)
|
119
139
|
|
140
|
+
already_removed_host_ids.each do |host_id|
|
141
|
+
messages[:error] << _("Host with ID %s does not exist in the host collection.") % host_id
|
142
|
+
end
|
143
|
+
|
144
|
+
unfound_host_ids.each do |host_id|
|
145
|
+
messages[:error] << _("Host with ID %s not found.") % host_id
|
146
|
+
end
|
147
|
+
|
120
148
|
respond_for_show :template => 'bulk_action', :resource_name => 'common',
|
121
149
|
:resource => { 'displayMessages' => messages }
|
122
150
|
end
|
@@ -2,11 +2,11 @@ module Katello
|
|
2
2
|
class Api::V2::HostErrataController < Api::V2::ApiController
|
3
3
|
include Katello::Concerns::FilteredAutoCompleteSearch
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
5
|
+
before_action :find_host, :only => :index
|
6
|
+
before_action :find_host_editable, :except => :index
|
7
|
+
before_action :find_errata_ids, :only => :apply
|
8
|
+
before_action :find_environment, :only => :index
|
9
|
+
before_action :find_content_view, :only => :index
|
10
10
|
|
11
11
|
resource_description do
|
12
12
|
api_version 'v2'
|
@@ -54,6 +54,13 @@ module Katello
|
|
54
54
|
respond_for_show :resource => errata
|
55
55
|
end
|
56
56
|
|
57
|
+
api :PUT, "/hosts/:host_id/errata/applicability", N_("Force regenerate applicability.")
|
58
|
+
param :host_id, :identifier, :desc => N_("Host ID"), :required => true
|
59
|
+
def applicability
|
60
|
+
task = async_task(::Actions::Katello::Host::GenerateApplicability, [@host], false)
|
61
|
+
respond_for_async :resource => task
|
62
|
+
end
|
63
|
+
|
57
64
|
protected
|
58
65
|
|
59
66
|
def index_relation
|
@@ -2,10 +2,10 @@ module Katello
|
|
2
2
|
class Api::V2::HostPackagesController < Api::V2::ApiController
|
3
3
|
include Katello::Concerns::FilteredAutoCompleteSearch
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
before_action :require_packages_or_groups, :only => [:install, :remove]
|
6
|
+
before_action :require_packages_only, :only => [:upgrade]
|
7
|
+
before_action :find_editable_host_with_facet, :except => :index
|
8
|
+
before_action :find_host, :only => :index
|
9
9
|
|
10
10
|
resource_description do
|
11
11
|
api_version 'v2'
|
@@ -1,8 +1,8 @@
|
|
1
1
|
module Katello
|
2
2
|
class Api::V2::HostSubscriptionsController < Katello::Api::V2::ApiController
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
before_action :find_host, :except => :create
|
4
|
+
before_action :check_subscriptions, :only => [:add_subscriptions, :remove_subscriptions]
|
5
|
+
before_action :find_content_view_environment, :only => :create
|
6
6
|
|
7
7
|
def_param_group :subscription_facet_attributes do
|
8
8
|
param :release_version, String, :desc => N_("Release version for this Host to use (7Server, 7.1, etc)")
|
@@ -72,7 +72,7 @@ module Katello
|
|
72
72
|
name = rhsm_params[:facts]['network.hostname']
|
73
73
|
|
74
74
|
host = Katello::Host::SubscriptionFacet.find_or_create_host(name, @content_view_environment.environment.organization, rhsm_params)
|
75
|
-
sync_task(::Actions::Katello::Host::Register, host,
|
75
|
+
sync_task(::Actions::Katello::Host::Register, host, rhsm_params, @content_view_environment)
|
76
76
|
host.reload
|
77
77
|
::Katello::Host::SubscriptionFacet.update_facts(host, rhsm_params[:facts]) unless rhsm_params[:facts].blank?
|
78
78
|
|
@@ -107,13 +107,13 @@ module Katello
|
|
107
107
|
end
|
108
108
|
def remove_subscriptions
|
109
109
|
#combine the quantities for duplicate pools into PoolWithQuantities objects
|
110
|
-
pool_id_quantities = params
|
111
|
-
new_hash[subscription['id']] ||= PoolWithQuantities.new(Pool.
|
110
|
+
pool_id_quantities = params.require(:subscriptions).inject({}) do |new_hash, subscription|
|
111
|
+
new_hash[subscription['id']] ||= PoolWithQuantities.new(Pool.with_identifier(subscription['id']))
|
112
112
|
new_hash[subscription['id']].quantities << subscription['quantity']
|
113
113
|
new_hash
|
114
114
|
end
|
115
115
|
|
116
|
-
@host
|
116
|
+
sync_task(::Actions::Katello::Host::RemoveSubscriptions, @host, pool_id_quantities.values)
|
117
117
|
respond_for_index(:collection => index_response, :template => "index")
|
118
118
|
end
|
119
119
|
|
@@ -124,8 +124,8 @@ module Katello
|
|
124
124
|
param :quantity, :number, :desc => N_("Quantity of this subscriptions to add"), :required => true
|
125
125
|
end
|
126
126
|
def add_subscriptions
|
127
|
-
pools_with_quantities = params
|
128
|
-
PoolWithQuantities.new(Pool.
|
127
|
+
pools_with_quantities = params.require(:subscriptions).map do |sub_params|
|
128
|
+
PoolWithQuantities.new(Pool.with_identifier(sub_params['id']), sub_params['quantity'])
|
129
129
|
end
|
130
130
|
|
131
131
|
sync_task(::Actions::Katello::Host::AttachSubscriptions, @host, pools_with_quantities)
|
@@ -2,15 +2,15 @@ module Katello
|
|
2
2
|
class Api::V2::HostsBulkActionsController < Api::V2::ApiController
|
3
3
|
include Concerns::Api::V2::BulkHostsExtensions
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
5
|
+
before_action :find_host_collections, :only => [:bulk_add_host_collections, :bulk_remove_host_collections]
|
6
|
+
before_action :find_environment, :only => [:environment_content_view]
|
7
|
+
before_action :find_content_view, :only => [:environment_content_view]
|
8
|
+
before_action :find_editable_hosts, :except => [:destroy_hosts, :applicable_errata]
|
9
|
+
before_action :find_deletable_hosts, :only => [:destroy_hosts]
|
10
|
+
before_action :find_readable_hosts, :only => [:applicable_errata, :available_incremental_updates]
|
11
|
+
before_action :find_errata, :only => [:available_incremental_updates]
|
12
12
|
|
13
|
-
|
13
|
+
before_action :validate_content_action, :only => [:install_content, :update_content, :remove_content]
|
14
14
|
|
15
15
|
PARAM_ACTIONS = {
|
16
16
|
:install_content => {
|
@@ -31,11 +31,11 @@ module Katello
|
|
31
31
|
def_param_group :bulk_params do
|
32
32
|
param :organization_id, :identifier, :required => true, :desc => N_("ID of the organization")
|
33
33
|
param :included, Hash, :required => true, :action_aware => true do
|
34
|
-
param :search, String, :required => false, :desc => N_("Search string for
|
35
|
-
param :ids, Array, :required => false, :desc => N_("List of
|
34
|
+
param :search, String, :required => false, :desc => N_("Search string for hosts to perform an action on")
|
35
|
+
param :ids, Array, :required => false, :desc => N_("List of host ids to perform an action on")
|
36
36
|
end
|
37
37
|
param :excluded, Hash, :required => true, :action_aware => true do
|
38
|
-
param :ids, Array, :required => false, :desc => N_("List of
|
38
|
+
param :ids, Array, :required => false, :desc => N_("List of host ids to exclude and not run an action on")
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
@@ -86,7 +86,7 @@ module Katello
|
|
86
86
|
end
|
87
87
|
|
88
88
|
api :POST, "/hosts/bulk/applicable_errata",
|
89
|
-
N_("Fetch applicable errata for a
|
89
|
+
N_("Fetch applicable errata for a host.")
|
90
90
|
param_group :bulk_params
|
91
91
|
def installable_errata
|
92
92
|
respond_for_index(:collection => scoped_search(Katello::Erratum.installable_for_hosts(@hosts), 'updated', 'desc',
|
@@ -131,7 +131,46 @@ module Katello
|
|
131
131
|
respond_for_async :resource => task
|
132
132
|
end
|
133
133
|
|
134
|
-
api :PUT, "/hosts/bulk/
|
134
|
+
api :PUT, "/hosts/bulk/subscriptions/remove_subscriptions", N_("Remove subscriptions from one or more hosts")
|
135
|
+
param_group :bulk_params
|
136
|
+
param :subscriptions, Array, :desc => N_("Array of subscriptions to remove") do
|
137
|
+
param :id, String, :desc => N_("Subscription Pool id"), :required => true
|
138
|
+
param :quantity, Integer, :desc => N_("Quantity of specified subscription to remove"), :required => false
|
139
|
+
end
|
140
|
+
def remove_subscriptions
|
141
|
+
#combine the quantities for duplicate pools into PoolWithQuantities objects
|
142
|
+
pool_id_quantities = params.require(:subscriptions).inject({}) do |new_hash, subscription|
|
143
|
+
new_hash[subscription['id']] ||= PoolWithQuantities.new(Pool.find(subscription['id']))
|
144
|
+
new_hash[subscription['id']].quantities << subscription['quantity']
|
145
|
+
new_hash
|
146
|
+
end
|
147
|
+
task = async_task(::Actions::BulkAction, ::Actions::Katello::Host::RemoveSubscriptions, @hosts, pool_id_quantities.values)
|
148
|
+
respond_for_async :resource => task
|
149
|
+
end
|
150
|
+
|
151
|
+
api :PUT, "/hosts/bulk/subscriptions/add_subscriptions", N_("Add subscriptions to one or more hosts")
|
152
|
+
param_group :bulk_params
|
153
|
+
param :subscriptions, Array, :desc => N_("Array of subscriptions to add"), :required => true do
|
154
|
+
param :id, String, :desc => N_("Subscription Pool id"), :required => true
|
155
|
+
param :quantity, :number, :desc => N_("Quantity of this subscriptions to add"), :required => true
|
156
|
+
end
|
157
|
+
def add_subscriptions
|
158
|
+
pools_with_quantities = params.require(:subscriptions).map do |sub_params|
|
159
|
+
PoolWithQuantities.new(Pool.find(sub_params['id']), sub_params['quantity'])
|
160
|
+
end
|
161
|
+
|
162
|
+
task = async_task(::Actions::BulkAction, ::Actions::Katello::Host::AttachSubscriptions, @hosts, pools_with_quantities)
|
163
|
+
respond_for_async :resource => task
|
164
|
+
end
|
165
|
+
|
166
|
+
api :PUT, "/hosts/bulk/subscriptions/auto_attach", N_("Trigger an auto-attach of subscriptions on one or more hosts")
|
167
|
+
param_group :bulk_params
|
168
|
+
def auto_attach
|
169
|
+
task = async_task(::Actions::BulkAction, ::Actions::Katello::Host::AutoAttachSubscriptions, @hosts)
|
170
|
+
respond_for_async :resource => task
|
171
|
+
end
|
172
|
+
|
173
|
+
api :PUT, "/hosts/bulk/environment_content_view", N_("Assign the environment and content view to one or more hosts")
|
135
174
|
param_group :bulk_params
|
136
175
|
param :environment_id, Integer
|
137
176
|
param :content_view_id, Integer
|