katello 4.0.3 → 4.1.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/app/assets/javascripts/katello/hosts/host_and_hostgroup_edit.js +0 -33
- data/app/assets/stylesheets/katello/contents.scss +1 -1
- data/app/controllers/katello/api/registry/registry_proxies_controller.rb +5 -11
- data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +2 -9
- data/app/controllers/katello/api/v2/activation_keys_controller.rb +10 -24
- data/app/controllers/katello/api/v2/api_controller.rb +15 -3
- data/app/controllers/katello/api/v2/content_credentials_controller.rb +1 -1
- data/app/controllers/katello/api/v2/content_export_incrementals_controller.rb +1 -8
- data/app/controllers/katello/api/v2/content_exports_controller.rb +1 -14
- data/app/controllers/katello/api/v2/content_imports_controller.rb +38 -15
- data/app/controllers/katello/api/v2/content_uploads_controller.rb +1 -1
- data/app/controllers/katello/api/v2/content_view_components_controller.rb +22 -1
- data/app/controllers/katello/api/v2/content_view_filter_rules_controller.rb +6 -1
- data/app/controllers/katello/api/v2/content_view_versions_controller.rb +2 -59
- data/app/controllers/katello/api/v2/content_views_controller.rb +3 -58
- data/app/controllers/katello/api/v2/host_errata_controller.rb +7 -6
- data/app/controllers/katello/api/v2/host_packages_controller.rb +4 -4
- data/app/controllers/katello/api/v2/host_subscriptions_controller.rb +18 -22
- data/app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb +16 -16
- data/app/controllers/katello/api/v2/organizations_controller.rb +2 -1
- data/app/controllers/katello/api/v2/package_groups_controller.rb +4 -0
- data/app/controllers/katello/api/v2/repositories_controller.rb +13 -12
- data/app/controllers/katello/api/v2/repository_sets_controller.rb +50 -4
- data/app/controllers/katello/api/v2/subscriptions_controller.rb +7 -1
- data/app/controllers/katello/concerns/api/api_controller.rb +10 -0
- data/app/controllers/katello/concerns/api/v2/registration_commands_controller_extensions.rb +46 -0
- data/app/controllers/katello/concerns/api/v2/registration_controller_extensions.rb +8 -0
- data/app/controllers/katello/concerns/api/v2/repository_content_controller.rb +31 -22
- data/app/controllers/katello/concerns/hosts_controller_extensions.rb +0 -8
- data/app/controllers/katello/concerns/organizations_controller_extensions.rb +1 -1
- data/app/controllers/katello/concerns/registration_commands_controller_extensions.rb +34 -0
- data/app/helpers/katello/katello_urls_helper.rb +23 -0
- data/app/lib/actions/candlepin/owner/import.rb +10 -3
- data/app/lib/actions/candlepin/product/content_update.rb +1 -1
- data/app/lib/actions/foreman/environment/destroy.rb +2 -2
- data/app/lib/actions/katello/agent_action.rb +1 -6
- data/app/lib/actions/katello/capsule_content/refresh_repos.rb +0 -7
- data/app/lib/actions/katello/capsule_content/sync.rb +1 -1
- data/app/lib/actions/katello/capsule_content/sync_capsule.rb +1 -2
- data/app/lib/actions/katello/content_view/add_to_environment.rb +9 -7
- data/app/lib/actions/katello/content_view/incremental_updates.rb +3 -10
- data/app/lib/actions/katello/content_view/presenters/incremental_updates_presenter.rb +2 -3
- data/app/lib/actions/katello/content_view/promote_to_environment.rb +1 -4
- data/app/lib/actions/katello/content_view/publish.rb +21 -31
- data/app/lib/actions/katello/content_view_environment/destroy.rb +0 -5
- data/app/lib/actions/katello/content_view_version/auto_create_products.rb +22 -0
- data/app/lib/actions/katello/content_view_version/auto_create_repositories.rb +22 -0
- data/app/lib/actions/katello/content_view_version/destroy.rb +0 -10
- data/app/lib/actions/katello/content_view_version/export.rb +20 -22
- data/app/lib/actions/katello/content_view_version/import.rb +27 -13
- data/app/lib/actions/katello/content_view_version/import_library.rb +4 -2
- data/app/lib/actions/katello/content_view_version/incremental_update.rb +12 -67
- data/app/lib/actions/katello/content_view_version/republish_repositories.rb +0 -4
- data/app/lib/actions/katello/content_view_version/reset_content_view_repositories_from_metadata.rb +11 -0
- data/app/lib/actions/katello/foreman/content_update.rb +0 -3
- data/app/lib/actions/katello/host/auto_attach_subscriptions.rb +0 -4
- data/app/lib/actions/katello/organization/manifest_import.rb +7 -1
- data/app/lib/actions/katello/organization/manifest_refresh.rb +28 -7
- data/app/lib/actions/katello/orphan_cleanup/remove_orphans.rb +2 -2
- data/app/lib/actions/katello/product/create.rb +0 -1
- data/app/lib/actions/katello/repository/check_matching_content.rb +4 -3
- data/app/lib/actions/katello/repository/destroy.rb +1 -1
- data/app/lib/actions/katello/repository/discover.rb +1 -1
- data/app/lib/actions/katello/repository/filtered_index_content.rb +1 -4
- data/app/lib/actions/katello/repository/import_upload.rb +0 -1
- data/app/lib/actions/katello/repository/update.rb +0 -1
- data/app/lib/actions/middleware/record_smart_proxy_sync_history.rb +0 -5
- data/app/lib/actions/pulp/repository/create.rb +1 -7
- data/app/lib/actions/pulp/repository/distributor_publish.rb +2 -10
- data/app/lib/actions/pulp/repository/sync.rb +1 -3
- data/app/lib/actions/pulp3/capsule_content/refresh_content_guard.rb +17 -0
- data/app/lib/actions/pulp3/content_guard/refresh.rb +10 -6
- data/app/lib/actions/pulp3/content_view_version/create_export_history.rb +57 -0
- data/app/lib/actions/pulp3/content_view_version/create_import_history.rb +34 -0
- data/app/lib/actions/pulp3/orchestration/content_view_version/copy_version_units_to_library.rb +2 -3
- data/app/lib/actions/pulp3/orchestration/content_view_version/export.rb +34 -51
- data/app/lib/actions/pulp3/orchestration/content_view_version/export_library.rb +2 -2
- data/app/lib/actions/pulp3/orchestration/content_view_version/import.rb +13 -1
- data/app/lib/actions/pulp3/orchestration/orphan_cleanup/remove_orphans.rb +1 -1
- data/app/lib/actions/pulp3/orchestration/repository/sync.rb +1 -0
- data/app/lib/actions/pulp3/repository/refresh_remote.rb +17 -0
- data/app/lib/katello/agent/client_message_handler.rb +3 -11
- data/app/lib/katello/concerns/base_template_scope_extensions.rb +117 -3
- data/app/lib/katello/errors.rb +6 -11
- data/app/lib/katello/event_daemon/monitor.rb +0 -1
- data/app/lib/katello/event_daemon/runner.rb +2 -2
- data/app/lib/katello/event_daemon/services/agent_event_receiver.rb +10 -6
- data/app/lib/katello/http_resource.rb +1 -6
- data/app/lib/katello/logging.rb +11 -6
- data/app/lib/katello/qpid/connection.rb +1 -3
- data/app/lib/katello/repo_discovery.rb +15 -1
- data/app/lib/katello/resources/candlepin/owner.rb +3 -2
- data/app/lib/katello/resources/candlepin/pool.rb +6 -2
- data/app/lib/katello/resources/candlepin.rb +10 -0
- data/app/lib/katello/util/package.rb +1 -1
- data/app/lib/katello/util/pulpcore_content_filters.rb +1 -1
- data/app/lib/katello/validators/hostgroup_kickstart_repository_validator.rb +0 -6
- data/app/models/katello/authorization/content_view.rb +8 -0
- data/app/models/katello/authorization/content_view_version_import_history.rb +11 -0
- data/app/models/katello/concerns/content_facet_host_extensions.rb +1 -1
- data/app/models/katello/concerns/content_view_filter_rule_common.rb +2 -2
- data/app/models/katello/concerns/host_managed_extensions.rb +1 -32
- data/app/models/katello/concerns/hostgroup_extensions.rb +2 -9
- data/app/models/katello/concerns/http_proxy_extensions.rb +2 -4
- data/app/models/katello/concerns/location_extensions.rb +2 -25
- data/app/models/katello/concerns/operatingsystem_extensions.rb +0 -2
- data/app/models/katello/concerns/organization_extensions.rb +4 -18
- data/app/models/katello/concerns/redhat_extensions.rb +10 -18
- data/app/models/katello/concerns/smart_proxy_extensions.rb +6 -31
- data/app/models/katello/content_view.rb +17 -113
- data/app/models/katello/content_view_component.rb +5 -0
- data/app/models/katello/content_view_docker_filter_rule.rb +1 -0
- data/app/models/katello/content_view_package_filter_rule.rb +4 -0
- data/app/models/katello/content_view_package_group_filter.rb +1 -0
- data/app/models/katello/content_view_repository.rb +4 -5
- data/app/models/katello/content_view_version.rb +9 -33
- data/app/models/katello/content_view_version_export_history.rb +18 -4
- data/app/models/katello/content_view_version_import_history.rb +42 -0
- data/app/models/katello/erratum.rb +1 -1
- data/app/models/katello/events/delete_pool.rb +19 -0
- data/app/models/katello/glue/candlepin/environment.rb +7 -0
- data/app/models/katello/glue/candlepin/owner.rb +12 -1
- data/app/models/katello/glue/candlepin/pool.rb +42 -25
- data/app/models/katello/glue/provider.rb +3 -6
- data/app/models/katello/glue/pulp/repo.rb +19 -9
- data/app/models/katello/host/content_facet.rb +1 -0
- data/app/models/katello/host/subscription_facet.rb +3 -1
- data/app/models/katello/kt_environment.rb +0 -6
- data/app/models/katello/package_group.rb +4 -0
- data/app/models/katello/ping.rb +15 -4
- data/app/models/katello/pool.rb +9 -0
- data/app/models/katello/product.rb +0 -6
- data/app/models/katello/product_content.rb +3 -1
- data/app/models/katello/pulp_sync_status.rb +0 -10
- data/app/models/katello/repository.rb +20 -35
- data/app/models/katello/root_repository.rb +0 -5
- data/app/models/katello/subscription.rb +10 -0
- data/app/models/katello/sync_plan.rb +7 -0
- data/app/models/setting/content.rb +7 -8
- data/app/presenters/katello/content_view_version_compare_presenter.rb +2 -6
- data/app/presenters/katello/product_content_presenter.rb +3 -5
- data/app/services/cert/certs.rb +3 -7
- data/app/services/katello/applicability/applicable_content_helper.rb +1 -2
- data/app/services/katello/candlepin/event_handler.rb +22 -22
- data/app/services/katello/candlepin/message_handler.rb +24 -15
- data/app/services/katello/content_view_manager.rb +24 -0
- data/app/services/katello/event_monitor/poller_thread.rb +25 -20
- data/app/services/katello/managed_content_medium_provider.rb +4 -0
- data/app/services/katello/organization_creator.rb +120 -0
- data/app/services/katello/product_content_finder.rb +5 -1
- data/app/services/katello/pulp/pulp_content_unit.rb +6 -6
- data/app/services/katello/pulp/smart_proxy_repository.rb +2 -17
- data/app/services/katello/pulp3/api/ansible_collection.rb +14 -2
- data/app/services/katello/pulp3/api/apt.rb +1 -1
- data/app/services/katello/pulp3/api/content_guard.rb +6 -40
- data/app/services/katello/pulp3/api/core.rb +27 -2
- data/app/services/katello/pulp3/api/docker.rb +1 -1
- data/app/services/katello/pulp3/api/file.rb +5 -1
- data/app/services/katello/pulp3/api/yum.rb +9 -1
- data/app/services/katello/pulp3/content_view_version/export.rb +18 -40
- data/app/services/katello/pulp3/content_view_version/import.rb +75 -30
- data/app/services/katello/pulp3/content_view_version/import_gpg_keys.rb +32 -0
- data/app/services/katello/pulp3/content_view_version/import_validator.rb +53 -21
- data/app/services/katello/pulp3/content_view_version/importable_products.rb +47 -0
- data/app/services/katello/pulp3/content_view_version/importable_repositories.rb +52 -0
- data/app/services/katello/pulp3/content_view_version/metadata_generator.rb +99 -0
- data/app/services/katello/pulp3/pulp_content_unit.rb +1 -1
- data/app/services/katello/pulp3/repository/ansible_collection.rb +5 -1
- data/app/services/katello/pulp3/repository/apt.rb +2 -1
- data/app/services/katello/pulp3/repository/yum.rb +0 -16
- data/app/services/katello/pulp3/repository.rb +20 -1
- data/app/services/katello/pulp3/rpm.rb +5 -1
- data/app/services/katello/pulp3/task.rb +12 -5
- data/app/services/katello/pulp3/task_group.rb +10 -5
- data/app/services/katello/smart_proxy_helper.rb +1 -8
- data/app/services/katello/ui_notifications/pulp/proxy_disk_space.rb +0 -1
- data/app/services/katello/ui_notifications/system_error.rb +25 -0
- data/app/views/katello/api/v2/content_view_components/show.json.rabl +1 -1
- data/app/views/katello/api/v2/content_view_filters/show.json.rabl +0 -1
- data/app/views/katello/api/v2/{puppet_modules → content_view_version_import_histories}/index.json.rabl +1 -1
- data/app/views/katello/api/v2/content_view_version_import_histories/show.json.rabl +14 -0
- data/app/views/katello/api/v2/content_view_versions/base.json.rabl +2 -2
- data/app/views/katello/api/v2/content_view_versions/show.json.rabl +0 -7
- data/app/views/katello/api/v2/content_views/base.json.rabl +20 -9
- data/app/views/katello/api/v2/environments/show.json.rabl +0 -1
- data/app/views/katello/api/v2/package_groups/index.json.rabl +4 -0
- data/app/views/katello/api/v2/repositories/base.json.rabl +0 -1
- data/app/views/katello/api/v2/repositories/show.json.rabl +1 -1
- data/app/views/katello/api/v2/repository_sets/index.json.rabl +4 -1
- data/app/views/katello/api/v2/repository_sets/show.json.rabl +22 -0
- data/app/views/katello/api/v2/subscriptions/show.json.rabl +1 -1
- data/app/views/overrides/activation_keys/_host_media_type_select.html.erb +1 -1
- data/app/views/overrides/smart_proxies/_download_policy.erb +1 -1
- data/config/initializers/monkeys.rb +0 -1
- data/config/katello.yaml.example +0 -1
- data/config/routes/api/v2.rb +9 -21
- data/config/routes/overrides.rb +1 -2
- data/db/migrate/20140422000001_update_products_add_organization.rb +3 -2
- data/db/migrate/20160701180402_add_sortable_version_to_puppet_modules.rb +2 -0
- data/db/migrate/20200514092553_move_katello_fields_from_hostgroups.katello.rb +1 -1
- data/db/migrate/20210119162528_delete_puppet_and_ostree_repos.rb +14 -20
- data/db/migrate/20210224160921_remove_disabled_products_from_sync_plans.rb +6 -0
- data/db/migrate/20210302165636_remove_katello_puppet_modules.rb +62 -0
- data/db/migrate/20210309160925_create_katello_content_view_version_import_histories.rb +13 -0
- data/db/migrate/20210318204533_add_import_type_to_import_histories.rb +8 -0
- data/db/migrate/20210319123300_add_foreign_keys_to_import_export_histories.rb +6 -0
- data/db/migrate/20210322142311_add_auth_url_token_to_root_repositories.rb +6 -0
- data/db/migrate/20210331180353_katello_pool_organization_id_not_nullable.rb +16 -0
- data/db/migrate/20210409033915_add_created_in_katello_to_taxonomy.rb +9 -0
- data/db/seeds.d/101-locations.rb +0 -3
- data/db/seeds.d/102-organizations.rb +1 -5
- data/db/seeds.d/109-katello-notification-blueprints.rb +12 -0
- data/db/seeds.d/111-upgrade_tasks.rb +3 -2
- data/engines/bastion/vendor/assets/javascripts/bastion/angular/angular.js +325 -156
- data/engines/bastion/vendor/assets/javascripts/bastion/angular-animate/angular-animate.js +3 -3
- data/engines/bastion/vendor/assets/javascripts/bastion/angular-resource/angular-resource.js +3 -3
- data/engines/bastion/vendor/assets/javascripts/bastion/angular-route/angular-route.js +3 -3
- data/engines/bastion/vendor/assets/javascripts/bastion/angular-sanitize/angular-sanitize.js +21 -43
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-repository-sets.controller.js +9 -10
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-repository-sets.html +2 -9
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/bastion-katello-bootstrap.js +0 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/bastion_katello.js +0 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-errata-modal.controller.js +2 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-packages-modal.controller.js +2 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-errata-modal.html +11 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-packages-modal.html +18 -11
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-system-purpose-modal.html +10 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-errata.controller.js +2 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-packages-actions.controller.js +5 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-packages-applicable.controller.js +7 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-packages-installed.controller.js +7 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-errata.html +6 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-packages-actions.html +7 -7
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-packages-applicable.html +14 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-packages-installed.html +5 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts.routes.js +0 -14
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-repository-sets.controller.js +9 -11
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-info.html +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-repository-sets.html +2 -8
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts.html +3 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/register.html +5 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/content-view.factory.js +0 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/content-views.routes.js +0 -56
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/components/views/content-view-composite-available-content-views.html +0 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/components/views/content-view-composite-content-views-list.html +0 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-details.html +2 -9
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-info.html +0 -12
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-versions.html +0 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/content-view-version-content.controller.js +2 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/content-view-versions.module.js +0 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version.html +0 -7
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/content.service.js +0 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/environments.module.js +0 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/environments.routes.js +0 -11
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/views/environments.html +0 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/apply-errata.controller.js +21 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/views/apply-errata-confirm.html +9 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/bastion_katello.pot +71 -311
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/translations.js +0 -10
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/fenced-pages.service.js +0 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-manage-content.controller.js +2 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +13 -15
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/views/new-repository.html +21 -7
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/repositories.routes.js +0 -9
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/views/product-repositories.html +0 -6
- data/engines/bastion_katello/lib/bastion_katello/engine.rb +3 -3
- data/lib/katello/engine.rb +16 -15
- data/lib/katello/middleware/organization_created_enforcer.rb +22 -0
- data/lib/katello/permission_creator.rb +12 -28
- data/lib/katello/permissions/host_permissions.rb +3 -2
- data/lib/katello/plugin.rb +6 -19
- data/lib/katello/repository_types/ansible_collection.rb +1 -1
- data/lib/katello/repository_types/deb.rb +1 -1
- data/lib/katello/repository_types/docker.rb +1 -1
- data/lib/katello/repository_types/file.rb +1 -1
- data/lib/katello/repository_types/yum.rb +1 -1
- data/lib/katello/tasks/clean_backend_objects.rake +25 -0
- data/lib/katello/tasks/jenkins.rake +6 -0
- data/lib/katello/tasks/receptor/extract_orgs.rake +1 -3
- data/lib/katello/tasks/reimport.rake +0 -1
- data/lib/katello/tasks/repository.rake +0 -30
- data/lib/katello/tasks/update_subscription_facet_backend_data.rake +3 -3
- data/lib/katello/tasks/upgrades/4.0/remove_ostree_puppet_content.rake +2 -4
- data/lib/katello/tasks/upgrades/4.1/fix_invalid_pools.rake +62 -0
- data/lib/katello/tasks/upgrades/4.1/sync_noarch_content.rake +15 -0
- data/lib/katello/version.rb +1 -1
- data/lib/katello.rb +1 -1
- data/locale/action_names.rb +65 -63
- data/locale/bn/katello.edit.po +1357 -1606
- data/locale/bn/katello.po +465 -744
- data/locale/cs/katello.edit.po +1213 -1087
- data/locale/cs/katello.po +307 -219
- data/locale/de/katello.edit.po +1498 -1520
- data/locale/de/katello.po +589 -625
- data/locale/en/katello.edit.po +1198 -1074
- data/locale/en/katello.po +304 -213
- data/locale/es/katello.edit.po +2344 -2304
- data/locale/es/katello.po +1407 -1407
- data/locale/fr/katello.edit.po +2720 -2642
- data/locale/fr/katello.po +1703 -1750
- data/locale/gu/katello.edit.po +1546 -1797
- data/locale/gu/katello.po +654 -935
- data/locale/hi/katello.edit.po +1545 -1793
- data/locale/hi/katello.po +653 -931
- data/locale/it/katello.edit.po +1323 -1310
- data/locale/it/katello.po +407 -409
- data/locale/ja/katello.edit.po +2645 -2557
- data/locale/ja/katello.po +1646 -1664
- data/locale/katello.pot +1435 -1289
- data/locale/kn/katello.edit.po +1546 -1795
- data/locale/kn/katello.po +654 -933
- data/locale/ko/katello.edit.po +1464 -1449
- data/locale/ko/katello.po +554 -554
- data/locale/mr/katello.edit.po +1545 -1758
- data/locale/mr/katello.po +653 -896
- data/locale/or/katello.edit.po +1546 -1795
- data/locale/or/katello.po +654 -933
- data/locale/pa/katello.edit.po +1541 -1775
- data/locale/pa/katello.po +649 -913
- data/locale/pt/katello.edit.po +1289 -1255
- data/locale/pt/katello.po +398 -394
- data/locale/pt_BR/katello.edit.po +2370 -2315
- data/locale/pt_BR/katello.po +1435 -1421
- data/locale/ru/katello.edit.po +1611 -1608
- data/locale/ru/katello.po +704 -716
- data/locale/ta/katello.edit.po +1358 -1605
- data/locale/ta/katello.po +465 -742
- data/locale/te/katello.edit.po +1545 -1792
- data/locale/te/katello.po +653 -930
- data/locale/zh_CN/katello.edit.po +3052 -2930
- data/locale/zh_CN/katello.po +2055 -2039
- data/locale/zh_TW/katello.edit.po +1571 -1669
- data/locale/zh_TW/katello.po +649 -777
- data/package.json +2 -2
- data/webpack/{scenes/ContentViews/Details/Repositories/RepoAddedStatus.js → components/AddedStatusLabel.js} +5 -5
- data/webpack/components/RoutedTabs/RoutedTabs.js +91 -0
- data/webpack/components/RoutedTabs/__tests__/RoutedTabs.test.js +32 -0
- data/webpack/components/RoutedTabs/index.js +4 -0
- data/webpack/components/extensions/RegistrationCommands/RegistrationCommandsPageConstants.js +2 -0
- data/webpack/components/extensions/RegistrationCommands/RegistrationCommandsPageHelpers.js +21 -0
- data/webpack/components/extensions/RegistrationCommands/RegistrationCommandsPageSelectors.js +21 -0
- data/webpack/components/extensions/RegistrationCommands/__tests__/ActivationKeys.test.js +18 -0
- data/webpack/components/extensions/RegistrationCommands/__tests__/Force.test.js +9 -0
- data/webpack/components/extensions/RegistrationCommands/__tests__/IgnoreSubmanErrors.test.js +9 -0
- data/webpack/components/extensions/RegistrationCommands/__tests__/LifeCycleEnvironment.test.js +11 -0
- data/webpack/components/extensions/RegistrationCommands/__tests__/__snapshots__/ActivationKeys.test.js.snap +58 -0
- data/webpack/components/extensions/RegistrationCommands/__tests__/__snapshots__/Force.test.js.snap +25 -0
- data/webpack/components/extensions/RegistrationCommands/__tests__/__snapshots__/IgnoreSubmanErrors.test.js.snap +25 -0
- data/webpack/components/extensions/RegistrationCommands/__tests__/__snapshots__/LifeCycleEnvironment.test.js.snap +27 -0
- data/webpack/components/extensions/RegistrationCommands/fields/ActivationKeys.js +99 -0
- data/webpack/components/extensions/RegistrationCommands/fields/Force.js +38 -0
- data/webpack/components/extensions/RegistrationCommands/fields/IgnoreSubmanErrors.js +38 -0
- data/webpack/components/extensions/RegistrationCommands/fields/LifecycleEnvironment.js +56 -0
- data/webpack/components/extensions/RegistrationCommands/index.js +81 -0
- data/webpack/components/pf3Table/formatters/EntitlementsInlineEditFormatter.js +23 -24
- data/webpack/components/pf3Table/formatters/__tests__/__snapshots__/EntitlementsInlineEditFormatter.test.js.snap +3 -1
- data/webpack/components/pf3Table/formatters/entitlementsValueFormatter.js +16 -0
- data/webpack/containers/Application/overrides.scss +3 -0
- data/webpack/fills_index.js +3 -0
- data/webpack/redux/reducers/RedHatRepositories/enabled.fixtures.js +0 -2
- data/webpack/scenes/ContentViews/ContentViewsConstants.js +8 -1
- data/webpack/scenes/ContentViews/Copy/__tests__/contentViewCopyResult.fixtures.json +1 -3
- data/webpack/scenes/ContentViews/Create/__tests__/contentViewCreateResult.fixtures.json +1 -3
- data/webpack/scenes/ContentViews/Details/ComponentContentViews/ComponentEnvironments.js +28 -0
- data/webpack/scenes/ContentViews/Details/ComponentContentViews/ComponentVersion.js +45 -0
- data/webpack/scenes/ContentViews/Details/ComponentContentViews/ContentViewComponents.js +124 -0
- data/webpack/scenes/ContentViews/Details/ComponentContentViews/__tests__/contentViewComponents.fixtures.json +161 -0
- data/webpack/scenes/ContentViews/Details/ComponentContentViews/__tests__/contentViewComponents.test.js +163 -0
- data/webpack/scenes/ContentViews/Details/ComponentContentViews/__tests__/unpublishedCVComponents.fixtures.json +64 -0
- data/webpack/scenes/ContentViews/Details/ContentViewDetailActions.js +67 -7
- data/webpack/scenes/ContentViews/Details/ContentViewDetailSelectors.js +61 -4
- data/webpack/scenes/ContentViews/Details/ContentViewDetails.js +34 -11
- data/webpack/scenes/ContentViews/Details/Filters/CVFilterDetailType.js +33 -0
- data/webpack/scenes/ContentViews/Details/Filters/CVPackageGroupFilterContent.js +117 -0
- data/webpack/scenes/ContentViews/Details/Filters/CVRpmFilterContent.js +115 -0
- data/webpack/scenes/ContentViews/Details/Filters/ContentType.js +7 -10
- data/webpack/scenes/ContentViews/Details/Filters/ContentViewFilterDetails.js +49 -0
- data/webpack/scenes/ContentViews/Details/Filters/ContentViewFilterDetailsHeader.js +56 -0
- data/webpack/scenes/ContentViews/Details/Filters/ContentViewFilters.js +3 -17
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/CVRpmFilterContent.test.js +116 -0
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/allFilterPackageGroups.fixtures.json +69 -0
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilterDetail.fixtures.json +103 -0
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilterDetails.test.js +116 -0
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvPackageFilterDetail.fixtures.json +147 -0
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvPackageFilterRules.fixtures.json +30 -0
- data/webpack/scenes/ContentViews/Details/Histories/ContentViewHistories.js +136 -0
- data/webpack/scenes/ContentViews/Details/Histories/__tests__/contentViewHistory.fixtures.json +370 -0
- data/webpack/scenes/ContentViews/Details/Histories/__tests__/contentViewHistory.test.js +94 -0
- data/webpack/scenes/ContentViews/Details/Repositories/ContentCounts.js +0 -1
- data/webpack/scenes/ContentViews/Details/Repositories/ContentViewRepositories.js +106 -13
- data/webpack/scenes/ContentViews/Details/Repositories/LastSync.js +11 -5
- data/webpack/scenes/ContentViews/Details/Repositories/RepoIcon.js +5 -1
- data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewAddRemove.test.js +138 -0
- data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewDetailRepos.fixtures.json +0 -2
- data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewDetailRepos.test.js +1 -1
- data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewRepoAdd.fixture.json +57 -0
- data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersionContent.js +73 -0
- data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersionEnvironments.js +31 -0
- data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersionErrata.js +64 -0
- data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersionErrata.scss +8 -0
- data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersionPackages.js +0 -0
- data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersions.js +105 -0
- data/webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.fixtures.json +728 -0
- data/webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.test.js +154 -0
- data/webpack/scenes/ContentViews/Details/Versions/__tests__/emptyCVVersion.fixtures.json +13 -0
- data/webpack/scenes/ContentViews/Details/__tests__/contentViewDetail.test.js +3 -1
- data/webpack/scenes/ContentViews/Details/__tests__/contentViewDetails.fixtures.json +0 -2
- data/webpack/scenes/ContentViews/Table/ContentViewVersionCell.js +33 -0
- data/webpack/scenes/ContentViews/Table/ContentViewsTable.js +17 -22
- data/webpack/scenes/ContentViews/Table/tableDataGenerator.js +51 -102
- data/webpack/scenes/ContentViews/__tests__/basicContentViews.fixtures.js +5 -3
- data/webpack/scenes/ContentViews/__tests__/contentViewList.fixtures.json +30 -5
- data/webpack/scenes/ContentViews/__tests__/contentViewPage.test.js +95 -0
- data/webpack/scenes/ContentViews/components/ContentViewIcon.js +11 -5
- data/webpack/scenes/ContentViews/components/EnvironmentLabels.js +16 -0
- data/webpack/scenes/ContentViews/components/IconWithCount.js +1 -1
- data/webpack/scenes/ContentViews/components/InactiveText.js +15 -0
- data/webpack/scenes/ContentViews/expansions/DetailsExpansion.js +19 -1
- data/webpack/scenes/Subscriptions/Details/SubscriptionPurposeAttributes.js +1 -1
- data/webpack/scenes/Subscriptions/Details/__tests__/__snapshots__/SubscriptionDetailInfo.test.js.snap +1 -1
- data/webpack/scenes/Subscriptions/Details/__tests__/__snapshots__/SubscriptionDetails.test.js.snap +3 -3
- data/webpack/scenes/Subscriptions/Details/__tests__/subscriptionDetails.fixtures.js +1 -1
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTableHelpers.js +17 -0
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTableSchema.js +2 -1
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTable.test.js +1 -1
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/__snapshots__/SubscriptionsTable.test.js.snap +144 -0
- data/webpack/scenes/Tasks/helpers.js +2 -2
- data/webpack/test-utils/react-testing-lib-wrapper.js +11 -3
- data/webpack/utils/__tests__/useParamsWithHash.test.js +22 -0
- data/webpack/utils/helpers.js +2 -0
- data/webpack/utils/paramsFromHash.js +16 -0
- data/webpack/utils/useUrlParams.js +14 -0
- metadata +122 -206
- data/app/controllers/katello/api/v2/content_view_puppet_modules_controller.rb +0 -82
- data/app/controllers/katello/api/v2/puppet_modules_controller.rb +0 -19
- data/app/controllers/katello/concerns/registration_controller_extensions.rb +0 -16
- data/app/helpers/katello/concerns/hosts_and_hostgroups_helper_extensions.rb +0 -20
- data/app/lib/actions/candlepin/owner/create.rb +0 -16
- data/app/lib/actions/katello/content_view_puppet_environment/clear.rb +0 -11
- data/app/lib/actions/katello/content_view_puppet_environment/clone.rb +0 -78
- data/app/lib/actions/katello/content_view_puppet_environment/clone_content_for_version.rb +0 -20
- data/app/lib/actions/katello/content_view_puppet_environment/create.rb +0 -34
- data/app/lib/actions/katello/content_view_puppet_environment/create_for_version.rb +0 -23
- data/app/lib/actions/katello/content_view_puppet_environment/destroy.rb +0 -28
- data/app/lib/actions/katello/content_view_puppet_module/destroy.rb +0 -46
- data/app/lib/actions/katello/environment/library_create.rb +0 -35
- data/app/lib/actions/katello/organization/create.rb +0 -38
- data/app/lib/actions/pulp/content_view_puppet_environment/copy_contents.rb +0 -36
- data/app/lib/actions/pulp/content_view_puppet_environment/index_content.rb +0 -19
- data/app/lib/actions/pulp/repository/presenters/puppet_presenter.rb +0 -54
- data/app/lib/actions/pulp3/content_migration.rb +0 -31
- data/app/lib/actions/pulp3/content_migration_presenter.rb +0 -59
- data/app/lib/actions/pulp3/content_migration_reset.rb +0 -22
- data/app/lib/katello/foreman.rb +0 -32
- data/app/lib/katello/mapping.rb +0 -31
- data/app/lib/katello/util/hostgroup_facets_helper.rb +0 -126
- data/app/lib/katello/validators/content_view_puppet_module_validator.rb +0 -32
- data/app/models/katello/concerns/environment_extensions.rb +0 -74
- data/app/models/katello/content_view_puppet_environment.rb +0 -116
- data/app/models/katello/content_view_puppet_environment_puppet_module.rb +0 -11
- data/app/models/katello/content_view_puppet_module.rb +0 -63
- data/app/models/katello/puppet_module.rb +0 -77
- data/app/models/katello/repository_puppet_module.rb +0 -7
- data/app/services/katello/pulp/puppet_module.rb +0 -21
- data/app/services/katello/pulp/repository/puppet.rb +0 -68
- data/app/services/katello/pulp3/migration.rb +0 -329
- data/app/services/katello/pulp3/migration_plan.rb +0 -178
- data/app/services/katello/pulp3/migration_switchover.rb +0 -126
- data/app/services/katello/puppet_class_importer_extensions.rb +0 -32
- data/app/views/foreman/hosts/_registration.html.erb +0 -12
- data/app/views/katello/api/v2/activation_keys/product_content.json.rabl +0 -30
- data/app/views/katello/api/v2/content_view_puppet_modules/create.json.rabl +0 -3
- data/app/views/katello/api/v2/content_view_puppet_modules/index.json.rabl +0 -7
- data/app/views/katello/api/v2/content_view_puppet_modules/show.json.rabl +0 -9
- data/app/views/katello/api/v2/content_views/puppet_modules.json.rabl +0 -7
- data/app/views/katello/api/v2/host_subscriptions/content_override.json.rabl +0 -3
- data/app/views/katello/api/v2/host_subscriptions/product_content.json.rabl +0 -29
- data/app/views/katello/api/v2/puppet_modules/backend.json.rabl +0 -7
- data/app/views/katello/api/v2/puppet_modules/base.json.rabl +0 -9
- data/app/views/katello/api/v2/puppet_modules/compare.json.rabl +0 -10
- data/app/views/katello/api/v2/puppet_modules/name.json.rabl +0 -3
- data/app/views/katello/api/v2/puppet_modules/names.json.rabl +0 -7
- data/app/views/katello/api/v2/puppet_modules/show.json.rabl +0 -4
- data/db/migrate/20210512192745_fix_red_hat_root_repository_arch.rb +0 -11
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register-client.directive.js +0 -6
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register-os-client.directive.js +0 -17
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js +0 -44
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/register-client.html +0 -28
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/register-deb-client.html +0 -38
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/register-oracle-client.html +0 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/register-sles-client.html +0 -28
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-available-puppet-modules.controller.js +0 -9
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/puppet-modules/content-view-puppet-module-names.controller.js +0 -45
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/puppet-modules/content-view-puppet-module-versions.controller.js +0 -61
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/puppet-modules/content-view-puppet-module.factory.js +0 -23
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/puppet-modules/content-view-puppet-modules.controller.js +0 -74
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/puppet-modules/views/content-view-puppet-module-names.html +0 -57
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/puppet-modules/views/content-view-puppet-module-versions.html +0 -64
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/puppet-modules/views/content-view-puppet-modules.html +0 -54
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-puppet-modules.html +0 -19
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment-puppet-modules.html +0 -25
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/de.po +0 -6903
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/es.po +0 -7094
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/fr.po +0 -7303
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/it.po +0 -6895
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ja.po +0 -6865
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ko.po +0 -6720
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/pt_BR.po +0 -7077
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ru.po +0 -6832
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/zh_CN.po +0 -6766
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/zh_TW.po +0 -6703
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-puppet-modules.html +0 -66
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/puppet-modules/details/puppet-module-content-views.controller.js +0 -44
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/puppet-modules/details/puppet-module-repositories.controller.js +0 -36
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/puppet-modules/details/puppet-module.controller.js +0 -34
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/puppet-modules/details/views/puppet-module-content-views.html +0 -41
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/puppet-modules/details/views/puppet-module-info.html +0 -32
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/puppet-modules/details/views/puppet-module-repositories.html +0 -52
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/puppet-modules/details/views/puppet-module.html +0 -37
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/puppet-modules/puppet-module.factory.js +0 -28
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/puppet-modules/puppet-modules.controller.js +0 -35
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/puppet-modules/puppet-modules.module.js +0 -20
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/puppet-modules/puppet-modules.routes.js +0 -71
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/puppet-modules/views/puppet-modules.html +0 -47
- data/lib/katello/repository_types/puppet.rb +0 -5
- data/lib/katello/tasks/fix_hostgroup_facets.rake +0 -8
- data/lib/katello/tasks/pulp3_content_switchover.rake +0 -32
- data/lib/katello/tasks/pulp3_migration.rake +0 -41
- data/lib/katello/tasks/pulp3_migration_abort.rake +0 -22
- data/lib/katello/tasks/pulp3_migration_reset.rake +0 -26
- data/lib/katello/tasks/pulp3_migration_stats.rake +0 -41
- data/lib/katello/tasks/pulp3_post_migration_check.rake +0 -51
- data/lib/monkeys/passenger_tee_input.rb +0 -20
- data/locale/bn/LC_MESSAGES/katello.mo +0 -0
- data/locale/cs/LC_MESSAGES/katello.mo +0 -0
- data/locale/de/LC_MESSAGES/katello.mo +0 -0
- data/locale/en/LC_MESSAGES/katello.mo +0 -0
- data/locale/es/LC_MESSAGES/katello.mo +0 -0
- data/locale/fr/LC_MESSAGES/katello.mo +0 -0
- data/locale/gu/LC_MESSAGES/katello.mo +0 -0
- data/locale/hi/LC_MESSAGES/katello.mo +0 -0
- data/locale/it/LC_MESSAGES/katello.mo +0 -0
- data/locale/ja/LC_MESSAGES/katello.mo +0 -0
- data/locale/kn/LC_MESSAGES/katello.mo +0 -0
- data/locale/ko/LC_MESSAGES/katello.mo +0 -0
- data/locale/mr/LC_MESSAGES/katello.mo +0 -0
- data/locale/or/LC_MESSAGES/katello.mo +0 -0
- data/locale/pa/LC_MESSAGES/katello.mo +0 -0
- data/locale/pt/LC_MESSAGES/katello.mo +0 -0
- data/locale/pt_BR/LC_MESSAGES/katello.mo +0 -0
- data/locale/ru/LC_MESSAGES/katello.mo +0 -0
- data/locale/ta/LC_MESSAGES/katello.mo +0 -0
- data/locale/te/LC_MESSAGES/katello.mo +0 -0
- data/locale/zh_CN/LC_MESSAGES/katello.mo +0 -0
- data/locale/zh_TW/LC_MESSAGES/katello.mo +0 -0
- data/webpack/components/TabWrapper/TabWrapper.js +0 -26
- data/webpack/components/TabWrapper/index.js +0 -3
- data/webpack/components/TabbedView/TabbedView.js +0 -38
- data/webpack/components/TabbedView/TabbedView.scss +0 -3
- data/webpack/components/TabbedView/index.js +0 -3
- data/webpack/scenes/ContentViews/expansions/EnvironmentsExpansion.js +0 -19
- data/webpack/scenes/ContentViews/expansions/VersionsExpansion.js +0 -11
@@ -1,59 +0,0 @@
|
|
1
|
-
require 'katello/content_migration_progress'
|
2
|
-
|
3
|
-
module Actions
|
4
|
-
module Pulp3
|
5
|
-
class ContentMigrationPresenter < Helpers::Presenter::Base
|
6
|
-
def initialize(migration_action)
|
7
|
-
@migration_action = migration_action
|
8
|
-
end
|
9
|
-
|
10
|
-
def humanized_output
|
11
|
-
if !@migration_action.done?
|
12
|
-
ContentMigrationTaskPresenter.new(@migration_action).humanized_output
|
13
|
-
else
|
14
|
-
task = ForemanTasks::Task.find_by(:external_id => @migration_action.execution_plan_id)
|
15
|
-
::Katello::ContentMigrationProgress.find_by(:task_id => task.id)&.progress_message
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
class ContentMigrationTaskPresenter
|
20
|
-
def initialize(action)
|
21
|
-
@action = action
|
22
|
-
end
|
23
|
-
|
24
|
-
def task_progress_reports
|
25
|
-
if @action.pulp_tasks.empty?
|
26
|
-
[]
|
27
|
-
else
|
28
|
-
@action.pulp_tasks[0].progress_reports
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
def task_group_progress_reports
|
33
|
-
if @action.task_groups.empty?
|
34
|
-
[]
|
35
|
-
else
|
36
|
-
@action.task_groups[0].group_progress_reports
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
def humanized_output
|
41
|
-
report = task_progress_reports.find { |current| current['state'] == 'running' && current['total'] != 0 }
|
42
|
-
report ||= task_group_progress_reports.find { |current| current['total'] != 0 && current['done'] != current['total'] }
|
43
|
-
|
44
|
-
if !report.blank? && report['total'] != 0
|
45
|
-
"#{report['message']} #{report['done']}/#{report['total']}"
|
46
|
-
elsif report
|
47
|
-
report['message']
|
48
|
-
elsif task_progress_reports.empty?
|
49
|
-
"Content migration starting. "
|
50
|
-
else
|
51
|
-
"Initial Migration steps complete."
|
52
|
-
end
|
53
|
-
rescue
|
54
|
-
""
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
module Actions
|
2
|
-
module Pulp3
|
3
|
-
class ContentMigrationReset < Pulp3::AbstractAsyncTask
|
4
|
-
def plan(smart_proxy)
|
5
|
-
plan_self(smart_proxy_id: smart_proxy.id)
|
6
|
-
end
|
7
|
-
|
8
|
-
def invoke_external_task
|
9
|
-
migration_service = ::Katello::Pulp3::Migration.new(smart_proxy)
|
10
|
-
migration_service.reset
|
11
|
-
end
|
12
|
-
|
13
|
-
def humanized_name
|
14
|
-
_("Content Migration Reset")
|
15
|
-
end
|
16
|
-
|
17
|
-
def rescue_strategy
|
18
|
-
Dynflow::Action::Rescue::Skip
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
data/app/lib/katello/foreman.rb
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
module Katello
|
2
|
-
class Foreman
|
3
|
-
def self.build_puppet_environment(org, env, content_view)
|
4
|
-
unless content_view.default?
|
5
|
-
Environment.find_or_build_by_katello_id(org, env, content_view)
|
6
|
-
end
|
7
|
-
end
|
8
|
-
|
9
|
-
def self.update_puppet_environment(content_view, environment)
|
10
|
-
User.as_anonymous_admin do
|
11
|
-
content_view_puppet_env = content_view.version(environment).puppet_env(environment)
|
12
|
-
if !content_view.default? && content_view_puppet_env
|
13
|
-
foreman_environment = content_view_puppet_env.puppet_environment
|
14
|
-
|
15
|
-
# Associate the puppet environment with the locations that are currently
|
16
|
-
# associated with the capsules that have the target lifecycle environment.
|
17
|
-
capsule_contents = SmartProxy.with_environment(environment, true)
|
18
|
-
unless capsule_contents.blank?
|
19
|
-
locations = capsule_contents.map(&:locations).compact.flatten.uniq
|
20
|
-
foreman_environment.locations = locations
|
21
|
-
foreman_environment.save!
|
22
|
-
end
|
23
|
-
|
24
|
-
foreman_smart_proxy = SmartProxy.pulp_primary
|
25
|
-
if foreman_smart_proxy.has_feature?('Puppet')
|
26
|
-
PuppetClassImporter.new(:url => foreman_smart_proxy.url, :env => foreman_environment.name).update_environment
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
data/app/lib/katello/mapping.rb
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
# various user-configurable mappings defined in /etc/katello/mapping.yml
|
2
|
-
|
3
|
-
require 'yaml'
|
4
|
-
|
5
|
-
module Katello
|
6
|
-
module Mapping
|
7
|
-
def self.configuration
|
8
|
-
return @config if @config
|
9
|
-
mapping_file = '/etc/katello/mapping.yml'
|
10
|
-
if File.readable?(mapping_file)
|
11
|
-
@config = YAML.load_file(mapping_file)
|
12
|
-
else
|
13
|
-
@config = {}
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
class ImageFactoryNaming
|
18
|
-
def self.translate(name = '', version = '')
|
19
|
-
matched_name = "#{name} #{version}"
|
20
|
-
naming = Mapping.configuration['imagefactory_naming'] || {}
|
21
|
-
naming.each do |key, values|
|
22
|
-
regexp_str = "^#{Regexp.escape(key).gsub('\*', '.*')}$"
|
23
|
-
if Regexp.new(regexp_str) =~ matched_name
|
24
|
-
return values.map(&:to_s)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
return [name.to_s, version.to_s]
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
@@ -1,126 +0,0 @@
|
|
1
|
-
# Used exclusively by fix_hostgroup_facets.rake task
|
2
|
-
module Katello
|
3
|
-
module Util
|
4
|
-
class HostgroupFacetsHelper
|
5
|
-
def initialize
|
6
|
-
@logger = Logger.new($stdout)
|
7
|
-
end
|
8
|
-
|
9
|
-
def interested_hostgroups
|
10
|
-
groups = ::Hostgroup.unscoped.where(
|
11
|
-
id: Katello::Hostgroup::ContentFacet.
|
12
|
-
where(content_source_id: nil,
|
13
|
-
kickstart_repository_id: nil,
|
14
|
-
content_view_id: nil,
|
15
|
-
lifecycle_environment_id: nil).select(:hostgroup_id))
|
16
|
-
parents = groups.select { |group| group.parent.blank? }
|
17
|
-
children = groups.reject { |group| group.parent.blank? }
|
18
|
-
# we want the parents to get created before the children
|
19
|
-
# hence the order
|
20
|
-
parents + children
|
21
|
-
end
|
22
|
-
|
23
|
-
def pick_facet_values(hg)
|
24
|
-
# This call looks at the audit logs for a host group.
|
25
|
-
# Pries out information related to lce, ks, cv and content_source_id from the audit logs.
|
26
|
-
# The audit logs typically only contain updates.
|
27
|
-
# So if the user changed just the content_view_id, then that is the only thing marked as audited_changes.
|
28
|
-
# Hence we need to go through all the audit logs until we have information on lce, ks, cv and cs.
|
29
|
-
# If there was only one audit log and that was during the creation of hostgroup
|
30
|
-
# the audited changes look like this
|
31
|
-
# ```ruby
|
32
|
-
# {
|
33
|
-
# content_view_id: 10,
|
34
|
-
# kickstart_repository_id: 1000
|
35
|
-
# ......
|
36
|
-
# }
|
37
|
-
# ```
|
38
|
-
# However if you updated the hostgroup and set the kickstart_repository_id, or
|
39
|
-
# content_view_id then audited changes look like
|
40
|
-
# ```ruby
|
41
|
-
# {
|
42
|
-
# content_view_id: [10, 11],
|
43
|
-
# kickstart_repository_id: [1000, 1200]
|
44
|
-
# ......
|
45
|
-
# }
|
46
|
-
# ```
|
47
|
-
# So the code says "if the attribute value is an array pick the last value else just keep the value as it is "
|
48
|
-
|
49
|
-
# Further along it is to be noted that `hostgroup.audits` returns the audits ordered by the version number in ascending order, so the latest audit will be `hostgroup.audits.last`
|
50
|
-
|
51
|
-
# We want to iterate though each audit from latest audit to start, and as soon as we find a content_view_id key or kickstart_repository_id key or lifecycle environment_id key or content_source_id key we want it to be set once.
|
52
|
-
|
53
|
-
# So if I had an audit history like
|
54
|
-
# ``` ruby
|
55
|
-
# {
|
56
|
-
# content_view_id: 10,
|
57
|
-
# kickstart_repository_id: 1000,
|
58
|
-
# version:1
|
59
|
-
# ......
|
60
|
-
# },
|
61
|
-
# {
|
62
|
-
# content_view_id: [10, 11],
|
63
|
-
# kickstart_repository_id: [1000, 1200],
|
64
|
-
# version: 2
|
65
|
-
# ......
|
66
|
-
# }
|
67
|
-
# ```
|
68
|
-
|
69
|
-
# The code would start at version 2, notice that cv_id and ks_repo were set there
|
70
|
-
# and keep them as the final.
|
71
|
-
# So when it goes to version 1 since cv_id and ks_repo are already set,
|
72
|
-
# it will ignore. It will finally
|
73
|
-
# return {content_view_id: 11, kickstart_repository_id: 1200}
|
74
|
-
facet_values = {}
|
75
|
-
hg.audits.reverse_each do |audit|
|
76
|
-
hg_changes = audit.audited_changes.slice("lifecycle_environment_id",
|
77
|
-
"kickstart_repository_id",
|
78
|
-
"content_view_id",
|
79
|
-
"content_source_id")
|
80
|
-
facet_values = hg_changes.merge(facet_values)
|
81
|
-
end
|
82
|
-
|
83
|
-
values = facet_values.map do |k, v|
|
84
|
-
v = v[-1] if v.is_a? Array
|
85
|
-
[k, v]
|
86
|
-
end
|
87
|
-
values.to_h.with_indifferent_access
|
88
|
-
end
|
89
|
-
|
90
|
-
def main
|
91
|
-
bad_hgs = []
|
92
|
-
good_hgs = []
|
93
|
-
|
94
|
-
groups = interested_hostgroups.each do |hg|
|
95
|
-
facet = hg.content_facet
|
96
|
-
values = pick_facet_values(hg)
|
97
|
-
if !values.empty? && facet.update(values)
|
98
|
-
good_hgs << { hostgroup: hg, facet_values: values }
|
99
|
-
else
|
100
|
-
bad_hgs << { hostgroup: hg, facet_values: values }
|
101
|
-
facet.save(validate: false)
|
102
|
-
end
|
103
|
-
end
|
104
|
-
|
105
|
-
unless bad_hgs.empty?
|
106
|
-
@logger.warn "Some of the hostgroups reported a validation error. "\
|
107
|
-
"The hostgroups have been updated. "\
|
108
|
-
"Check via the Web UI."
|
109
|
-
|
110
|
-
bad_hgs.each do |bad_group|
|
111
|
-
@logger.warn "Hostgroup #{bad_group[:hostgroup]}"
|
112
|
-
@logger.warn "Facet Values #{bad_group[:facet_values]}"
|
113
|
-
end
|
114
|
-
end
|
115
|
-
unless good_hgs.empty?
|
116
|
-
@logger.info "Following hostgroups were succesfully updated."
|
117
|
-
good_hgs.each do |good_group|
|
118
|
-
@logger.info "Hostgroup #{good_group[:hostgroup]}"
|
119
|
-
@logger.info "Facet Values #{good_group[:facet_values]}"
|
120
|
-
end
|
121
|
-
end
|
122
|
-
@logger.info("#{groups.count} Hostgroup(s) were updated.")
|
123
|
-
end
|
124
|
-
end
|
125
|
-
end
|
126
|
-
end
|
@@ -1,32 +0,0 @@
|
|
1
|
-
module Katello
|
2
|
-
module Validators
|
3
|
-
class ContentViewPuppetModuleValidator < ActiveModel::Validator
|
4
|
-
def validate(record) # rubocop:disable Metrics/CyclomaticComplexity
|
5
|
-
if record.uuid.blank? && (record.name.blank? || record.author.blank?)
|
6
|
-
record.errors[:base] << _("Invalid puppet module parameters specified. \
|
7
|
-
Either 'uuid' or 'name' and 'author' must be specified.")
|
8
|
-
elsif record.name && record.author &&
|
9
|
-
!PuppetModule.exists?(name: record.name, author: record.author)
|
10
|
-
record.errors[:base] << _("Puppet Module with name='%{name}' and author='%{author}' does\
|
11
|
-
not exist") % { name: record.name, author: record.author }
|
12
|
-
elsif record.uuid && !PuppetModule.exists?(pulp_id: record.uuid)
|
13
|
-
record.errors[:base] << _("Puppet Module with uuid='%{uuid}' does not\
|
14
|
-
exist") % { uuid: record.uuid }
|
15
|
-
else
|
16
|
-
puppet_modules = if record.uuid.blank?
|
17
|
-
PuppetModule.where(name: record.name, author: record.author)
|
18
|
-
else
|
19
|
-
PuppetModule.where(pulp_id: record.uuid)
|
20
|
-
end
|
21
|
-
repositories = puppet_modules.flat_map(&:repositories)
|
22
|
-
|
23
|
-
if repositories.present? && record.content_view.present? &&
|
24
|
-
!repositories.map(&:organization).include?(record.content_view.organization)
|
25
|
-
record.errors[:base] << _("Puppet Module does not belong to content view organization\
|
26
|
-
'%{name}'" % { name: record.content_view.organization.name })
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
@@ -1,74 +0,0 @@
|
|
1
|
-
module Katello
|
2
|
-
module Concerns
|
3
|
-
module EnvironmentExtensions
|
4
|
-
extend ActiveSupport::Concern
|
5
|
-
|
6
|
-
included do
|
7
|
-
has_one :content_view_puppet_environment, :class_name => "Katello::ContentViewPuppetEnvironment",
|
8
|
-
:foreign_key => :puppet_environment_id,
|
9
|
-
:dependent => :nullify, :inverse_of => :puppet_environment
|
10
|
-
|
11
|
-
has_one :content_view, :class_name => "Katello::ContentView", :through => :content_view_puppet_environment
|
12
|
-
has_one :lifecycle_environment, :class_name => "Katello::KTEnvironment", :through => :content_view_puppet_environment, :source => :environment
|
13
|
-
|
14
|
-
scoped_search :relation => :content_view, :on => :name, :rename => :content_view, :complete_value => true
|
15
|
-
scoped_search :relation => :lifecycle_environment, :on => :name, :rename => :lifecycle_environment, :complete_value => true
|
16
|
-
end
|
17
|
-
|
18
|
-
def content_view
|
19
|
-
self.content_view_puppet_environment.try(:content_view)
|
20
|
-
end
|
21
|
-
|
22
|
-
def lifecycle_environment
|
23
|
-
self.content_view_puppet_environment.try(:environment)
|
24
|
-
end
|
25
|
-
|
26
|
-
def destroy!
|
27
|
-
unless destroy
|
28
|
-
fail self.errors.full_messages.join('; ')
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
module ClassMethods
|
33
|
-
def find_by_katello_id(org, env, content_view)
|
34
|
-
katello_id = Environment.construct_katello_id(org, env, content_view)
|
35
|
-
Environment.where(:katello_id => katello_id).first
|
36
|
-
end
|
37
|
-
|
38
|
-
def build_by_katello_id(org, env, content_view)
|
39
|
-
env_name = Environment.construct_name(org, env, content_view)
|
40
|
-
katello_id = Environment.construct_katello_id(org, env, content_view)
|
41
|
-
default_location_id = ::Location.default_puppet_content_location!.id
|
42
|
-
environment = Environment.new(:name => env_name,
|
43
|
-
:organization_ids => [org.id],
|
44
|
-
:location_ids => [default_location_id])
|
45
|
-
environment.katello_id = katello_id
|
46
|
-
environment
|
47
|
-
end
|
48
|
-
|
49
|
-
def find_or_build_by_katello_id(org, env, content_view)
|
50
|
-
Environment.find_by_katello_id(org, env, content_view) ||
|
51
|
-
Environment.build_by_katello_id(org, env, content_view)
|
52
|
-
end
|
53
|
-
|
54
|
-
def construct_katello_id(org, env, content_view)
|
55
|
-
fail ArgumentError, "org has to be specified" if org.nil?
|
56
|
-
fail ArgumentError, "env has to be specified" if env.nil?
|
57
|
-
[org.label, env.label, content_view.label].reject(&:blank?).join('/')
|
58
|
-
end
|
59
|
-
|
60
|
-
# content_view_id provides the uniqueness of the name
|
61
|
-
def construct_name(org, env, content_view)
|
62
|
-
name = ["KT",
|
63
|
-
org.try(:label),
|
64
|
-
env.try(:label),
|
65
|
-
content_view.try(:label),
|
66
|
-
content_view.try(:id)
|
67
|
-
].reject(&:blank?).join('_')
|
68
|
-
|
69
|
-
return name.tr('-', '_')
|
70
|
-
end
|
71
|
-
end
|
72
|
-
end
|
73
|
-
end
|
74
|
-
end
|
@@ -1,116 +0,0 @@
|
|
1
|
-
module Katello
|
2
|
-
class ContentViewPuppetEnvironment < Katello::Model
|
3
|
-
include ForemanTasks::Concerns::ActionSubject
|
4
|
-
include Glue::Pulp::Repo
|
5
|
-
include Glue
|
6
|
-
|
7
|
-
belongs_to :environment, :class_name => "Katello::KTEnvironment",
|
8
|
-
:inverse_of => :content_view_puppet_environments
|
9
|
-
belongs_to :content_view_version, :class_name => "Katello::ContentViewVersion",
|
10
|
-
:inverse_of => :content_view_puppet_environments
|
11
|
-
|
12
|
-
has_one :content_view, :through => :content_view_version, :class_name => "Katello::ContentView"
|
13
|
-
|
14
|
-
belongs_to :puppet_environment, :class_name => "Environment",
|
15
|
-
:inverse_of => :content_view_puppet_environment, :dependent => :destroy
|
16
|
-
|
17
|
-
has_many :content_view_puppet_environment_puppet_modules,
|
18
|
-
:class_name => "Katello::ContentViewPuppetEnvironmentPuppetModule",
|
19
|
-
:dependent => :destroy
|
20
|
-
has_many :puppet_modules,
|
21
|
-
:through => :content_view_puppet_environment_puppet_modules
|
22
|
-
|
23
|
-
validates_lengths_from_database
|
24
|
-
validates :pulp_id, :presence => true, :uniqueness => true
|
25
|
-
validates_with Validators::KatelloNameFormatValidator, :attributes => :name
|
26
|
-
validates :puppet_environment, :presence => true, :if => :environment
|
27
|
-
|
28
|
-
before_validation :set_pulp_id
|
29
|
-
|
30
|
-
scope :non_archived, -> { where('environment_id is not NULL') }
|
31
|
-
scope :archived, -> { where('environment_id is NULL') }
|
32
|
-
|
33
|
-
def content_type
|
34
|
-
Repository::PUPPET_TYPE
|
35
|
-
end
|
36
|
-
|
37
|
-
def mirror_on_sync?
|
38
|
-
true
|
39
|
-
end
|
40
|
-
|
41
|
-
def link?
|
42
|
-
false
|
43
|
-
end
|
44
|
-
|
45
|
-
def primary
|
46
|
-
true
|
47
|
-
end
|
48
|
-
|
49
|
-
def backend_service(smart_proxy)
|
50
|
-
@service ||= Katello::Pulp::Repository.instance_for_type(nonpersisted_repository, smart_proxy)
|
51
|
-
end
|
52
|
-
|
53
|
-
def node_syncable?
|
54
|
-
environment
|
55
|
-
end
|
56
|
-
|
57
|
-
def organization
|
58
|
-
if self.environment
|
59
|
-
self.environment.organization
|
60
|
-
else
|
61
|
-
self.content_view.organization
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
def content_view
|
66
|
-
self.content_view_version.content_view
|
67
|
-
end
|
68
|
-
|
69
|
-
def self.in_content_view(view_id)
|
70
|
-
joins(:content_view_version).where(
|
71
|
-
"#{Katello::ContentViewVersion.table_name}.content_view_id" => view_id)
|
72
|
-
end
|
73
|
-
|
74
|
-
def self.in_environment(env_id)
|
75
|
-
where(environment_id: env_id)
|
76
|
-
end
|
77
|
-
|
78
|
-
def archive?
|
79
|
-
self.environment.nil?
|
80
|
-
end
|
81
|
-
|
82
|
-
def nonpersisted_repository
|
83
|
-
#This creates a mock repository that can be used
|
84
|
-
root = ::Katello::RootRepository.new(content_type: ::Katello::Repository::PUPPET_TYPE,
|
85
|
-
name: "#{content_view.name} Puppet Environment",
|
86
|
-
mirror_on_sync: true,
|
87
|
-
product: Product.new(:organization => organization))
|
88
|
-
::Katello::Repository.new(root: root,
|
89
|
-
pulp_id: pulp_id,
|
90
|
-
content_view_version: content_view_version,
|
91
|
-
environment: environment)
|
92
|
-
end
|
93
|
-
|
94
|
-
def set_pulp_id
|
95
|
-
if self.environment
|
96
|
-
label = "#{self.content_view.label}-#{self.environment.label}-puppet-#{SecureRandom.uuid}"
|
97
|
-
else
|
98
|
-
version = self.content_view_version.version.gsub('.', '_')
|
99
|
-
label = "#{self.content_view.label}-v#{version}-puppet-#{SecureRandom.uuid}"
|
100
|
-
end
|
101
|
-
self.pulp_id ||= "#{self.organization.id}-#{label}"
|
102
|
-
end
|
103
|
-
|
104
|
-
def index_content(puppet_module_uuids)
|
105
|
-
associated_ids = PuppetModule.with_pulp_id(puppet_module_uuids).pluck(:id)
|
106
|
-
self.puppet_modules = PuppetModule.where(:id => associated_ids)
|
107
|
-
self.save!
|
108
|
-
end
|
109
|
-
|
110
|
-
def self.import_all
|
111
|
-
self.all.find_each do |cvpe|
|
112
|
-
cvpe.index_content(Katello::Pulp::PuppetModule.ids_for_repository(cvpe.pulp_id))
|
113
|
-
end
|
114
|
-
end
|
115
|
-
end
|
116
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
module Katello
|
2
|
-
class ContentViewPuppetEnvironmentPuppetModule < Katello::Model
|
3
|
-
# Do not use active record callbacks in this join model. Direct INSERTs and DELETEs are done
|
4
|
-
belongs_to :content_view_puppet_environment,
|
5
|
-
:inverse_of => :content_view_puppet_environment_puppet_modules,
|
6
|
-
:class_name => 'Katello::ContentViewPuppetEnvironment'
|
7
|
-
belongs_to :puppet_module,
|
8
|
-
:inverse_of => :content_view_puppet_environment_puppet_modules,
|
9
|
-
:class_name => 'Katello::PuppetModule'
|
10
|
-
end
|
11
|
-
end
|
@@ -1,63 +0,0 @@
|
|
1
|
-
module Katello
|
2
|
-
class ContentViewPuppetModule < Katello::Model
|
3
|
-
audited :associated_with => :content_view
|
4
|
-
belongs_to :content_view, :class_name => "Katello::ContentView", :inverse_of => :content_view_versions
|
5
|
-
|
6
|
-
validates_lengths_from_database
|
7
|
-
validates :content_view_id, :presence => true
|
8
|
-
validates :name, :uniqueness => { :scope => :content_view_id, :message => _('There is already a module named "%{value}" in this content view.') }
|
9
|
-
validates :uuid, :uniqueness => { :scope => :content_view_id }, :allow_blank => true
|
10
|
-
|
11
|
-
validates_with Validators::ContentViewPuppetModuleValidator
|
12
|
-
|
13
|
-
scoped_search :on => :name, :complete_value => true
|
14
|
-
scoped_search :on => :author, :complete_value => true
|
15
|
-
scoped_search :on => :uuid, :complete_value => true
|
16
|
-
scoped_search :on => :name, :relation => :content_view, :rename => :content_view_name
|
17
|
-
|
18
|
-
before_validation :set_attributes
|
19
|
-
|
20
|
-
validate :import_only_content_view
|
21
|
-
|
22
|
-
def puppet_module
|
23
|
-
PuppetModule.find_by(:pulp_id => self.uuid)
|
24
|
-
end
|
25
|
-
|
26
|
-
def computed_version
|
27
|
-
if self.uuid
|
28
|
-
puppet_module = PuppetModule.where(:pulp_id => self.uuid).first
|
29
|
-
else
|
30
|
-
puppet_module = PuppetModule.latest_module(
|
31
|
-
self.name,
|
32
|
-
self.author,
|
33
|
-
self.content_view.puppet_repos
|
34
|
-
)
|
35
|
-
end
|
36
|
-
|
37
|
-
puppet_module.try(:version)
|
38
|
-
end
|
39
|
-
|
40
|
-
def latest_in_modules_by_author?(puppet_module_list)
|
41
|
-
latest_from_list = puppet_module_list.where(:author => self.author).order(:sortable_version => :desc).first
|
42
|
-
self.computed_version.eql?(latest_from_list.try(:version))
|
43
|
-
end
|
44
|
-
|
45
|
-
private
|
46
|
-
|
47
|
-
def import_only_content_view
|
48
|
-
if self.content_view.import_only?
|
49
|
-
errors.add(:base, "Cannot add puppet modules to an import-only content view.")
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
def set_attributes
|
54
|
-
if self.uuid.present?
|
55
|
-
puppet_module = PuppetModule.with_identifiers(self.uuid).first
|
56
|
-
fail Errors::NotFound, _("Couldn't find Puppet Module with id '%s'") % self.uuid unless puppet_module
|
57
|
-
|
58
|
-
self.name = puppet_module.name
|
59
|
-
self.author = puppet_module.author
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
@@ -1,77 +0,0 @@
|
|
1
|
-
require 'rubygems/package'
|
2
|
-
require 'zlib'
|
3
|
-
|
4
|
-
module Katello
|
5
|
-
class PuppetModule < Katello::Model
|
6
|
-
include Concerns::PulpDatabaseUnit
|
7
|
-
|
8
|
-
CONTENT_TYPE = "puppet_module".freeze
|
9
|
-
|
10
|
-
has_many :content_view_puppet_environment_puppet_modules,
|
11
|
-
:class_name => "Katello::ContentViewPuppetEnvironmentPuppetModule",
|
12
|
-
:dependent => :destroy,
|
13
|
-
:inverse_of => :puppet_module
|
14
|
-
has_many :content_view_puppet_environments,
|
15
|
-
:through => :content_view_puppet_environment_puppet_modules,
|
16
|
-
:class_name => "Katello::ContentViewPuppetEnvironment"
|
17
|
-
|
18
|
-
scoped_search :on => :id, :only_explicit => true
|
19
|
-
scoped_search :on => :name, :complete_value => true
|
20
|
-
scoped_search :on => :author, :complete_value => true
|
21
|
-
scoped_search :on => :version, :complete_value => true
|
22
|
-
scoped_search :on => :summary
|
23
|
-
|
24
|
-
validates :pulp_id, :presence => true
|
25
|
-
validates :name, :presence => true
|
26
|
-
validates :author, :presence => true
|
27
|
-
|
28
|
-
before_save :set_sortable_version
|
29
|
-
|
30
|
-
def self.latest_module(name, author, repositories)
|
31
|
-
in_repositories(repositories).where(:name => name, :author => author).
|
32
|
-
order(:sortable_version => :desc).first
|
33
|
-
end
|
34
|
-
|
35
|
-
def self.parse_metadata(filepath)
|
36
|
-
metadata = nil
|
37
|
-
|
38
|
-
tar_extract = Gem::Package::TarReader.new(Zlib::GzipReader.open(filepath))
|
39
|
-
tar_extract.rewind # The extract has to be rewinded after every iteration
|
40
|
-
tar_extract.each do |entry|
|
41
|
-
next unless entry.file? && entry.full_name =~ %r{\A[^/]+/metadata.json\z}
|
42
|
-
metadata = entry.read
|
43
|
-
end
|
44
|
-
|
45
|
-
if metadata
|
46
|
-
return JSON.parse(metadata).with_indifferent_access
|
47
|
-
else
|
48
|
-
fail Katello::Errors::InvalidPuppetModuleError, _("Invalid puppet module. Please make sure the puppet module contains a metadata.json file and is properly compressed.")
|
49
|
-
end
|
50
|
-
rescue Zlib::GzipFile::Error, Gem::Package::TarInvalidError
|
51
|
-
raise Katello::Errors::InvalidPuppetModuleError, _("Could not unarchive puppet module. Please make sure the puppet module has been compressed properly.")
|
52
|
-
ensure
|
53
|
-
tar_extract&.close
|
54
|
-
end
|
55
|
-
|
56
|
-
def self.group_by_repoid(puppet_modules)
|
57
|
-
puppet_modules.each_with_object({}) do |puppet_module, result|
|
58
|
-
repo = puppet_module.repositories.first
|
59
|
-
|
60
|
-
if repo
|
61
|
-
result[repo.id] ||= []
|
62
|
-
result[repo.id] << puppet_module
|
63
|
-
else
|
64
|
-
fail _("Could not find Repository for module %s.") % puppet_module.name
|
65
|
-
end
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
private
|
70
|
-
|
71
|
-
def set_sortable_version
|
72
|
-
if version_changed? && !version.nil?
|
73
|
-
self.sortable_version = Util::Package.sortable_version(version)
|
74
|
-
end
|
75
|
-
end
|
76
|
-
end
|
77
|
-
end
|
@@ -1,7 +0,0 @@
|
|
1
|
-
module Katello
|
2
|
-
class RepositoryPuppetModule < Katello::Model
|
3
|
-
# Do not use active record callbacks in this join model. Direct INSERTs and DELETEs are done
|
4
|
-
belongs_to :repository, :inverse_of => :repository_puppet_modules, :class_name => 'Katello::Repository'
|
5
|
-
belongs_to :puppet_module, :inverse_of => :repository_puppet_modules, :class_name => 'Katello::PuppetModule'
|
6
|
-
end
|
7
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
module Katello
|
2
|
-
module Pulp
|
3
|
-
class PuppetModule < PulpContentUnit
|
4
|
-
include LazyAccessor
|
5
|
-
|
6
|
-
CONTENT_TYPE = "puppet_module".freeze
|
7
|
-
|
8
|
-
lazy_accessor :pulp_facts, :initializer => :backend_data
|
9
|
-
|
10
|
-
lazy_accessor :_storage_path, :tag_list, :description, :license,
|
11
|
-
:_ns, :project_page, :source, :dependencies,
|
12
|
-
:_content_type_id, :checksums, :_id, :types,
|
13
|
-
:initializer => :pulp_facts
|
14
|
-
|
15
|
-
def update_model(model)
|
16
|
-
custom_json = backend_data.slice('name', 'author', 'title', 'version', 'summary')
|
17
|
-
model.update!(custom_json)
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|