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,42 +0,0 @@
|
|
1
|
-
module Katello
|
2
|
-
module SystemPackagesHelper
|
3
|
-
def adding_package
|
4
|
-
_("Adding Package...")
|
5
|
-
end
|
6
|
-
|
7
|
-
def updating_package
|
8
|
-
_("Updating Package...")
|
9
|
-
end
|
10
|
-
|
11
|
-
def removing_package
|
12
|
-
_("Removing Package...")
|
13
|
-
end
|
14
|
-
|
15
|
-
def adding_package_group
|
16
|
-
_("Adding Package Group...")
|
17
|
-
end
|
18
|
-
|
19
|
-
def removing_package_group
|
20
|
-
_("Removing Package Group...")
|
21
|
-
end
|
22
|
-
|
23
|
-
def get_status_string(type)
|
24
|
-
case type
|
25
|
-
when "package_install"
|
26
|
-
adding_package
|
27
|
-
when "package_update"
|
28
|
-
updating_package
|
29
|
-
when "package_remove"
|
30
|
-
removing_package
|
31
|
-
when "package_group_install"
|
32
|
-
adding_package_group
|
33
|
-
when "package_group_remove"
|
34
|
-
removing_package_group
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
def row_shading
|
39
|
-
@shading = cycle("", "alt")
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
@@ -1,61 +0,0 @@
|
|
1
|
-
module Actions
|
2
|
-
module Katello
|
3
|
-
module Repository
|
4
|
-
class IncrementalImport < Actions::EntryAction
|
5
|
-
middleware.use Actions::Middleware::KeepCurrentUser
|
6
|
-
|
7
|
-
input_format do
|
8
|
-
param :id, Integer
|
9
|
-
end
|
10
|
-
|
11
|
-
# @param repo
|
12
|
-
# @param import_location location of files to import
|
13
|
-
def plan(repo, import_location)
|
14
|
-
action_subject(repo)
|
15
|
-
|
16
|
-
rpm_files = Dir.glob(File.join(import_location, "*rpm"))
|
17
|
-
|
18
|
-
rpm_filepaths = rpm_files.collect do |filepath|
|
19
|
-
{path: filepath, filename: File.basename(filepath)}
|
20
|
-
end
|
21
|
-
|
22
|
-
json_files = Dir.glob(File.join(import_location, "*json"))
|
23
|
-
pulp_units = json_files.map { |json_file| JSON.parse(File.read(json_file)) }
|
24
|
-
errata = pulp_units.select { |pulp_unit| erratum? pulp_unit }
|
25
|
-
|
26
|
-
sequence do
|
27
|
-
# NB: UploadFiles may time out during plan phase, it copies
|
28
|
-
# everything to /tmp. It is better to just have Pulp generate
|
29
|
-
# incrementals in the same way it publishes normally, vs optimizing
|
30
|
-
# this call. https://pulp.plan.io/issues/1543
|
31
|
-
plan_action(Katello::Repository::UploadFiles, repo, rpm_filepaths)
|
32
|
-
plan_action(Katello::Repository::UploadErrata, repo, errata)
|
33
|
-
end
|
34
|
-
|
35
|
-
plan_self
|
36
|
-
end
|
37
|
-
|
38
|
-
def run
|
39
|
-
# Assume contents changed. This type of upload does not need the same
|
40
|
-
# level of optimization as sync because it is not called frequently.
|
41
|
-
output[:contents_changed] = true
|
42
|
-
end
|
43
|
-
|
44
|
-
def rescue_strategy
|
45
|
-
Dynflow::Action::Rescue::Skip
|
46
|
-
end
|
47
|
-
|
48
|
-
private
|
49
|
-
|
50
|
-
def erratum?(obj)
|
51
|
-
# There is no metadata that says "this json is an erratum" so you
|
52
|
-
# have to use this heuristic. Returns true if erratum fields are
|
53
|
-
# present, false otherwise
|
54
|
-
obj.try(:[], 'unit_key').try(:[], 'id') &&
|
55
|
-
obj.try(:[], 'unit_metadata').try(:[], 'type') &&
|
56
|
-
obj.try(:[], 'unit_metadata').try(:[], 'issued')
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|
@@ -1,26 +0,0 @@
|
|
1
|
-
module Actions
|
2
|
-
module Katello
|
3
|
-
module Subscription
|
4
|
-
class Subscribe < Actions::Base
|
5
|
-
def plan(system_id, cp_id, quantity)
|
6
|
-
plan_self(:user_id => ::User.current.id,
|
7
|
-
:quantity => quantity,
|
8
|
-
:cp_id => cp_id,
|
9
|
-
:system_id => system_id)
|
10
|
-
end
|
11
|
-
|
12
|
-
def run
|
13
|
-
::User.current = User.find(input[:user_id])
|
14
|
-
::Katello::System.find(input[:system_id]).subscribe(input[:cp_id], input[:quantity])
|
15
|
-
end
|
16
|
-
|
17
|
-
def finalize
|
18
|
-
::User.current = User.find(input[:user_id])
|
19
|
-
::Katello::Pool.find_by(:cp_id => input[:cp_id]).import_data
|
20
|
-
ensure
|
21
|
-
::User.current = nil
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
module Actions
|
2
|
-
module Katello
|
3
|
-
module System
|
4
|
-
class Destroy < Actions::EntryAction
|
5
|
-
middleware.use ::Actions::Middleware::RemoteAction
|
6
|
-
|
7
|
-
def plan(system, options = {})
|
8
|
-
plan_action(Katello::Host::Destroy, system.foreman_host, options)
|
9
|
-
end
|
10
|
-
|
11
|
-
def humanized_name
|
12
|
-
_("Destroy Content Host")
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
module Actions
|
2
|
-
module Katello
|
3
|
-
module System
|
4
|
-
class Reassign < Actions::Base
|
5
|
-
def plan(system, content_view_id, environment_id)
|
6
|
-
system.foreman_host.content_facet.content_view = ::Katello::ContentView.find(content_view_id)
|
7
|
-
system.foreman_host.content_facet.lifecycle_environment = ::Katello::KTEnvironment.find(environment_id)
|
8
|
-
|
9
|
-
plan_action(::Actions::Katello::Host::Update, system.foreman_host)
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
@@ -1,53 +0,0 @@
|
|
1
|
-
module Katello
|
2
|
-
module Authorization::System
|
3
|
-
extend ActiveSupport::Concern
|
4
|
-
|
5
|
-
include Authorizable
|
6
|
-
|
7
|
-
def readable?
|
8
|
-
authorized?(:view_content_hosts)
|
9
|
-
end
|
10
|
-
|
11
|
-
def editable?
|
12
|
-
authorized?(:edit_content_hosts)
|
13
|
-
end
|
14
|
-
|
15
|
-
def deletable?
|
16
|
-
authorized?(:destroy_content_hosts)
|
17
|
-
end
|
18
|
-
|
19
|
-
module ClassMethods
|
20
|
-
def readable_search_filters(_org)
|
21
|
-
{:or => [
|
22
|
-
{:terms => {:environment_id => KTEnvironment.readable.pluck(:id) }}
|
23
|
-
]
|
24
|
-
}
|
25
|
-
end
|
26
|
-
|
27
|
-
def readable
|
28
|
-
authorized(:view_content_hosts)
|
29
|
-
end
|
30
|
-
|
31
|
-
def readable?
|
32
|
-
User.current.can?(:view_content_hosts)
|
33
|
-
end
|
34
|
-
|
35
|
-
def editable
|
36
|
-
authorized(:edit_content_hosts)
|
37
|
-
end
|
38
|
-
|
39
|
-
def deletable
|
40
|
-
authorized(:destroy_content_hosts)
|
41
|
-
end
|
42
|
-
|
43
|
-
def any_editable?
|
44
|
-
authorized(:edit_content_hosts).count > 0
|
45
|
-
end
|
46
|
-
|
47
|
-
def all_editable?(content_view, environments)
|
48
|
-
systems_query = System.where(:content_view_id => content_view, :environment_id => environments)
|
49
|
-
systems_query.count == systems_query.editable.count
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
@@ -1,386 +0,0 @@
|
|
1
|
-
module Katello
|
2
|
-
module Glue::Candlepin::Consumer
|
3
|
-
SYSTEM = "system".freeze
|
4
|
-
HYPERVISOR = "hypervisor".freeze
|
5
|
-
CANDLEPIN = "candlepin".freeze
|
6
|
-
CP_TYPES = [SYSTEM, HYPERVISOR, CANDLEPIN].freeze
|
7
|
-
|
8
|
-
# TODO: break up method
|
9
|
-
def self.included(base) # rubocop:disable MethodLength
|
10
|
-
base.send :include, LazyAccessor
|
11
|
-
base.send :include, InstanceMethods
|
12
|
-
base.send :extend, ClassMethods
|
13
|
-
|
14
|
-
base.class_eval do
|
15
|
-
lazy_accessor :href, :facts, :cp_type, :idCert, :owner, :lastCheckin, :created, :guestIds,
|
16
|
-
:installedProducts, :autoheal, :releaseVer, :serviceLevel, :capabilities, :entitlementStatus,
|
17
|
-
:initializer => :candlepin_consumer_info
|
18
|
-
|
19
|
-
lazy_accessor :candlepin_consumer_info, :initializer =>
|
20
|
-
(lambda do |_s|
|
21
|
-
if uuid
|
22
|
-
consumer_json = Resources::Candlepin::Consumer.get(uuid)
|
23
|
-
convert_from_cp_fields(consumer_json)
|
24
|
-
end
|
25
|
-
end)
|
26
|
-
|
27
|
-
lazy_accessor :entitlements, :initializer => lambda { |_s| Resources::Candlepin::Consumer.entitlements(uuid) }
|
28
|
-
lazy_accessor :pools, :initializer => lambda { |_s| entitlements.collect { |ent| Resources::Candlepin::Pool.find ent["pool"]["id"] } }
|
29
|
-
lazy_accessor :virtual_host, :initializer => (lambda do |_s|
|
30
|
-
host_attributes = Resources::Candlepin::Consumer.virtual_host(self.uuid)
|
31
|
-
(System.find_by(:uuid => host_attributes['uuid']) || System.new(host_attributes)) if host_attributes
|
32
|
-
end)
|
33
|
-
lazy_accessor :virtual_guests, :initializer => (lambda do |_s|
|
34
|
-
guests_attributes = Resources::Candlepin::Consumer.virtual_guests(self.uuid)
|
35
|
-
guests_attributes.map do |attr|
|
36
|
-
System.find_by(:uuid => attr['uuid']) || System.new(attr)
|
37
|
-
end
|
38
|
-
end)
|
39
|
-
lazy_accessor :compliance, :initializer => lambda { |_s| Resources::Candlepin::Consumer.compliance(uuid) }
|
40
|
-
lazy_accessor :events, :initializer => lambda { |_s| Resources::Candlepin::Consumer.events(uuid) }
|
41
|
-
|
42
|
-
validates :cp_type, :inclusion => {:in => CP_TYPES},
|
43
|
-
:if => :new_record?
|
44
|
-
validates :facts, :presence => true, :if => :new_record?
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
module InstanceMethods
|
49
|
-
def initialize(attrs = nil, options = {})
|
50
|
-
if attrs.nil?
|
51
|
-
super
|
52
|
-
else
|
53
|
-
type_key = attrs.key?('type') ? 'type' : :type
|
54
|
-
#rename "type" to "cp_type" (activerecord and candlepin variable name conflict)
|
55
|
-
if attrs.key?(type_key) && !(attrs.key?(:cp_type) || attrs.key?('cp_type'))
|
56
|
-
attrs[:cp_type] = attrs[type_key]
|
57
|
-
end
|
58
|
-
|
59
|
-
attrs_used_by_model = attrs.reject do |k, _v|
|
60
|
-
!self.class.column_defaults.keys.member?(k.to_s) && (!respond_to?(:"#{k.to_s}=") rescue true)
|
61
|
-
end
|
62
|
-
if attrs_used_by_model["environment"].is_a? Hash
|
63
|
-
attrs_used_by_model.delete("environment")
|
64
|
-
end
|
65
|
-
|
66
|
-
super(attrs_used_by_model, options)
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
def load_from_cp(consumer_json)
|
71
|
-
self.uuid = consumer_json[:uuid]
|
72
|
-
consumer_json[:facts] ||= {'sockets' => 0}
|
73
|
-
convert_from_cp_fields(consumer_json).each do |k, v|
|
74
|
-
instance_variable_set("@#{k}", v) if respond_to?("#{k}=")
|
75
|
-
end
|
76
|
-
end
|
77
|
-
|
78
|
-
def checkin(checkin_time)
|
79
|
-
Rails.logger.debug "Updating consumer check-in time: #{name}"
|
80
|
-
Resources::Candlepin::Consumer.checkin(self.uuid, checkin_time)
|
81
|
-
rescue => e
|
82
|
-
Rails.logger.error "Failed to update consumer check-in time in candlepin for #{name}: #{e}, #{e.backtrace.join("\n")}"
|
83
|
-
raise e
|
84
|
-
end
|
85
|
-
|
86
|
-
def regenerate_identity_certificates
|
87
|
-
Rails.logger.debug "Regenerating consumer identity certificates: #{name}"
|
88
|
-
Resources::Candlepin::Consumer.regenerate_identity_certificates(self.uuid)
|
89
|
-
rescue => e
|
90
|
-
Rails.logger.debug e.backtrace.join("\n\t")
|
91
|
-
raise e
|
92
|
-
end
|
93
|
-
|
94
|
-
def get_pool(id)
|
95
|
-
Resources::Candlepin::Pool.find id
|
96
|
-
rescue => e
|
97
|
-
Rails.logger.debug e.backtrace.join("\n\t")
|
98
|
-
raise e
|
99
|
-
end
|
100
|
-
|
101
|
-
def subscribe(pool, quantity = nil)
|
102
|
-
quantity = quantity.to_i unless quantity.nil?
|
103
|
-
Rails.logger.debug "Subscribing to pool '#{pool}' for : #{name}"
|
104
|
-
Resources::Candlepin::Consumer.consume_entitlement self.uuid, pool, quantity
|
105
|
-
rescue => e
|
106
|
-
Rails.logger.debug e.backtrace.join("\n\t")
|
107
|
-
raise e
|
108
|
-
end
|
109
|
-
|
110
|
-
def export
|
111
|
-
Rails.logger.debug "Exporting manifest"
|
112
|
-
Resources::Candlepin::Consumer.export self.uuid
|
113
|
-
rescue => e
|
114
|
-
Rails.logger.debug e.backtrace.join("\n\t")
|
115
|
-
raise e
|
116
|
-
end
|
117
|
-
|
118
|
-
def to_json(options = {})
|
119
|
-
super(options.merge(:methods => [:href, :facts, :idCert, :owner, :autoheal, :release, :releaseVer, :checkin_time,
|
120
|
-
:installedProducts, :capabilities]))
|
121
|
-
end
|
122
|
-
|
123
|
-
def convert_from_cp_fields(cp_json)
|
124
|
-
cp_json.merge!(:cp_type => cp_json.delete(:type)[:label]) if cp_json.key?(:type)
|
125
|
-
cp_json = reject_db_columns(cp_json)
|
126
|
-
|
127
|
-
cp_json[:guestIds] = remove_hibernate_fields(cp_json[:guestIds]) if cp_json.key?(:guestIds)
|
128
|
-
cp_json[:installedProducts] = remove_hibernate_fields(cp_json[:installedProducts]) if cp_json.key?(:installedProducts)
|
129
|
-
|
130
|
-
cp_json
|
131
|
-
end
|
132
|
-
|
133
|
-
# Candlepin sends back its internal hibernate fields in the json. However it does not accept them in return
|
134
|
-
# when updating (PUT) objects.
|
135
|
-
def remove_hibernate_fields(elements)
|
136
|
-
return nil unless elements
|
137
|
-
elements.collect { |e| e.except(:id, :created, :updated) }
|
138
|
-
end
|
139
|
-
|
140
|
-
def reject_db_columns(cp_json)
|
141
|
-
cp_json.reject { |k, _v| self.class.column_defaults.keys.member?(k.to_s) }
|
142
|
-
end
|
143
|
-
|
144
|
-
def cp_environment_id
|
145
|
-
if self.content_view
|
146
|
-
self.content_view.cp_environment_id(self.environment)
|
147
|
-
else
|
148
|
-
self.environment_id
|
149
|
-
end
|
150
|
-
end
|
151
|
-
|
152
|
-
def hostname
|
153
|
-
facts["network.hostname"]
|
154
|
-
end
|
155
|
-
|
156
|
-
def interfaces
|
157
|
-
Katello::System.interfaces(facts)
|
158
|
-
end
|
159
|
-
|
160
|
-
def ip
|
161
|
-
facts['network.ipv4_address']
|
162
|
-
end
|
163
|
-
|
164
|
-
def kernel
|
165
|
-
facts["uname.release"]
|
166
|
-
end
|
167
|
-
|
168
|
-
def arch
|
169
|
-
facts["uname.machine"] if @facts
|
170
|
-
end
|
171
|
-
|
172
|
-
def arch=(arch)
|
173
|
-
facts["uname.machine"] = arch if @facts
|
174
|
-
end
|
175
|
-
|
176
|
-
# Sockets are required to have a value in katello for searching as well as for checking subscription limits
|
177
|
-
# Force always to an integer value for consistency
|
178
|
-
def sockets
|
179
|
-
@facts ? Integer(facts["cpu.cpu_socket(s)"]) : 0
|
180
|
-
rescue
|
181
|
-
0
|
182
|
-
end
|
183
|
-
|
184
|
-
def sockets=(sock)
|
185
|
-
s = Integer(sock) rescue 0
|
186
|
-
|
187
|
-
facts["cpu.cpu_socket(s)"] = s if @facts
|
188
|
-
end
|
189
|
-
|
190
|
-
def virtual_guest
|
191
|
-
::Foreman::Cast.to_bool(facts["virt.is_guest"])
|
192
|
-
end
|
193
|
-
|
194
|
-
def virtual_guest=(val)
|
195
|
-
facts["virt.is_guest"] = val if @facts
|
196
|
-
end
|
197
|
-
|
198
|
-
def name=(val)
|
199
|
-
super(val)
|
200
|
-
facts["network.hostname"] = val if @facts
|
201
|
-
end
|
202
|
-
|
203
|
-
def distribution_name
|
204
|
-
facts["distribution.name"]
|
205
|
-
end
|
206
|
-
|
207
|
-
def distribution_version
|
208
|
-
facts["distribution.version"]
|
209
|
-
end
|
210
|
-
|
211
|
-
def distribution
|
212
|
-
"#{distribution_name} #{distribution_version}"
|
213
|
-
end
|
214
|
-
|
215
|
-
def memory
|
216
|
-
if facts
|
217
|
-
mem = facts["memory.memtotal"]
|
218
|
-
# dmi.memory.size is on older clients
|
219
|
-
mem ||= facts["dmi.memory.size"]
|
220
|
-
else
|
221
|
-
mem = '0'
|
222
|
-
end
|
223
|
-
memory_in_gigabytes(mem.to_s)
|
224
|
-
end
|
225
|
-
|
226
|
-
def memory=(mem)
|
227
|
-
mem = "#{mem.to_i} MB"
|
228
|
-
facts["memory.memtotal"] = mem
|
229
|
-
end
|
230
|
-
|
231
|
-
def entitlements_valid?
|
232
|
-
"true" == facts["system.entitlements_valid"]
|
233
|
-
end
|
234
|
-
|
235
|
-
def checkin_time
|
236
|
-
if lastCheckin
|
237
|
-
convert_time(lastCheckin)
|
238
|
-
end
|
239
|
-
end
|
240
|
-
|
241
|
-
def created_time
|
242
|
-
if created
|
243
|
-
convert_time(created)
|
244
|
-
end
|
245
|
-
end
|
246
|
-
|
247
|
-
def convert_time(item)
|
248
|
-
Time.parse(item)
|
249
|
-
end
|
250
|
-
|
251
|
-
def release
|
252
|
-
if self.releaseVer.is_a? Hash
|
253
|
-
self.releaseVer["releaseVer"]
|
254
|
-
else
|
255
|
-
self.releaseVer
|
256
|
-
end
|
257
|
-
end
|
258
|
-
|
259
|
-
def memory_in_gigabytes(mem_str)
|
260
|
-
# convert total memory into gigabytes
|
261
|
-
return 0 if mem_str.nil?
|
262
|
-
mem, unit = mem_str.split
|
263
|
-
total_mem = mem.to_f
|
264
|
-
case unit
|
265
|
-
when 'B' then total_mem = 0
|
266
|
-
when 'kB' then total_mem = 0
|
267
|
-
when 'MB' then total_mem /= 1024
|
268
|
-
when 'GB' then total_mem *= 1
|
269
|
-
when 'TB' then total_mem *= 1024
|
270
|
-
# default memtotal is in kB
|
271
|
-
else total_mem = (total_mem / (1024 * 1024))
|
272
|
-
end
|
273
|
-
total_mem.round(2)
|
274
|
-
end
|
275
|
-
|
276
|
-
def set_content_override(content_label, name, value = nil)
|
277
|
-
Resources::Candlepin::Consumer.update_content_override(self.uuid, content_label, name, value)
|
278
|
-
end
|
279
|
-
|
280
|
-
def content_overrides
|
281
|
-
Resources::Candlepin::Consumer.content_overrides(self.uuid)
|
282
|
-
end
|
283
|
-
|
284
|
-
def compliant?
|
285
|
-
self.compliance['compliant']
|
286
|
-
end
|
287
|
-
|
288
|
-
# As a convenience and common terminology
|
289
|
-
def compliance_color
|
290
|
-
return 'green' if self.compliance['status'] == 'valid'
|
291
|
-
return 'red' if self.compliance['status'] == 'invalid'
|
292
|
-
return 'yellow' if self.compliance['status'] == 'partial'
|
293
|
-
return 'red'
|
294
|
-
end
|
295
|
-
|
296
|
-
def compliant_until
|
297
|
-
if self.compliance['compliantUntil']
|
298
|
-
Date.parse(self.compliance['compliantUntil'])
|
299
|
-
end
|
300
|
-
end
|
301
|
-
|
302
|
-
def product_compliance_color(product_id)
|
303
|
-
return 'green' if self.compliance['compliantProducts'].include? product_id
|
304
|
-
return 'yellow' if self.compliance['partiallyCompliantProducts'].include? product_id
|
305
|
-
return 'red'
|
306
|
-
end
|
307
|
-
|
308
|
-
def import_candlepin_tasks
|
309
|
-
self.events.each do |event|
|
310
|
-
event_status = {:task_id => event[:id],
|
311
|
-
:state => event[:type],
|
312
|
-
:start_time => event[:timestamp],
|
313
|
-
:finish_time => event[:timestamp],
|
314
|
-
:progress => "100",
|
315
|
-
:result => event[:messageText]}
|
316
|
-
unless self.task_statuses.where('katello_task_statuses.uuid' => event_status[:task_id]).exists?
|
317
|
-
TaskStatus.make(self, event_status, :candlepin_event, :event => event)
|
318
|
-
end
|
319
|
-
end
|
320
|
-
end
|
321
|
-
|
322
|
-
def populate_from(candlepin_systems)
|
323
|
-
found = candlepin_systems.find { |system| system['uuid'] == self.uuid }
|
324
|
-
prepopulate(found.with_indifferent_access) if found
|
325
|
-
!found.nil?
|
326
|
-
end
|
327
|
-
|
328
|
-
def products
|
329
|
-
pool_ids = self.entitlements.map { |entitlement| entitlement['pool']['id'] }
|
330
|
-
Katello::Product.joins(:subscriptions => :pools).where("#{Katello::Pool.table_name}.cp_id" => pool_ids).enabled.uniq
|
331
|
-
end
|
332
|
-
|
333
|
-
def find_entitlement(pool_id)
|
334
|
-
entitlements = self.entitlements.collect { |ent| ent['id'] if ent["pool"]["id"] == pool_id }
|
335
|
-
entitlements.compact!
|
336
|
-
entitlements.first
|
337
|
-
end
|
338
|
-
end
|
339
|
-
|
340
|
-
module ClassMethods
|
341
|
-
def prepopulate!(systems)
|
342
|
-
uuids = systems.collect { |system| [:uuid, system.uuid] }
|
343
|
-
items = Resources::Candlepin::Consumer.get(uuids)
|
344
|
-
systems.each { |system| system.populate_from(items) }
|
345
|
-
end
|
346
|
-
|
347
|
-
def all_by_pool(pool_id)
|
348
|
-
entitlements = Resources::Candlepin::Entitlement.get
|
349
|
-
system_uuids = entitlements.delete_if { |ent| ent["pool"]["id"] != pool_id }.map { |ent| ent["consumer"]["uuid"] }
|
350
|
-
return where(:uuid => system_uuids)
|
351
|
-
end
|
352
|
-
|
353
|
-
def all_by_pool_uuid(pool_id)
|
354
|
-
entitlements = Resources::Candlepin::Entitlement.get
|
355
|
-
system_uuids = entitlements.delete_if { |ent| ent["pool"]["id"] != pool_id }.map { |ent| ent["consumer"]["uuid"] }
|
356
|
-
return system_uuids
|
357
|
-
end
|
358
|
-
|
359
|
-
# interface listings come in the form of
|
360
|
-
#
|
361
|
-
# net.interface.em1.ipv4_address
|
362
|
-
# net.interface.eth0.ipv4_broadcast
|
363
|
-
#
|
364
|
-
# there are multiple entries for each interface, but
|
365
|
-
# we only need the ipv4 and mac addresses
|
366
|
-
def interfaces(facts)
|
367
|
-
interfaces = []
|
368
|
-
facts.keys.each do |key|
|
369
|
-
match = /net\.interface\.([^\.]*)/.match(key)
|
370
|
-
if !match.nil? && !match[1].nil?
|
371
|
-
interfaces << match[1]
|
372
|
-
end
|
373
|
-
end
|
374
|
-
interface_set = []
|
375
|
-
interfaces.uniq.each do |interface|
|
376
|
-
addr = facts["net.interface.#{interface}.ipv4_address"]
|
377
|
-
# older subman versions report .ipaddr
|
378
|
-
addr ||= facts["net.interface.#{interface}.ipaddr"]
|
379
|
-
mac = facts["net.interface.#{interface}.mac_address"]
|
380
|
-
interface_set << { :name => interface, :addr => addr, :mac => mac } if !addr.nil? || !mac.nil?
|
381
|
-
end
|
382
|
-
interface_set
|
383
|
-
end
|
384
|
-
end
|
385
|
-
end
|
386
|
-
end
|