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
@@ -1,171 +0,0 @@
|
|
1
|
-
module Katello
|
2
|
-
module Glue::Pulp::Consumer
|
3
|
-
def self.included(base)
|
4
|
-
base.send :include, InstanceMethods
|
5
|
-
base.send :include, LazyAccessor
|
6
|
-
|
7
|
-
base.class_eval do
|
8
|
-
lazy_accessor :pulp_facts, :initializer => lambda { |_s| Katello.pulp_server.extensions.consumer.retrieve(uuid) }
|
9
|
-
lazy_accessor :package_profile, :initializer => lambda { |_s| fetch_package_profile }
|
10
|
-
lazy_accessor :simple_packages, :initializer => (lambda do |_s|
|
11
|
-
fetch_package_profile["profile"].
|
12
|
-
collect { |package| Katello::Pulp::SimplePackage.new(package) }
|
13
|
-
end)
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
module InstanceMethods
|
18
|
-
def bound_node_repos
|
19
|
-
bindings(Runcible::Models::NodesHttpDistributor.type_id)
|
20
|
-
end
|
21
|
-
|
22
|
-
def bindings(type_id)
|
23
|
-
bindings = Katello.pulp_server.extensions.consumer.retrieve_bindings(uuid)
|
24
|
-
bindings.select { |b| b['type_id'] == type_id }.collect { |repo| repo["repo_id"] }
|
25
|
-
end
|
26
|
-
|
27
|
-
def enable_node_repos(repo_ids)
|
28
|
-
enable_repos(Runcible::Models::NodesHttpDistributor.type_id, bound_node_repos, repo_ids,
|
29
|
-
:notify_agent => false, :binding_config => {:strategy => 'mirror'})
|
30
|
-
end
|
31
|
-
|
32
|
-
def pulp_bound_yum_repositories
|
33
|
-
bindings(Runcible::Models::YumDistributor.type_id)
|
34
|
-
end
|
35
|
-
|
36
|
-
# Binds and unbinds distributors of a certain type across repos
|
37
|
-
def enable_repos(distributor_type, existing_ids, update_ids, bind_options = {})
|
38
|
-
# calculate repoids to bind/unbind
|
39
|
-
bound_ids = existing_ids
|
40
|
-
intersection = update_ids & bound_ids
|
41
|
-
bind_ids = update_ids - intersection
|
42
|
-
unbind_ids = bound_ids - intersection
|
43
|
-
|
44
|
-
Rails.logger.debug "Bound repo ids: #{bound_ids.inspect}"
|
45
|
-
Rails.logger.debug "Update repo ids: #{update_ids.inspect}"
|
46
|
-
Rails.logger.debug "Repo ids to bind: #{bind_ids.inspect}"
|
47
|
-
Rails.logger.debug "Repo ids to unbind: #{unbind_ids.inspect}"
|
48
|
-
|
49
|
-
error_ids = unbind_repo_ids(unbind_ids, distributor_type)
|
50
|
-
error_ids += bind_repo_ids(bind_ids, distributor_type, bind_options)
|
51
|
-
error_ids
|
52
|
-
end
|
53
|
-
|
54
|
-
def unbind_repo_ids(repo_ids, distributor_type)
|
55
|
-
error_ids = []
|
56
|
-
|
57
|
-
repo_ids.each do |repo_id|
|
58
|
-
begin
|
59
|
-
Katello.pulp_server.extensions.consumer.unbind_all(uuid, repo_id, distributor_type)
|
60
|
-
rescue => e
|
61
|
-
Rails.logger.error "Failed to unbind repo #{repo_id}: #{e}, #{e.backtrace.join("\n")}"
|
62
|
-
error_ids << repo_id
|
63
|
-
end
|
64
|
-
end
|
65
|
-
error_ids
|
66
|
-
end
|
67
|
-
|
68
|
-
def bind_repo_ids(repo_ids, distributor_type, bind_options)
|
69
|
-
error_ids = []
|
70
|
-
|
71
|
-
repo_ids.each do |repo_id|
|
72
|
-
begin
|
73
|
-
Katello.pulp_server.extensions.consumer.bind_all(uuid, repo_id, distributor_type, bind_options)
|
74
|
-
rescue => e
|
75
|
-
Rails.logger.error "Failed to bind repo #{repo_id}: #{e}, #{e.backtrace.join("\n")}"
|
76
|
-
error_ids << repo_id
|
77
|
-
end
|
78
|
-
end
|
79
|
-
error_ids
|
80
|
-
end
|
81
|
-
|
82
|
-
def pulp_errata_uuids
|
83
|
-
response = Katello.pulp_server.extensions.consumer.applicable_errata([self.uuid])
|
84
|
-
return [] if response.empty?
|
85
|
-
response[0]['applicability']['erratum'] || []
|
86
|
-
end
|
87
|
-
|
88
|
-
def del_pulp_consumer
|
89
|
-
Rails.logger.debug "Deleting consumer in pulp: #{self.name}"
|
90
|
-
Katello.pulp_server.extensions.consumer.delete(self.uuid)
|
91
|
-
rescue => e
|
92
|
-
Rails.logger.error "Failed to delete pulp consumer #{self.name}: #{e}, #{e.backtrace.join("\n")}"
|
93
|
-
raise e
|
94
|
-
end
|
95
|
-
|
96
|
-
def update_pulp_consumer
|
97
|
-
return true if @changed_attributes.empty?
|
98
|
-
|
99
|
-
Rails.logger.debug "Updating consumer in pulp: #{self.name}"
|
100
|
-
Katello.pulp_server.extensions.consumer.update(self.uuid, :display_name => self.name)
|
101
|
-
rescue => e
|
102
|
-
Rails.logger.error "Failed to update pulp consumer #{self.name}: #{e}, #{e.backtrace.join("\n")}"
|
103
|
-
raise e
|
104
|
-
end
|
105
|
-
|
106
|
-
def install_package(packages)
|
107
|
-
Rails.logger.debug "Scheduling package install for consumer #{self.name}"
|
108
|
-
Katello.pulp_server.extensions.consumer.install_content(self.uuid, 'rpm', packages, "importkeys" => true)
|
109
|
-
rescue => e
|
110
|
-
Rails.logger.error "Failed to schedule package install for pulp consumer #{self.name}: #{e}, #{e.backtrace.join("\n")}"
|
111
|
-
raise e
|
112
|
-
end
|
113
|
-
|
114
|
-
def uninstall_package(packages)
|
115
|
-
Rails.logger.debug "Scheduling package uninstall for consumer #{self.name}"
|
116
|
-
Katello.pulp_server.extensions.consumer.uninstall_content(self.uuid, 'rpm', packages)
|
117
|
-
rescue => e
|
118
|
-
Rails.logger.error "Failed to schedule package uninstall for pulp consumer #{self.name}: #{e}, #{e.backtrace.join("\n")}"
|
119
|
-
raise e
|
120
|
-
end
|
121
|
-
|
122
|
-
def update_package(packages)
|
123
|
-
Rails.logger.debug "Scheduling package update for consumer #{self.name}"
|
124
|
-
options = {"importkeys" => true}
|
125
|
-
options[:all] = true if packages.blank?
|
126
|
-
Katello.pulp_server.extensions.consumer.update_content(self.uuid, 'rpm', packages, options)
|
127
|
-
rescue => e
|
128
|
-
Rails.logger.error "Failed to schedule package update for pulp consumer #{self.name}: #{e}, #{e.backtrace.join("\n")}"
|
129
|
-
raise e
|
130
|
-
end
|
131
|
-
|
132
|
-
def install_package_group(groups)
|
133
|
-
Rails.logger.debug "Scheduling package group install for consumer #{self.name}"
|
134
|
-
Katello.pulp_server.extensions.consumer.install_content(self.uuid, 'package_group', groups, "importkeys" => true)
|
135
|
-
rescue => e
|
136
|
-
Rails.logger.error "Failed to schedule package group install for pulp consumer #{self.name}: #{e}, #{e.backtrace.join("\n")}"
|
137
|
-
raise e
|
138
|
-
end
|
139
|
-
|
140
|
-
def uninstall_package_group(groups)
|
141
|
-
Rails.logger.debug "Scheduling package group uninstall for consumer #{self.name}"
|
142
|
-
Katello.pulp_server.extensions.consumer.uninstall_content(self.uuid, 'package_group', groups)
|
143
|
-
rescue => e
|
144
|
-
Rails.logger.error "Failed to schedule package group uninstall for pulp consumer #{self.name}: #{e}, #{e.backtrace.join("\n")}"
|
145
|
-
raise e
|
146
|
-
end
|
147
|
-
|
148
|
-
def install_consumer_errata(errata_ids)
|
149
|
-
Rails.logger.debug "Scheduling errata install for consumer #{self.name}"
|
150
|
-
Katello.pulp_server.extensions.consumer.install_content(self.uuid, 'erratum', errata_ids, "importkeys" => true)
|
151
|
-
rescue => e
|
152
|
-
Rails.logger.error "Failed to schedule errata install for pulp consumer #{self.name}: #{e}, #{e.backtrace.join("\n")}"
|
153
|
-
raise e
|
154
|
-
end
|
155
|
-
|
156
|
-
def katello_agent_installed?
|
157
|
-
return false if self.is_a? Hypervisor
|
158
|
-
simple_packages.any? { |package| package.name == "katello-agent" }
|
159
|
-
end
|
160
|
-
|
161
|
-
private
|
162
|
-
|
163
|
-
def fetch_package_profile
|
164
|
-
Katello.pulp_server.extensions.consumer.retrieve_profile(uuid, 'rpm')
|
165
|
-
rescue RestClient::ResourceNotFound => e
|
166
|
-
Rails.logger.info "Failed to find profile for #{uuid}: #{e}}"
|
167
|
-
{:profile => []}.with_indifferent_access
|
168
|
-
end
|
169
|
-
end
|
170
|
-
end
|
171
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
module Katello
|
2
|
-
class Hypervisor < System
|
3
|
-
validates_lengths_from_database
|
4
|
-
|
5
|
-
UNSUPPORTED_ACTIONS = [:package_profile, :pulp_facts, :simple_packages, :errata, :del_pulp_consumer, :set_pulp_consumer,
|
6
|
-
:update_pulp_consumer, :upload_package_profile, :install_package, :uninstall_package,
|
7
|
-
:update_package, :install_package_group, :uninstall_package_group].freeze
|
8
|
-
|
9
|
-
UNSUPPORTED_ACTIONS.each do |unsupported_action|
|
10
|
-
define_method(unsupported_action) do
|
11
|
-
fail Errors::UnsupportedActionException.new(unsupported_action, self, _("Hypervisor does not support this action"))
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
@@ -1,283 +0,0 @@
|
|
1
|
-
module Katello
|
2
|
-
class System < Katello::Model
|
3
|
-
self.include_root_in_json = false
|
4
|
-
|
5
|
-
include ForemanTasks::Concerns::ActionSubject
|
6
|
-
include Glue::Candlepin::Consumer if SETTINGS[:katello][:use_cp]
|
7
|
-
include Glue::Pulp::Consumer if SETTINGS[:katello][:use_pulp]
|
8
|
-
include Glue if SETTINGS[:katello][:use_cp] || SETTINGS[:katello][:use_pulp]
|
9
|
-
include Authorization::System
|
10
|
-
|
11
|
-
audited :on => [:create], :allow_mass_assignment => true
|
12
|
-
|
13
|
-
belongs_to :environment, :class_name => "Katello::KTEnvironment", :inverse_of => :systems
|
14
|
-
belongs_to :foreman_host, :class_name => "::Host::Managed", :foreign_key => :host_id, :inverse_of => :content_host
|
15
|
-
|
16
|
-
has_many :bound_repositories, :through => :system_repositories, :class_name => "Katello::Repository", :source => :repository
|
17
|
-
has_many :system_repositories, :class_name => "Katello::SystemRepository", :dependent => :destroy, :inverse_of => :system
|
18
|
-
|
19
|
-
has_many :task_statuses, :class_name => "Katello::TaskStatus", :as => :task_owner, :dependent => :destroy
|
20
|
-
has_many :system_activation_keys, :class_name => "Katello::SystemActivationKey", :dependent => :destroy
|
21
|
-
has_many :activation_keys, :through => :system_activation_keys
|
22
|
-
|
23
|
-
has_many :host_collection_hosts, :through => :foreman_host, :class_name => "::Katello::HostCollectionHosts",
|
24
|
-
:foreign_key => :host_id
|
25
|
-
has_many :host_collections, :through => :host_collection_hosts, :foreign_key => :host_id
|
26
|
-
|
27
|
-
has_many :audits, :class_name => "::Audit", :as => :auditable, :dependent => :destroy
|
28
|
-
|
29
|
-
belongs_to :content_view, :inverse_of => :systems
|
30
|
-
|
31
|
-
validates_lengths_from_database
|
32
|
-
before_validation :set_default_content_view, :unless => :persisted?
|
33
|
-
validates :environment, :presence => true
|
34
|
-
validates :content_view, :presence => true, :allow_blank => false
|
35
|
-
validates_with Validators::NoTrailingSpaceValidator, :attributes => :name
|
36
|
-
validates :location, :length => {:maximum => 255}
|
37
|
-
validates_with Validators::ContentViewEnvironmentValidator
|
38
|
-
validates_with Validators::KatelloNameFormatValidator, :attributes => :name
|
39
|
-
|
40
|
-
before_create :fill_defaults
|
41
|
-
|
42
|
-
scope :in_environment, ->(env) { where('environment_id = ?', env) unless env.nil? }
|
43
|
-
scope :by_uuids, ->(uuids) { where(:uuid => uuids) }
|
44
|
-
|
45
|
-
scoped_search :on => :name, :complete_value => true
|
46
|
-
scoped_search :in => :activation_keys, :on => :name, :complete_value => true, :rename => :activation_key
|
47
|
-
scoped_search :in => :content_view, :on => :name, :complete_value => true, :rename => :content_view
|
48
|
-
scoped_search :in => :fact_values, :on => :value, :in_key => :fact_names, :on_key => :name, :rename => :facts, :complete_value => true,
|
49
|
-
:only_explicit => true, :ext_method => :search_cast_facts
|
50
|
-
scoped_search :in => :foreman_host, :on => :name, :complete_value => true, :rename => :host
|
51
|
-
scoped_search :in => :environment, :on => :name, :complete_value => true, :rename => :environment
|
52
|
-
# scoped_search :in => :host_collections, :on => :name, :rename => :host_collection, :complete_value => true,
|
53
|
-
# :ext_method => :search_host_collections
|
54
|
-
scoped_search :in => :host_collections, :on => :name, :rename => :host_collection, :complete_value => true
|
55
|
-
has_many :fact_values, :through => :foreman_host
|
56
|
-
has_many :fact_names, :through => :fact_values
|
57
|
-
|
58
|
-
def self.in_organization(organization)
|
59
|
-
where(:environment_id => organization.kt_environments.pluck(:id))
|
60
|
-
end
|
61
|
-
|
62
|
-
def self.uuids_to_ids(uuids)
|
63
|
-
systems = by_uuids(uuids)
|
64
|
-
ids_not_found = Set.new(uuids).subtract(systems.pluck(:uuid))
|
65
|
-
fail Errors::NotFound, _("Systems [%s] not found.") % ids_not_found.to_a.join(',') unless ids_not_found.blank?
|
66
|
-
systems.pluck(:id)
|
67
|
-
end
|
68
|
-
|
69
|
-
def registered_by
|
70
|
-
audits.first.try(:username) unless activation_keys.length > 0
|
71
|
-
end
|
72
|
-
|
73
|
-
class << self
|
74
|
-
def architectures
|
75
|
-
{ 'i386' => 'x86', 'ia64' => 'Itanium', 'x86_64' => 'x86_64', 'ppc' => 'PowerPC',
|
76
|
-
's390' => 'IBM S/390', 's390x' => 'IBM System z', 'sparc64' => 'SPARC Solaris',
|
77
|
-
'i686' => 'i686'}
|
78
|
-
end
|
79
|
-
|
80
|
-
def virtualized
|
81
|
-
{ "physical" => N_("Physical"), "virtualized" => N_("Virtual") }
|
82
|
-
end
|
83
|
-
end
|
84
|
-
|
85
|
-
delegate :organization, to: :environment
|
86
|
-
|
87
|
-
def consumed_pool_ids
|
88
|
-
self.pools.collect { |t| t['id'] }
|
89
|
-
end
|
90
|
-
|
91
|
-
def available_releases
|
92
|
-
self.content_view.version(self.environment).available_releases
|
93
|
-
end
|
94
|
-
|
95
|
-
def consumed_pool_ids=(attributes)
|
96
|
-
attribs_to_unsub = consumed_pool_ids - attributes
|
97
|
-
attribs_to_unsub.each do |id|
|
98
|
-
self.unsubscribe id
|
99
|
-
end
|
100
|
-
|
101
|
-
attribs_to_sub = attributes - consumed_pool_ids
|
102
|
-
attribs_to_sub.each do |id|
|
103
|
-
self.subscribe id
|
104
|
-
end
|
105
|
-
end
|
106
|
-
|
107
|
-
def save_bound_repos_by_path!(paths)
|
108
|
-
repos = []
|
109
|
-
paths.each do |path|
|
110
|
-
possible_repos = Repository.where(:relative_path => path.gsub('/pulp/repos/', ''))
|
111
|
-
if possible_repos.empty?
|
112
|
-
Rails.logger.warn("System #{self.name} (#{self.id}) requested binding to unknown repo #{path}")
|
113
|
-
else
|
114
|
-
repos << possible_repos.first
|
115
|
-
Rails.logger.warn("System #{self.name} (#{self.id}) requested binding to path #{path} matching \
|
116
|
-
#{possible_repos.size} repositories.") if possible_repos.size > 1
|
117
|
-
end
|
118
|
-
end
|
119
|
-
|
120
|
-
self.bound_repositories = repos
|
121
|
-
self.save!
|
122
|
-
end
|
123
|
-
|
124
|
-
def install_packages(packages)
|
125
|
-
pulp_task = self.install_package(packages)
|
126
|
-
save_task_status(pulp_task, :package_install, :packages, packages)
|
127
|
-
end
|
128
|
-
|
129
|
-
def uninstall_packages(packages)
|
130
|
-
pulp_task = self.uninstall_package(packages)
|
131
|
-
save_task_status(pulp_task, :package_remove, :packages, packages)
|
132
|
-
end
|
133
|
-
|
134
|
-
def update_packages(packages = nil)
|
135
|
-
# if no packages are provided, a full system update will be performed (e.g ''yum update' equivalent)
|
136
|
-
pulp_task = self.update_package(packages)
|
137
|
-
save_task_status(pulp_task, :package_update, :packages, packages)
|
138
|
-
end
|
139
|
-
|
140
|
-
def install_package_groups(groups)
|
141
|
-
pulp_task = self.install_package_group(groups)
|
142
|
-
save_task_status(pulp_task, :package_group_install, :groups, groups)
|
143
|
-
end
|
144
|
-
|
145
|
-
def uninstall_package_groups(groups)
|
146
|
-
pulp_task = self.uninstall_package_group(groups)
|
147
|
-
save_task_status(pulp_task, :package_group_remove, :groups, groups)
|
148
|
-
end
|
149
|
-
|
150
|
-
def as_json(options)
|
151
|
-
json = super(options)
|
152
|
-
json['environment'] = environment.as_json unless environment.nil?
|
153
|
-
json['activation_key'] = activation_keys.as_json unless activation_keys.nil?
|
154
|
-
|
155
|
-
json['content_view'] = content_view.as_json if content_view
|
156
|
-
json['ipv4_address'] = facts.try(:[], 'network.ipv4_address') if respond_to?(:facts)
|
157
|
-
|
158
|
-
if respond_to?(:virtual_guest)
|
159
|
-
if self.virtual_guest == 'true'
|
160
|
-
json['virtual_host'] = self.virtual_host.attributes if self.virtual_host
|
161
|
-
else
|
162
|
-
json['virtual_guests'] = self.virtual_guests.map(&:attributes)
|
163
|
-
end
|
164
|
-
end
|
165
|
-
|
166
|
-
if options[:expanded]
|
167
|
-
json['editable'] = editable?
|
168
|
-
json['type'] = type
|
169
|
-
end
|
170
|
-
|
171
|
-
json
|
172
|
-
end
|
173
|
-
|
174
|
-
def hypervisor?
|
175
|
-
self.is_a? Hypervisor
|
176
|
-
end
|
177
|
-
|
178
|
-
def system_type
|
179
|
-
if respond_to?(:virtual_guest) && virtual_guest
|
180
|
-
_("Virtual Guest")
|
181
|
-
else
|
182
|
-
case self
|
183
|
-
when Hypervisor
|
184
|
-
_("Hypervisor")
|
185
|
-
else
|
186
|
-
_("Host")
|
187
|
-
end
|
188
|
-
end
|
189
|
-
end
|
190
|
-
|
191
|
-
def refresh_tasks
|
192
|
-
refresh_running_tasks
|
193
|
-
import_candlepin_tasks
|
194
|
-
end
|
195
|
-
|
196
|
-
def tasks
|
197
|
-
refresh_tasks
|
198
|
-
self.task_statuses
|
199
|
-
end
|
200
|
-
|
201
|
-
def reportable_data(options = {})
|
202
|
-
hash = self.as_json(options.slice(:only, :except))
|
203
|
-
if options[:methods]
|
204
|
-
options[:methods].each { |method| hash[method] = self.send(method) }
|
205
|
-
end
|
206
|
-
hash.with_indifferent_access
|
207
|
-
end
|
208
|
-
|
209
|
-
def self.available_locks
|
210
|
-
[:read, :write]
|
211
|
-
end
|
212
|
-
|
213
|
-
def related_resources
|
214
|
-
self.organization
|
215
|
-
end
|
216
|
-
|
217
|
-
def to_action_input
|
218
|
-
super.merge(uuid => uuid)
|
219
|
-
end
|
220
|
-
|
221
|
-
def available_content
|
222
|
-
self.products.flat_map(&:available_content)
|
223
|
-
end
|
224
|
-
|
225
|
-
def self.search_host_collections(_key, operator, value)
|
226
|
-
conditions = sanitize_sql_for_conditions(["#{Katello::HostCollection.table_name}.name #{operator} '#{value}'"])
|
227
|
-
systems_matching_query = Katello::System.joins("INNER JOIN #{Katello::HostCollectionHosts.table_name} ON \
|
228
|
-
(#{Katello::HostCollectionHosts.table_name}.host_id = #{Katello::System.table_name}.host_id)").
|
229
|
-
joins("INNER JOIN #{Katello::HostCollection.table_name} ON \
|
230
|
-
(#{Katello::HostCollectionHosts.table_name}.host_collection_id = #{Katello::HostCollection.table_name}.id)").
|
231
|
-
where(conditions).select("id").to_sql
|
232
|
-
{ :conditions => "#{Katello::System.table_name}.id in (#{systems_matching_query})", :include => :host_collections }
|
233
|
-
end
|
234
|
-
|
235
|
-
def self.search_cast_facts(key, operator, value)
|
236
|
-
{
|
237
|
-
:conditions => "fact_names.name = '#{key.split('.')[1]}' AND #{cast_facts(key, operator, value)}",
|
238
|
-
:include => :fact_names
|
239
|
-
}
|
240
|
-
end
|
241
|
-
|
242
|
-
def self.cast_facts(_key, operator, value)
|
243
|
-
is_int = (value =~ /\A[-+]?\d+\z/) || value.is_a?(Integer)
|
244
|
-
is_pg = ActiveRecord::Base.connection.adapter_name.downcase.starts_with? 'postgresql'
|
245
|
-
# Once Postgresql 8 support is removed (used in CentOS 6), this could be replaced to only keep the first form (working well with PG 9)
|
246
|
-
if (is_int && !is_pg)
|
247
|
-
casted = "CAST(fact_values.value AS DECIMAL) #{operator} #{value}"
|
248
|
-
elsif (is_int && is_pg && operator !~ /LIKE/i)
|
249
|
-
casted = "fact_values.value ~ E'^\\\\d+$' AND CAST(fact_values.value AS DECIMAL) #{operator} #{value}"
|
250
|
-
else
|
251
|
-
casted = "fact_values.value #{operator} '#{value}'"
|
252
|
-
end
|
253
|
-
casted
|
254
|
-
end
|
255
|
-
|
256
|
-
def self.humanize_class_name(_name = nil)
|
257
|
-
_('Content Host')
|
258
|
-
end
|
259
|
-
|
260
|
-
private
|
261
|
-
|
262
|
-
def refresh_running_tasks
|
263
|
-
ids = self.task_statuses.where(:state => [:waiting, :running]).pluck(:id)
|
264
|
-
TaskStatus.refresh(ids)
|
265
|
-
end
|
266
|
-
|
267
|
-
def save_task_status(pulp_task, task_type, parameters_type, parameters)
|
268
|
-
TaskStatus.make(self, pulp_task, task_type, parameters_type => parameters)
|
269
|
-
end
|
270
|
-
|
271
|
-
def fill_defaults
|
272
|
-
self.location = _("None") unless self.location
|
273
|
-
end
|
274
|
-
|
275
|
-
def set_default_content_view
|
276
|
-
self.content_view = self.environment.try(:default_content_view) unless self.content_view
|
277
|
-
end
|
278
|
-
|
279
|
-
def collect_installed_product_names
|
280
|
-
self.installedProducts ? self.installedProducts.map { |p| p[:productName] } : []
|
281
|
-
end
|
282
|
-
end
|
283
|
-
end
|