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
@@ -0,0 +1,19 @@
|
|
1
|
+
module Katello
|
2
|
+
module Concerns
|
3
|
+
module HostsAndHostgroupsHelperExtensions
|
4
|
+
extend ActiveSupport::Concern
|
5
|
+
|
6
|
+
included do
|
7
|
+
alias_method_chain :puppet_environment_field, :katello
|
8
|
+
end
|
9
|
+
|
10
|
+
def puppet_environment_field_with_katello(form, environments_choice, select_options = {}, html_options = {})
|
11
|
+
html_options.merge!(
|
12
|
+
:label => _("Puppet Environment"),
|
13
|
+
'data-content_puppet_match' => (@host || @hostgroup).new_record? || (@host || @hostgroup).content_and_puppet_match?,
|
14
|
+
:help_inline => link_to(_("Reset Puppet Environment to match selected Content View"), '#', :id => 'reset_puppet_environment'))
|
15
|
+
puppet_environment_field_without_katello(form, environments_choice, select_options, html_options)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -69,12 +69,17 @@ module Actions
|
|
69
69
|
def reindex_consumer(message)
|
70
70
|
if message.content['newEntity']
|
71
71
|
uuid = JSON.parse(message.content['newEntity'])['consumer']['uuid']
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
72
|
+
skip_msg = "skip re-indexing of non-existent content host #{uuid}"
|
73
|
+
begin
|
74
|
+
subscription_facet = ::Katello::Host::SubscriptionFacet.find_by_uuid(uuid)
|
75
|
+
if subscription_facet.nil?
|
76
|
+
@logger.debug "skip re-indexing of non-existent registered host #{uuid}"
|
77
|
+
else
|
78
|
+
@logger.debug "re-indexing content host #{subscription_facet.host.name}"
|
79
|
+
subscription_facet.update_subscription_status
|
80
|
+
end
|
81
|
+
rescue RestClient::ResourceNotFound, RestClient::Gone
|
82
|
+
@logger.debug(skip_msg)
|
78
83
|
end
|
79
84
|
end
|
80
85
|
end
|
@@ -17,7 +17,7 @@ module Actions
|
|
17
17
|
|
18
18
|
def create_repo_in_pulp(capsule_content, repository)
|
19
19
|
ueber_cert = ::Cert::Certs.ueber_cert(repository.organization)
|
20
|
-
relative_path = repository_relative_path(repository)
|
20
|
+
relative_path = repository_relative_path(repository, capsule_content)
|
21
21
|
checksum_type = repository.yum? ? repository.checksum_type : nil
|
22
22
|
|
23
23
|
plan_action(Pulp::Repository::Create,
|
@@ -37,9 +37,9 @@ module Actions
|
|
37
37
|
capsule_id: capsule_content.capsule.id)
|
38
38
|
end
|
39
39
|
|
40
|
-
def repository_relative_path(repository)
|
40
|
+
def repository_relative_path(repository, capsule_content)
|
41
41
|
if repository.is_a? ::Katello::ContentViewPuppetEnvironment
|
42
|
-
repository.generate_puppet_path
|
42
|
+
repository.generate_puppet_path(capsule_content.capsule)
|
43
43
|
elsif repository.puppet? && (repository.is_a? ::Katello::Repository)
|
44
44
|
nil
|
45
45
|
else
|
@@ -27,17 +27,31 @@ module Actions
|
|
27
27
|
need_updates.each do |repo|
|
28
28
|
plan_action(Pulp::Repository::Refresh, repo, capsule_id: capsule_content.capsule.id)
|
29
29
|
end
|
30
|
-
|
31
30
|
plan_action(ConfigureCapsule, capsule_content, environment, content_view)
|
31
|
+
sync_repos_to_capsule(capsule_content, repository_ids)
|
32
|
+
plan_action(RemoveOrphans, :capsule_id => capsule_content.capsule.id)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
32
36
|
|
33
|
-
|
34
|
-
|
35
|
-
|
37
|
+
def sync_repos_to_capsule(capsule_content, repository_ids)
|
38
|
+
concurrence do
|
39
|
+
repository_ids.each do |repo_id|
|
40
|
+
sequence do
|
41
|
+
repo = ::Katello::Repository.where(:pulp_id => repo_id).first ||
|
42
|
+
::Katello::ContentViewPuppetEnvironment.where(:pulp_id => repo_id).first
|
43
|
+
if repo && repo.content_type != "yum"
|
44
|
+
# we unassociate units in non-yum repos in order to avoid version conflicts
|
45
|
+
# during publish. (i.e. two versions of a puppet module in the same repo)
|
46
|
+
plan_action(Pulp::Consumer::UnassociateUnits,
|
36
47
|
capsule_id: capsule_content.capsule.id,
|
37
48
|
repo_pulp_id: repo_id)
|
38
49
|
end
|
50
|
+
|
51
|
+
plan_action(Pulp::Consumer::SyncCapsule,
|
52
|
+
capsule_id: capsule_content.capsule.id,
|
53
|
+
repo_pulp_id: repo_id)
|
39
54
|
end
|
40
|
-
plan_action(RemoveOrphans, :capsule_id => capsule_content.capsule.id)
|
41
55
|
end
|
42
56
|
end
|
43
57
|
end
|
@@ -65,13 +79,13 @@ module Actions
|
|
65
79
|
(need_distributor_update + need_importer_update).uniq
|
66
80
|
end
|
67
81
|
|
68
|
-
def repos_needing_distributor_updates(
|
69
|
-
repos =
|
82
|
+
def repos_needing_distributor_updates(capsule_content, environment, content_view)
|
83
|
+
repos = capsule_content.repos_available_to_capsule(environment, content_view)
|
70
84
|
repos.select do |repo|
|
71
|
-
repo_details =
|
85
|
+
repo_details = capsule_content.pulp_repo_facts(repo.pulp_id)
|
72
86
|
next unless repo_details
|
73
87
|
capsule_distributors = repo_details["distributors"]
|
74
|
-
!repo.distributors_match?(capsule_distributors)
|
88
|
+
!repo.distributors_match?(capsule_distributors, capsule_content.capsule)
|
75
89
|
end
|
76
90
|
end
|
77
91
|
|
@@ -4,7 +4,7 @@ module Actions
|
|
4
4
|
class AddToEnvironment < Actions::Base
|
5
5
|
def plan(content_view_version, environment)
|
6
6
|
content_view = content_view_version.content_view
|
7
|
-
if cve = content_view.content_view_environment(environment)
|
7
|
+
if (cve = content_view.content_view_environment(environment))
|
8
8
|
content_view_version.content_view_environments << cve
|
9
9
|
else
|
10
10
|
cve = content_view.add_environment(environment, content_view_version)
|
@@ -11,10 +11,10 @@ module Actions
|
|
11
11
|
|
12
12
|
content_view = ::Katello::ContentView.find(input[:content_view])
|
13
13
|
environment = ::Katello::KTEnvironment.find(input[:environment])
|
14
|
-
users = ::User.select { |user| user.receives?(:
|
14
|
+
users = ::User.select { |user| user.receives?(:promote_errata) && user.can?(:view_content_views, content_view) }
|
15
15
|
|
16
16
|
begin
|
17
|
-
MailNotification[:
|
17
|
+
MailNotification[:promote_errata].deliver_now(:users => users, :content_view => content_view, :environment => environment) unless users.blank?
|
18
18
|
rescue => e
|
19
19
|
message = _('Unable to send errata e-mail notification: %{error}' % {:error => e})
|
20
20
|
Rails.logger.error(message)
|
@@ -67,7 +67,66 @@ module Actions
|
|
67
67
|
end
|
68
68
|
|
69
69
|
def humanized_name
|
70
|
-
|
70
|
+
total_count = total_counts(input)
|
71
|
+
_("Incremental Update of %{content_view_count} Content View Version(s) " %
|
72
|
+
{:content_view_count => total_count[:content_view_count]}) + content_output(total_count)
|
73
|
+
end
|
74
|
+
|
75
|
+
def total_counts(input)
|
76
|
+
total_count = {}
|
77
|
+
if input[:version_outputs]
|
78
|
+
content_view_count = input[:version_outputs].length
|
79
|
+
input[:version_outputs].map do |version_output|
|
80
|
+
added_units = version_output.try(:[], :output).try(:[], :added_units)
|
81
|
+
if added_units
|
82
|
+
total_count[:errata_count] = added_units[:erratum].try(:count)
|
83
|
+
total_count[:rpm_count] = added_units[:rpm].try(:count)
|
84
|
+
total_count[:puppet_module_count] = added_units[:puppet_module].try(:count)
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
total_count[:content_view_count] = content_view_count
|
89
|
+
total_count
|
90
|
+
end
|
91
|
+
|
92
|
+
def content_output(total_count)
|
93
|
+
content = content_output_collection(total_count)
|
94
|
+
if content.count >= 1
|
95
|
+
message_output = _("with")
|
96
|
+
if content.count == 1
|
97
|
+
message_output + content[0]
|
98
|
+
else
|
99
|
+
message_output += content.pop
|
100
|
+
while content.count > 0
|
101
|
+
if content.count == 1
|
102
|
+
message_output = message_output + _(", and") + content.pop
|
103
|
+
else
|
104
|
+
message_output = message_output + "," + content.pop
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
else
|
109
|
+
message_output = ""
|
110
|
+
end
|
111
|
+
message_output
|
112
|
+
end
|
113
|
+
|
114
|
+
def content_output_collection(total_count)
|
115
|
+
content = []
|
116
|
+
if total_count[:errata_count] && total_count[:errata_count] > 0
|
117
|
+
errata = _(" %{errata_count} Errata" % {:errata_count => total_count[:errata_count]})
|
118
|
+
content << errata
|
119
|
+
end
|
120
|
+
if total_count[:rpm_count] && total_count[:rpm_count] > 0
|
121
|
+
rpm = _(" %{package_count} Package(s)" % {:package_count => total_count[:rpm_count]})
|
122
|
+
content << rpm
|
123
|
+
end
|
124
|
+
if total_count[:puppet_module_count] && total_count[:puppet_module_count] > 0
|
125
|
+
puppet_module = _(" %{puppet_module_count} Puppet Module(s)" %
|
126
|
+
{:puppet_module_count => total_count[:puppet_module_count]})
|
127
|
+
content << puppet_module
|
128
|
+
end
|
129
|
+
content
|
71
130
|
end
|
72
131
|
|
73
132
|
def presenter
|
@@ -28,7 +28,7 @@ module Actions
|
|
28
28
|
unless organization_destroy
|
29
29
|
concurrence do
|
30
30
|
all_cv_envs.each do |cv_env|
|
31
|
-
if cv_env.
|
31
|
+
if cv_env.hosts.any? || cv_env.activation_keys.any?
|
32
32
|
plan_action(ContentViewEnvironment::ReassignObjects, cv_env, options)
|
33
33
|
end
|
34
34
|
end
|
@@ -95,7 +95,7 @@ module Actions
|
|
95
95
|
end
|
96
96
|
all_cv_envs = combined_cv_envs(cv_envs, versions)
|
97
97
|
|
98
|
-
if all_cv_envs.flat_map(&:
|
98
|
+
if all_cv_envs.flat_map(&:hosts).any? && system_cve(options).nil?
|
99
99
|
fail _("Unable to reassign systems. Please check system_content_view_id and system_environment_id.")
|
100
100
|
end
|
101
101
|
|
@@ -20,7 +20,7 @@ module Actions
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
-
if puppet_env = content_view.puppet_env(environment)
|
23
|
+
if (puppet_env = content_view.puppet_env(environment))
|
24
24
|
plan_action(Actions::Foreman::Environment::Destroy, puppet_env.puppet_environment) if puppet_env.puppet_environment
|
25
25
|
plan_action(ContentViewPuppetEnvironment::Destroy, puppet_env) unless organization_destroy
|
26
26
|
end
|
@@ -4,8 +4,8 @@ module Actions
|
|
4
4
|
class ReassignObjects < Actions::Base
|
5
5
|
def plan(content_view_environment, options)
|
6
6
|
concurrence do
|
7
|
-
content_view_environment.
|
8
|
-
plan_action(
|
7
|
+
content_view_environment.hosts.each do |host|
|
8
|
+
plan_action(Host::Reassign, host, options[:system_content_view_id], options[:system_environment_id])
|
9
9
|
end
|
10
10
|
|
11
11
|
content_view_environment.activation_keys.each do |key|
|
@@ -3,11 +3,13 @@ module Actions
|
|
3
3
|
module ContentViewPuppetEnvironment
|
4
4
|
class Create < Actions::EntryAction
|
5
5
|
def plan(puppet_environment, clone = false)
|
6
|
+
internal_capsule = SmartProxy.default_capsule
|
7
|
+
fail _("Content View %s cannot be published without an internal capsule." % puppet_environment.name) unless internal_capsule
|
6
8
|
puppet_environment.save!
|
7
9
|
action_subject(puppet_environment)
|
8
10
|
plan_self
|
9
11
|
|
10
|
-
puppet_path = puppet_environment.generate_puppet_path
|
12
|
+
puppet_path = puppet_environment.generate_puppet_path(internal_capsule)
|
11
13
|
|
12
14
|
sequence do
|
13
15
|
plan_action(Pulp::Repository::Create,
|
@@ -4,16 +4,21 @@ module Actions
|
|
4
4
|
class AttachSubscriptions < Actions::EntryAction
|
5
5
|
middleware.use Actions::Middleware::KeepCurrentUser
|
6
6
|
|
7
|
-
def plan(host,
|
7
|
+
def plan(host, pools_with_quantities_params)
|
8
8
|
action_subject(host)
|
9
|
-
|
10
9
|
sequence do
|
11
10
|
pool_ids = []
|
11
|
+
pools_with_quantities = pools_with_quantities_params.map do |pool_with_quantity|
|
12
|
+
::Katello::PoolWithQuantities.fetch(pool_with_quantity)
|
13
|
+
end
|
14
|
+
existing_pool_ids = host.subscription_facet.candlepin_consumer.pool_ids
|
12
15
|
pools_with_quantities.each do |pool_with_quantities|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
16
|
+
unless existing_pool_ids.include?(pool_with_quantities.pool.cp_id.to_s)
|
17
|
+
pool_ids << pool_with_quantities.pool.id
|
18
|
+
pool_with_quantities.quantities.each do |quantity|
|
19
|
+
plan_action(::Actions::Candlepin::Consumer::AttachSubscription, :uuid => host.subscription_facet.uuid,
|
20
|
+
:pool_uuid => pool_with_quantities.pool.cp_id, :quantity => quantity)
|
21
|
+
end
|
17
22
|
end
|
18
23
|
end
|
19
24
|
|
@@ -23,6 +28,8 @@ module Actions
|
|
23
28
|
|
24
29
|
def finalize
|
25
30
|
::Katello::Pool.where(:id => input[:pool_ids]).each(&:import_data)
|
31
|
+
host = ::Host.find_by(:id => input[:managed][:id])
|
32
|
+
host.subscription_facet.update_subscription_status
|
26
33
|
end
|
27
34
|
|
28
35
|
def rescue_strategy
|
@@ -17,11 +17,6 @@ module Actions
|
|
17
17
|
plan_action(Pulp::Consumer::Destroy, uuid: host.content_facet.uuid) if host.content_facet.try(:uuid)
|
18
18
|
end
|
19
19
|
|
20
|
-
if host.content_host
|
21
|
-
plan_self(:pool_ids => pool_ids(host))
|
22
|
-
host.content_host.destroy!
|
23
|
-
end
|
24
|
-
|
25
20
|
host.subscription_facet.try(:destroy!)
|
26
21
|
|
27
22
|
if unregistering
|
@@ -41,20 +36,6 @@ module Actions
|
|
41
36
|
end
|
42
37
|
end
|
43
38
|
|
44
|
-
def pool_ids(host)
|
45
|
-
host.content_host.pools.map { |p| p["id"] }
|
46
|
-
rescue RestClient::Gone
|
47
|
-
Rails.logger.warn("Host #{host.name} (#{host.subscription_facet.uuid}) removed from candlepin.")
|
48
|
-
[]
|
49
|
-
end
|
50
|
-
|
51
|
-
def finalize
|
52
|
-
input[:pool_ids].each do |pool_id|
|
53
|
-
pool = ::Katello::Pool.where(:cp_id => pool_id).first
|
54
|
-
pool.import_data if pool
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
39
|
def humanized_name
|
59
40
|
_("Destroy Content Host")
|
60
41
|
end
|
@@ -4,17 +4,22 @@ module Actions
|
|
4
4
|
class GenerateApplicability < Actions::Base
|
5
5
|
middleware.use Actions::Middleware::KeepCurrentUser
|
6
6
|
|
7
|
-
def plan(hosts)
|
7
|
+
def plan(hosts, use_queue = true)
|
8
8
|
uuids = hosts.map { |host| host.content_facet.try(:uuid) }.compact
|
9
9
|
unless uuids.empty?
|
10
10
|
plan_action(Pulp::Consumer::GenerateApplicability, :uuids => uuids)
|
11
|
-
plan_self(:host_ids => hosts.map(&:id))
|
11
|
+
plan_self(:host_ids => hosts.map(&:id), :use_queue => use_queue)
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
15
|
def finalize
|
16
16
|
input[:host_ids].each do |host_id|
|
17
|
-
|
17
|
+
if input[:use_queue]
|
18
|
+
::Katello::EventQueue.push_event(::Katello::Events::ImportHostErrata::EVENT_TYPE, host_id)
|
19
|
+
else
|
20
|
+
host = ::Host.find(host_id)
|
21
|
+
host.content_facet.try(:import_applicability, true) if host
|
22
|
+
end
|
18
23
|
end
|
19
24
|
end
|
20
25
|
end
|
@@ -2,19 +2,27 @@ module Actions
|
|
2
2
|
module Katello
|
3
3
|
module Host
|
4
4
|
class Hypervisors < Actions::EntryAction
|
5
|
-
def plan(
|
5
|
+
def plan(hypervisor_params)
|
6
6
|
sequence do
|
7
|
-
hypervisor_results =
|
8
|
-
|
9
|
-
|
10
|
-
plan_action(Katello::Host::HypervisorsUpdate, environment, content_view, hypervisor_results.output[:results])
|
11
|
-
|
12
|
-
plan_self(:results => hypervisor_results.output[:results])
|
7
|
+
hypervisor_results = ::Katello::Resources::Candlepin::Consumer.register_hypervisors(hypervisor_params)
|
8
|
+
plan_action(Katello::Host::HypervisorsUpdate, parse_hypervisors(hypervisor_results))
|
13
9
|
end
|
14
10
|
end
|
15
11
|
|
16
|
-
def
|
17
|
-
|
12
|
+
def parse_hypervisors(hypervisor_results)
|
13
|
+
hypervisors = []
|
14
|
+
%w(created updated unchanged).each do |group|
|
15
|
+
if hypervisor_results[group]
|
16
|
+
hypervisors += hypervisor_results[group].map do |hypervisor|
|
17
|
+
{
|
18
|
+
:name => hypervisor['name'],
|
19
|
+
:uuid => hypervisor['uuid'],
|
20
|
+
:organization_label => hypervisor['owner']['key']
|
21
|
+
}
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
hypervisors
|
18
26
|
end
|
19
27
|
end
|
20
28
|
end
|
@@ -4,9 +4,8 @@ module Actions
|
|
4
4
|
class HypervisorsUpdate < Actions::EntryAction
|
5
5
|
middleware.use ::Actions::Middleware::RemoteAction
|
6
6
|
|
7
|
-
def plan(
|
8
|
-
plan_self(:
|
9
|
-
:hypervisor_results => hypervisor_results)
|
7
|
+
def plan(hypervisors)
|
8
|
+
plan_self(:hypervisors => hypervisors)
|
10
9
|
end
|
11
10
|
|
12
11
|
def run
|
@@ -14,64 +13,36 @@ module Actions
|
|
14
13
|
end
|
15
14
|
|
16
15
|
def finalize
|
17
|
-
|
18
|
-
content_view = ::Katello::ContentView.find(input[:content_view_id])
|
19
|
-
hypervisor_results = input[:hypervisor_results]
|
16
|
+
hypervisors = input[:hypervisors]
|
20
17
|
|
21
|
-
|
22
|
-
|
23
|
-
hypervisor_results[group].each do |hypervisor|
|
24
|
-
update_or_create_hypervisor(environment, content_view, hypervisor)
|
25
|
-
end
|
26
|
-
end
|
18
|
+
if hypervisors
|
19
|
+
hypervisors.each { |hypervisor| update_or_create_hypervisor(hypervisor) }
|
27
20
|
end
|
28
21
|
end
|
29
22
|
|
30
|
-
def update_or_create_hypervisor(
|
31
|
-
|
23
|
+
def update_or_create_hypervisor(hypervisor_json)
|
24
|
+
organization = ::Organization.find_by(:label => hypervisor_json[:organization_label])
|
32
25
|
|
33
26
|
# Since host names must be unique yet hypervisors may have unique subscription
|
34
27
|
# facets in different orgs
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
end
|
43
|
-
else
|
44
|
-
name = duplicate_name
|
28
|
+
sanitized_name = ::Katello::Host::SubscriptionFacet.sanitize_name(hypervisor_json[:name])
|
29
|
+
duplicate_name = "virt-who-#{sanitized_name}-#{organization.id}"
|
30
|
+
host = ::Katello::Host::SubscriptionFacet.find_by(:uuid => hypervisor_json[:uuid]).try(:host)
|
31
|
+
host ||= ::Host.find_by(:name => duplicate_name)
|
32
|
+
if host && host.organization.try(:id) != organization.id
|
33
|
+
fail _("Host '%{name}' does not belong to an organization") % {:name => host.name} unless host.organization
|
34
|
+
host = nil
|
45
35
|
end
|
46
36
|
|
47
|
-
host ||= create_host_for_hypervisor(
|
37
|
+
host ||= create_host_for_hypervisor(duplicate_name, organization)
|
48
38
|
host.subscription_facet ||= ::Katello::Host::SubscriptionFacet.new
|
49
39
|
host.subscription_facet.host_id = host.id
|
50
40
|
host.subscription_facet.update_from_consumer_attributes(hypervisor_json)
|
51
41
|
host.subscription_facet.uuid = hypervisor_json[:uuid]
|
52
42
|
host.subscription_facet.save!
|
53
|
-
|
54
|
-
# TODO: Remove this legacy
|
55
|
-
# http://projects.theforeman.org/issues/12556
|
56
|
-
unless ::Katello::Hypervisor.find_by(:name => name)
|
57
|
-
hypervisor = ::Katello::Hypervisor.new(:environment_id => environment.id,
|
58
|
-
:content_view_id => content_view.id)
|
59
|
-
hypervisor.name = name
|
60
|
-
hypervisor.cp_type = 'hypervisor'
|
61
|
-
hypervisor.orchestration_for = :hypervisor
|
62
|
-
hypervisor.load_from_cp(hypervisor_json)
|
63
|
-
hypervisor.save!
|
64
|
-
host.content_host = hypervisor
|
65
|
-
end
|
66
|
-
|
67
43
|
host.save!
|
68
44
|
end
|
69
45
|
|
70
|
-
def find_host_by_uuid_or_name(hypervisor_json)
|
71
|
-
facet = ::Katello::Host::SubscriptionFacet.find_by(:uuid => hypervisor_json[:uuid])
|
72
|
-
facet.nil? ? ::Host.find_by(:name => hypervisor_json[:name]) : facet.host
|
73
|
-
end
|
74
|
-
|
75
46
|
def create_host_for_hypervisor(name, organization, location = nil)
|
76
47
|
location ||= Location.default_location
|
77
48
|
host = ::Host::Managed.new(:name => name, :organization => organization,
|
@@ -79,6 +50,10 @@ module Actions
|
|
79
50
|
host.save!
|
80
51
|
host
|
81
52
|
end
|
53
|
+
|
54
|
+
def rescue_strategy
|
55
|
+
Dynflow::Action::Rescue::Skip
|
56
|
+
end
|
82
57
|
end
|
83
58
|
end
|
84
59
|
end
|