From 12b5a3d2cd8f554629762b4a8aafc358cbee2ffb Mon Sep 17 00:00:00 2001 From: akumari Date: Wed, 29 May 2024 19:57:31 +0530 Subject: [PATCH] Fixes #37517 - Upgrade theforeman-rubocop gem to the v0.1.0 Choose to inherit `lenient.yml` from `theforeman-rubocop` style, because that it matches to the rubocop style this repo follows. Also dropped `Rails` and `Style/Documentation` cops because that already exist in the lenient style we now follow. Update .rubocop_todo.yml file Fix Style/TrailingCommaInHashLiteral cop Fix cop Style/TrailingCommaInArrayLiteral Fix Style/KeywordParametersOrder cop Fix Style/ClassEqualityComparison cop Fix Style/CommentAnnotation cop Fix Style/RedundantAssignment cop Fix Style/CaseLikeIf cop Fix Lint/AmbiguousBlockAssociation offenses Added parentheses around method calls in assert statements to resolve ambiguous block associations as flagged by RuboCop. Fix Naming/RescuedExceptionsVariableName Fix Style/RegexpLiteral --- .github/workflows/ruby.yml | 2 + .rubocop.yml | 19 +- .rubocop_todo.yml | 625 +++++++++++++----- .../registry/registry_proxies_controller.rb | 12 +- .../api/rhsm/candlepin_proxies_controller.rb | 2 +- .../api/v2/activation_keys_controller.rb | 7 +- .../katello/api/v2/api_controller.rb | 2 +- .../api/v2/capsule_content_controller.rb | 8 +- .../v2/content_view_components_controller.rb | 2 +- .../v2/content_view_versions_controller.rb | 6 +- .../api/v2/content_views_controller.rb | 2 +- .../katello/api/v2/environments_controller.rb | 2 +- .../katello/api/v2/exports_controller.rb | 2 +- .../api/v2/host_collections_controller.rb | 4 +- .../katello/api/v2/host_errata_controller.rb | 2 +- .../api/v2/host_subscriptions_controller.rb | 2 +- .../api/v2/organizations_controller.rb | 2 +- .../katello/api/v2/repositories_controller.rb | 4 +- .../api/v2/repository_sets_controller.rb | 2 +- .../api/v2/multi_cv_params_handling.rb | 8 +- .../concerns/hosts_controller_extensions.rb | 2 +- .../concerns/smart_proxy_helper_extensions.rb | 10 +- .../katello/hosts_and_hostgroups_helper.rb | 4 +- .../content_view/incremental_updates.rb | 2 +- .../incremental_updates_presenter.rb | 2 +- .../katello/content_view_version/import.rb | 2 +- .../incremental_update.rb | 4 +- .../actions/katello/flatpak/scan_remote.rb | 7 +- app/lib/actions/katello/host/hypervisors.rb | 2 +- .../actions/katello/repository/discover.rb | 2 +- .../katello/repository/import_upload.rb | 2 +- .../katello/repository/upload_files.rb | 2 +- .../repository_set/enable_repository.rb | 2 +- .../katello/repository_set/scan_cdn.rb | 2 +- .../bind_entitlement.rb | 2 +- .../content_view_version/export_library.rb | 2 +- .../pulp3/repository/refresh_distribution.rb | 2 +- .../base_template_scope_extensions.rb | 2 +- app/lib/katello/http_resource.rb | 4 +- app/lib/katello/messaging/stomp_connection.rb | 8 +- .../resources/candlepin/activation_key.rb | 2 +- app/lib/katello/resources/candlepin/owner.rb | 2 +- .../katello/resources/candlepin/product.rb | 2 +- app/lib/katello/resources/cdn.rb | 2 +- app/lib/katello/resources/cdn/katello_cdn.rb | 6 +- .../katello/resources/discovery/container.rb | 8 +- app/lib/katello/resources/discovery/yum.rb | 4 +- .../katello/util/deduplication_migrator.rb | 16 +- app/lib/katello/util/model.rb | 4 +- app/lib/katello/util/search.rb | 10 +- app/lib/katello/util/task_status.rb | 38 +- .../katello/alternate_content_source.rb | 10 +- .../concerns/content_facet_host_extensions.rb | 4 +- .../concerns/host_managed_extensions.rb | 8 +- .../concerns/organization_extensions.rb | 2 +- .../katello/concerns/redhat_extensions.rb | 2 +- .../concerns/smart_proxy_extensions.rb | 12 +- app/models/katello/content.rb | 6 +- app/models/katello/content_view.rb | 14 +- .../katello/content_view_environment.rb | 7 +- .../content_view_erratum_filter_rule.rb | 2 +- app/models/katello/content_view_filter.rb | 4 +- app/models/katello/content_view_history.rb | 2 +- app/models/katello/content_view_repository.rb | 2 +- app/models/katello/content_view_version.rb | 6 +- .../content_view_version_export_history.rb | 4 +- .../content_view_version_import_history.rb | 2 +- .../katello/glue/candlepin/activation_key.rb | 2 +- .../glue/candlepin/candlepin_object.rb | 2 +- app/models/katello/glue/candlepin/pool.rb | 2 +- app/models/katello/glue/pulp/repos.rb | 2 +- app/models/katello/host/content_facet.rb | 8 +- app/models/katello/host/info_provider.rb | 4 +- app/models/katello/host/subscription_facet.rb | 4 +- .../katello/host_available_module_stream.rb | 2 +- app/models/katello/installed_product.rb | 4 +- app/models/katello/ping.rb | 2 +- app/models/katello/repository.rb | 8 +- app/models/katello/rhel_lifecycle_status.rb | 20 +- app/models/katello/root_repository.rb | 12 +- app/models/katello/task_status.rb | 2 +- app/models/katello/upstream_pool.rb | 4 +- .../katello/product_content_presenter.rb | 4 +- .../katello/repository_presenter.rb | 6 +- .../katello/sync_status_presenter.rb | 6 +- .../katello/candlepin_event_listener.rb | 2 +- .../katello/event_monitor/poller_thread.rb | 2 +- app/services/katello/event_queue.rb | 2 +- .../katello/product_content_importer.rb | 2 +- .../katello/pulp3/alternate_content_source.rb | 4 +- .../katello/pulp3/ansible_collection.rb | 2 +- app/services/katello/pulp3/content.rb | 1 + .../pulp3/content_view_version/export.rb | 13 +- .../content_view_version/export_validator.rb | 2 +- .../pulp3/content_view_version/import.rb | 4 +- .../content_view_version/import_gpg_keys.rb | 2 +- .../importable_products.rb | 4 +- .../importable_repositories.rb | 8 +- .../metadata_generator.rb | 4 +- app/services/katello/pulp3/deb.rb | 2 +- app/services/katello/pulp3/docker_manifest.rb | 2 +- .../katello/pulp3/docker_manifest_list.rb | 4 +- app/services/katello/pulp3/docker_tag.rb | 2 +- app/services/katello/pulp3/erratum.rb | 4 +- app/services/katello/pulp3/file_unit.rb | 2 +- .../katello/pulp3/generic_content_unit.rb | 2 +- app/services/katello/pulp3/module_stream.rb | 4 +- app/services/katello/pulp3/repository.rb | 14 +- .../pulp3/repository/ansible_collection.rb | 2 +- app/services/katello/pulp3/repository/apt.rb | 6 +- .../katello/pulp3/repository/docker.rb | 4 +- app/services/katello/pulp3/repository/file.rb | 2 +- .../katello/pulp3/repository/generic.rb | 2 +- app/services/katello/pulp3/repository/yum.rb | 10 +- .../katello/pulp3/repository_mirror.rb | 6 +- app/services/katello/registration_manager.rb | 2 +- app/services/katello/repository_type.rb | 6 +- .../subscriptions/expire_soon.rb | 6 +- .../manifest_expire_soon_warning.rb | 6 +- .../ui_notifications/task_notification.rb | 4 +- .../katello/upstream_connection_checker.rb | 2 +- .../api/v2/activation_keys/base.json.rabl | 6 +- .../alternate_content_sources/base.json.rabl | 2 +- .../v2/capsule_content/sync_status.json.rabl | 10 +- .../katello/api/v2/common/_metadata.json.rabl | 2 +- .../api/v2/content_credentials/show.json.rabl | 2 +- .../api/v2/content_facet/base.json.rabl | 8 +- .../api/v2/content_facet/show.json.rabl | 2 +- .../content_view_filter_rules/show.json.rabl | 2 +- .../v2/content_view_filters/show.json.rabl | 2 +- .../v2/content_view_versions/base.json.rabl | 4 +- .../api/v2/content_views/base.json.rabl | 4 +- .../api/v2/content_views/show.json.rabl | 2 +- .../api/v2/docker_tags/_base.json.rabl | 4 +- .../api/v2/environments/show.json.rabl | 8 +- .../katello/api/v2/gpg_keys/show.json.rabl | 2 +- .../api/v2/host_collections/base.json.rabl | 2 +- app/views/katello/api/v2/hosts/base.json.rabl | 4 +- .../api/v2/package_groups/base.json.rabl | 4 +- .../katello/api/v2/products/show.json.rabl | 4 +- .../api/v2/repositories/show.json.rabl | 2 +- .../api/v2/repository_sets/show.json.rabl | 2 +- .../api/v2/subscriptions/base.json.rabl | 2 +- .../api/v2/subscriptions/show.json.rabl | 6 +- .../katello/api/v2/sync_plans/show.json.rabl | 2 +- db/migrate/20160808002834_add_files.rb | 2 +- ...t_view_version_description_to_histories.rb | 2 +- ...0818192230_update_system_purpose_status.rb | 2 +- .../20201012172713_remove_gpg_key_perms.rb | 2 +- ...220185935_clean_duplicate_content_units.rb | 4 +- ...change_content_source_job_template_name.rb | 2 +- ...3_remove_entitlement_mode_host_statuses.rb | 2 +- db/seeds.d/106-mail_notifications.rb | 18 +- db/seeds.d/108-subcription-bookmarks.rb | 2 +- .../109-katello-notification-blueprints.rb | 42 +- db/seeds.d/110-content-view-autopublish.rb | 10 +- db/seeds.d/111-container-image-bookmarks.rb | 2 +- db/seeds.d/111-upgrade_tasks.rb | 2 +- engines/bastion/lib/bastion.rb | 2 +- engines/bastion/lib/bastion/engine.rb | 2 +- .../lib/bastion_katello/engine.rb | 2 +- gemfile.d/test.rb | 1 - katello.gemspec | 2 + lib/katello/engine.rb | 10 +- lib/katello/permission_creator.rb | 98 +-- lib/katello/permissions/host_permissions.rb | 8 +- .../permissions/organization_permissions.rb | 8 +- .../permissions/registry_permissions.rb | 2 +- lib/katello/permissions/roles_permissions.rb | 2 +- lib/katello/permissions/user_permissions.rb | 2 +- lib/katello/plugin.rb | 8 +- lib/katello/repository_types/python.rb | 2 +- lib/katello/scheduled_jobs.rb | 2 +- lib/katello/tasks/receptor/extract_orgs.rake | 2 +- lib/katello/tasks/reimport.rake | 2 +- .../reupdate_content_import_export_perms.rake | 2 +- .../tasks/upgrades/4.3/fix_url_auth.rake | 2 +- spec/helpers/product_test_data.rb | 24 +- spec/models/environment_spec.rb | 2 +- spec/models/provider_spec.rb | 6 +- spec/models/task_status_spec.rb | 40 +- test/actions/katello/activation_key_test.rb | 2 +- test/actions/katello/capsule_content_test.rb | 14 +- .../katello/cdn_configuration/update_test.rb | 10 +- test/actions/katello/content_view_test.rb | 14 +- .../import_library_test.rb | 12 +- .../import_repository_test.rb | 12 +- .../content_view_version/import_test.rb | 12 +- .../katello/flatpak/scan_remote_test.rb | 2 +- test/actions/katello/foreman_test.rb | 2 +- test/actions/katello/host/hypervisors_test.rb | 4 +- .../katello/host/hypervisors_update_test.rb | 8 +- .../katello/repository/import_upload_test.rb | 2 +- .../repository/metadata_generate_test.rb | 2 +- test/actions/katello/repository_set_test.rb | 4 +- test/actions/katello/repository_test.rb | 4 +- .../alternate_content_source_update_test.rb | 2 +- .../registry_proxies_controller_test.rb | 10 +- .../rhsm/candlepin_proxies_controller_test.rb | 16 +- .../api/v2/activation_keys_controller_test.rb | 42 +- ...ternate_content_sources_controller_test.rb | 26 +- .../api/v2/bookmark_controller_test.rb | 2 +- .../api/v2/concerns/authorization_test.rb | 10 +- .../v2/concerns/bulk_hosts_extensions_test.rb | 2 +- ...ent_export_incrementals_controller_test.rb | 10 +- .../api/v2/content_exports_controller_test.rb | 4 +- .../api/v2/content_imports_controller_test.rb | 10 +- ...ntent_view_environments_controller_test.rb | 8 +- .../content_view_versions_controller_test.rb | 2 +- .../api/v2/content_views_controller_test.rb | 24 +- .../api/v2/environments_controller_test.rb | 30 +- .../api/v2/host_errata_controller_test.rb | 20 +- .../v2/host_subscriptions_controller_test.rb | 10 +- .../v2/hosts_bulk_actions_controller_test.rb | 4 +- .../api/v2/hosts_controller_test.rb | 42 +- .../api/v2/products_controller_test.rb | 4 +- .../api/v2/repositories_controller_test.rb | 2 +- .../api/v2/subscriptions_controller_test.rb | 2 +- .../api/v2/sync_plans_controller_test.rb | 12 +- .../foreman/hostgroups_controller_test.rb | 10 +- .../foreman/hosts_controller_test.rb | 6 +- .../remote_execution_controller_test.rb | 16 +- .../hosts_and_hostgroups_helper_test.rb | 2 +- test/lib/access_permissions_test.rb | 4 +- .../base_template_scope_extensions_test.rb | 2 +- test/lib/event_daemon/monitor_test.rb | 4 +- test/lib/event_daemon/runner_test.rb | 4 +- test/lib/http_resource_test.rb | 4 +- test/lib/messaging/stomp_connection_test.rb | 4 +- test/lib/repo_discovery_test.rb | 8 +- test/lib/resources/candlepin_test.rb | 2 +- test/lib/resources/cdn_test.rb | 2 +- test/lib/resources/katello_cdn_test.rb | 16 +- test/lib/tasks/receptor/extract_orgs_test.rb | 4 +- .../upgrades/4.1/fix_invalid_pools_test.rb | 6 +- ...update_content_import_export_perms_test.rb | 2 +- test/lib/util/cdn_var_subsitutor_test.rb | 12 +- test/lib/util/deduplication_migrator_test.rb | 10 +- test/lib/util/hostgroup_facets_helper_test.rb | 6 +- test/lib/util/package_test.rb | 4 +- .../lib/util/pulpcore_content_filters_test.rb | 4 +- ...oup_kickstart_repository_validator_test.rb | 2 +- ...5935_clean_duplicate_content_units_test.rb | 2 +- test/models/association_test.rb | 4 +- .../concerns/host_managed_extensions_test.rb | 15 +- .../models/concerns/redhat_extensions_test.rb | 6 +- .../concerns/smart_proxy_extensions_test.rb | 98 +-- test/models/content_test.rb | 10 +- ...nt_view_environment_activation_key_test.rb | 3 +- test/models/erratum_test.rb | 2 +- test/models/host/content_facet_test.rb | 6 +- .../katello/alternate_content_source_test.rb | 2 +- test/models/module_stream_test.rb | 2 +- test/models/ping_test.rb | 18 +- test/models/pool_test.rb | 16 +- test/models/product_content_test.rb | 10 +- test/models/repository_base.rb | 6 +- test/models/repository_test.rb | 4 +- test/models/rhel_lifecycle_status_test.rb | 2 +- test/models/root_repository_test.rb | 2 +- test/models/smart_proxy_sync_history_test.rb | 2 +- test/models/subscription_test.rb | 8 +- test/models/sync_plan_test.rb | 2 +- test/models/upstream_pool_test.rb | 2 +- .../host_subscriptions_presenter_test.rb | 10 +- .../candlepin/message_handler_test.rb | 4 +- .../katello/candlepin/event_handler_test.rb | 2 +- .../katello/candlepin_event_listener_test.rb | 2 +- .../event_monitor/poller_thread_test.rb | 2 +- .../katello/package_profile_uploader_test.rb | 2 +- .../katello/product_content_importer_test.rb | 8 +- .../katello/profiles_uploader_test.rb | 2 +- .../import_gpg_keys_test.rb | 2 +- .../pulp3/content_view_version/import_test.rb | 6 +- .../import_validator_test.rb | 12 +- .../importable_products_test.rb | 4 +- .../importable_repositories_test.rb | 12 +- .../katello/pulp3/module_stream_test.rb | 4 +- ...sible_collection_repository_mirror_test.rb | 2 +- .../pulp3/repository/apt/copy_units_test.rb | 6 +- .../docker/docker_repository_mirror_test.rb | 2 +- .../pulp3/repository/yum/copy_units_test.rb | 6 +- .../katello/pulp3/repository_mirror_test.rb | 4 +- .../pulp3/smart_proxy_repository_test.rb | 2 +- .../services/katello/pulp3/task_group_test.rb | 6 +- test/services/katello/pulp3/task_test.rb | 2 +- .../katello/pxe_files_downloader_test.rb | 2 +- test/support/annotations/vcr_request.rb | 2 +- test/support/auth_support.rb | 2 +- test/support/export_support.rb | 2 +- test/support/fixtures_support.rb | 2 +- test/support/foreman_tasks/task.rb | 2 +- test/support/vcr.rb | 2 +- 293 files changed, 1378 insertions(+), 1104 deletions(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 1f69a4bf6c0..9edd0cb76f4 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -16,6 +16,8 @@ jobs: rubocop: name: Rubocop uses: theforeman/actions/.github/workflows/rubocop.yml@v0 + with: + command: bundle exec rubocop --parallel --format github test: name: Ruby diff --git a/.rubocop.yml b/.rubocop.yml index de1be94cf3d..894d055757b 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,15 +1,11 @@ -require: - - rubocop-performance - - rubocop-rails - - rubocop-minitest - # TODO: Remove the following once the rules in the file is addressed inherit_from: - .rubocop_todo.yml # end TODO -Rails: - Enabled: true +inherit_gem: + theforeman-rubocop: + - lenient.yml Rails/ContentTag: Enabled: false @@ -88,9 +84,6 @@ Style/RedundantSelf: Style/RedundantReturn: Enabled: false -Style/Documentation: - Enabled: false # don't require documentation - Style/Encoding: Enabled: false # don't require utf-8 encoding on every file @@ -194,3 +187,9 @@ Style/RedundantFileExtensionInRequire: Lint/MixedRegexpCaptureTypes: Enabled: false + +Style/OptionalBooleanParameter: + Enabled: false + +Lint/RedundantCopDisableDirective: + Enabled: false diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index e08bc499e05..6df2ad76c31 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,300 +1,507 @@ # This configuration was generated by -# `rubocop --auto-gen-config --exclude-limit 0` -# on 2020-02-27 20:28:28 +0100 using RuboCop version 0.80.0. +# `rubocop --auto-gen-config` +# on 2024-11-05 08:03:08 UTC using RuboCop version 1.23.0. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. -# Offense count: 258 +# Offense count: 2056 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, IndentationWidth. # SupportedStyles: with_first_argument, with_fixed_indentation Layout/ArgumentAlignment: Enabled: false -# Offense count: 48 +# Offense count: 57 # Cop supports --auto-correct. Layout/ClosingParenthesisIndentation: Enabled: false -# Offense count: 240 -# Cop supports --auto-correct. -Layout/EmptyLineAfterGuardClause: - Enabled: false - -# Offense count: 82 +# Offense count: 138 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, IndentationWidth. # SupportedStyles: consistent, consistent_relative_to_receiver, special_for_inner_method_call, special_for_inner_method_call_in_parentheses Layout/FirstArgumentIndentation: Enabled: false -# Offense count: 903 +# Offense count: 13 # Cop supports --auto-correct. -# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. +# Configuration parameters: EnforcedStyle, IndentationWidth. +# SupportedStyles: special_inside_parentheses, consistent, align_braces +Layout/FirstHashElementIndentation: + Exclude: + - 'app/models/katello/host/content_facet.rb' + - 'test/lib/resources/katello_cdn_test.rb' + - 'test/lib/util/deduplication_migrator_test.rb' + - 'test/models/host/subscription_facet_test.rb' + +# Offense count: 248 +# Cop supports --auto-correct. +# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. # URISchemes: http, https Layout/LineLength: - Max: 273 + Max: 200 -# Offense count: 23 +# Offense count: 24 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: symmetrical, new_line, same_line Layout/MultilineArrayBraceLayout: - Enabled: false - -# Offense count: 63 + Exclude: + - 'app/controllers/katello/api/v2/host_collections_controller.rb' + - 'app/controllers/katello/api/v2/repositories_controller.rb' + - 'app/models/katello/content_view_filter.rb' + - 'app/models/katello/content_view_repository.rb' + - 'app/models/katello/root_repository.rb' + - 'app/services/katello/host_status_manager.rb' + - 'spec/helpers/product_test_data.rb' + - 'test/controllers/api/v2/activation_keys_controller_test.rb' + - 'test/controllers/api/v2/content_view_versions_controller_test.rb' + - 'test/controllers/api/v2/content_views_controller_test.rb' + - 'test/models/content_view_environment_content_facet_test.rb' + - 'test/models/erratum_test.rb' + - 'test/models/ping_test.rb' + - 'test/services/katello/pulp3/api/client_api_test.rb' + +# Offense count: 114 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: symmetrical, new_line, same_line Layout/MultilineHashBraceLayout: Enabled: false -# Offense count: 257 +# Offense count: 359 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: symmetrical, new_line, same_line Layout/MultilineMethodCallBraceLayout: Enabled: false -# Offense count: 144 +# Offense count: 179 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, IndentationWidth. # SupportedStyles: aligned, indented, indented_relative_to_receiver Layout/MultilineMethodCallIndentation: Enabled: false -# Offense count: 99 +# Offense count: 124 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, IndentationWidth. # SupportedStyles: aligned, indented Layout/MultilineOperationIndentation: Enabled: false -# Offense count: 14 +# Offense count: 20 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBrackets. # SupportedStyles: space, no_space, compact # SupportedStylesForEmptyBrackets: space, no_space Layout/SpaceInsideArrayLiteralBrackets: - Enabled: false + Exclude: + - 'app/models/katello/concerns/operatingsystem_extensions.rb' + - 'app/models/katello/deb.rb' + - 'app/models/katello/host/content_facet.rb' + - 'db/seeds.d/110-content-view-autopublish.rb' + - 'test/actions/pulp3/orchestration/file_remove_units_test.rb' + - 'test/lib/util/hostgroup_facets_helper_test.rb' + - 'test/mailers/subscription_mailer_test.rb' + - 'test/models/root_repository_test.rb' + - 'test/services/katello/pulp3/module_stream_test.rb' -# Offense count: 32 +# Offense count: 23 +# Configuration parameters: IgnoredMethods. Lint/AmbiguousBlockAssociation: - Enabled: false + Exclude: + - 'app/services/katello/pulp3/pulp_content_unit.rb' + - 'test/controllers/api/v2/content_views_controller_test.rb' + - 'test/controllers/api/v2/package_groups_controller_test.rb' + - 'test/controllers/api/v2/products_bulk_actions_controller_test.rb' + - 'test/controllers/api/v2/root_controller_test.rb' + - 'test/models/authorization/repository_authorization_test.rb' + - 'test/models/concerns/operatingsystem_extensions_test.rb' + - 'test/models/content_view_test.rb' + - 'test/models/repository_test.rb' + - 'test/services/product_content_finder_test.rb' -# Offense count: 70 +# Offense count: 13 +# Configuration parameters: AllowedMethods. +# AllowedMethods: enums +Lint/ConstantDefinitionInBlock: + Exclude: + - 'app/models/katello/concerns/content_facet_host_extensions.rb' + - 'app/models/katello/concerns/organization_extensions.rb' + - 'engines/bastion/config/routes.rb' + - 'lib/katello/tasks/annotate_scenarios.rake' + - 'lib/katello/tasks/clean_backend_objects.rake' + - 'lib/katello/tasks/clean_old_file_repos.rake' + - 'lib/katello/tasks/reset.rake' + - 'lib/katello/tasks/virt_who_report.rake' + - 'spec/models/lazy_accessor_spec.rb' + +# Offense count: 73 # Configuration parameters: MaximumRangeSize. Lint/MissingCopEnableDirective: Enabled: false -# Offense count: 3 +# Offense count: 5 +Lint/MissingSuper: + Exclude: + - 'app/lib/actions/helpers/presenter.rb' + - 'app/lib/katello/resources/discovery/container.rb' + - 'app/lib/katello/resources/discovery/yum.rb' + - 'app/services/katello/pulp3/smart_proxy_mirror_repository.rb' + - 'app/services/katello/ui_notifications/task_notification.rb' + +# Offense count: 2 # Cop supports --auto-correct. Lint/NonDeterministicRequireOrder: - Enabled: false + Exclude: + - 'lib/katello/permissions.rb' + - 'test/lib/tasks/reimport_test.rb' -# Offense count: 10 +# Offense count: 7 # Cop supports --auto-correct. Lint/RedundantStringCoercion: - Enabled: false + Exclude: + - 'app/lib/katello/errors.rb' + - 'app/lib/katello/lazy_accessor.rb' + - 'app/models/katello/task_status.rb' -# Offense count: 968 +# Offense count: 1 +# Configuration parameters: IgnoredPatterns. +# IgnoredPatterns: (?-mix:(exactly|at_least|at_most)\(\d+\)\.times) +Lint/UnreachableLoop: + Exclude: + - 'app/lib/actions/katello/host/hypervisors_update.rb' + +# Offense count: 7 +# Cop supports --auto-correct. +# Configuration parameters: AllowComments. +Lint/UselessMethodDefinition: + Exclude: + - 'app/controllers/katello/api/v2/debs_controller.rb' + - 'app/controllers/katello/api/v2/errata_controller.rb' + - 'app/controllers/katello/api/v2/packages_controller.rb' + - 'app/controllers/katello/api/v2/srpms_controller.rb' + - 'app/lib/actions/pulp3/repository/upload_file.rb' + - 'app/models/katello/concerns/smart_proxy_extensions.rb' + - 'app/services/katello/pulp3/api/generic.rb' + +# Offense count: 1137 +# Configuration parameters: IgnoredMethods, CountRepeatedAttributes. Metrics/AbcSize: Max: 60 -# Offense count: 148 -# Configuration parameters: CountComments, ExcludedMethods. -# ExcludedMethods: refine +# Offense count: 183 +# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods. +# IgnoredMethods: refine Metrics/BlockLength: Max: 273 -# Offense count: 5 +# Offense count: 8 # Configuration parameters: CountBlocks. Metrics/BlockNesting: Max: 4 -# Offense count: 99 -# Configuration parameters: CountComments. +# Offense count: 146 +# Configuration parameters: CountComments, CountAsOne. Metrics/ClassLength: - Max: 315 + Max: 297 -# Offense count: 137 +# Offense count: 203 +# Configuration parameters: IgnoredMethods. Metrics/CyclomaticComplexity: Max: 14 -# Offense count: 25 -# Configuration parameters: CountComments. +# Offense count: 20 +# Configuration parameters: CountComments, CountAsOne. Metrics/ModuleLength: - Max: 343 + Max: 325 -# Offense count: 3 -# Configuration parameters: CountKeywordArgs. +# Offense count: 10 +# Configuration parameters: CountKeywordArgs, MaxOptionalParameters. Metrics/ParameterLists: Max: 7 -# Offense count: 122 +# Offense count: 177 +# Configuration parameters: IgnoredMethods. Metrics/PerceivedComplexity: Max: 18 -# Offense count: 5 +# Offense count: 12 # Configuration parameters: EnforcedStyleForLeadingUnderscores. # SupportedStylesForLeadingUnderscores: disallowed, required, optional Naming/MemoizedInstanceVariableName: - Enabled: false + Exclude: + - 'app/controllers/katello/api/v2/activation_keys_controller.rb' + - 'app/controllers/katello/api/v2/sync_plans_controller.rb' + - 'app/lib/actions/helpers/notifications.rb' + - 'app/lib/katello/util/path_with_substitutions.rb' + - 'app/models/katello/alternate_content_source.rb' + - 'app/models/katello/errata_status.rb' + - 'app/models/katello/glue/pulp/repos.rb' + - 'app/models/katello/repository.rb' + - 'app/models/katello/smart_proxy_alternate_content_source.rb' + - 'app/services/katello/organization_creator.rb' + - 'app/services/katello/pulp3/task.rb' + - 'app/services/katello/pulp3/task_group.rb' -# Offense count: 10 +# Offense count: 12 # Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames. -# AllowedNames: io, id, to, by, on, in, at, ip, db, os, pp +# AllowedNames: at, by, db, id, in, io, ip, of, on, os, pp, to Naming/MethodParameterName: - Enabled: false + Exclude: + - 'app/controllers/katello/api/v2/repository_sets_controller.rb' + - 'app/helpers/katello/hosts_and_hostgroups_helper.rb' + - 'app/helpers/katello/translation_helper.rb' + - 'app/lib/katello/http_resource.rb' + - 'app/lib/katello/util/hostgroup_facets_helper.rb' + - 'app/lib/katello/util/package_filter.rb' + - 'app/lib/katello/util/support.rb' + - 'test/source_code_test.rb' + - 'test/support/candlepin/consumer_support.rb' -# Offense count: 14 +# Offense count: 17 # Cop supports --auto-correct. # Configuration parameters: PreferredName. Naming/RescuedExceptionsVariableName: - Enabled: false - -# Offense count: 34 -# Configuration parameters: EnforcedStyle. -# SupportedStyles: snake_case, normalcase, non_integer -Naming/VariableNumber: - Enabled: false + Exclude: + - 'app/controllers/katello/api/registry/registry_proxies_controller.rb' + - 'app/controllers/katello/api/v2/api_controller.rb' + - 'app/controllers/katello/api/v2/repositories_controller.rb' + - 'app/controllers/katello/application_controller.rb' + - 'app/controllers/katello/concerns/hosts_controller_extensions.rb' + - 'app/controllers/katello/concerns/organizations_controller_extensions.rb' + - 'app/lib/actions/katello/host/recalculate_errata_status.rb' + - 'app/lib/actions/middleware/record_smart_proxy_sync_history.rb' + - 'app/lib/katello/event_daemon/monitor.rb' + - 'app/lib/katello/http_resource.rb' + - 'app/models/katello/concerns/smart_proxy_extensions.rb' + - 'app/services/katello/pulp3/service_common.rb' + - 'lib/katello/tasks/import_applicability.rake' + - 'lib/katello/tasks/update_subscription_facet_backend_data.rake' -# Offense count: 8 +# Offense count: 5 # Cop supports --auto-correct. Performance/Casecmp: - Enabled: false + Exclude: + - 'app/helpers/katello/application_helper.rb' + - 'app/models/katello/candlepin/repository_mapper.rb' + - 'app/models/katello/erratum.rb' + - 'test/support/annotations/matched_annotation.rb' -# Offense count: 5 +# Offense count: 11 # Cop supports --auto-correct. Performance/InefficientHashSearch: - Enabled: false + Exclude: + - 'app/lib/actions/katello/content_view/publish.rb' + - 'app/lib/actions/katello/content_view_version/incremental_update.rb' + - 'app/lib/actions/middleware/execute_if_contents_changed.rb' + - 'app/lib/actions/middleware/propagate_output.rb' + - 'app/models/katello/alternate_content_source.rb' # Offense count: 1 # Cop supports --auto-correct. Performance/RangeInclude: - Enabled: false + Exclude: + - 'lib/katello/apipie/validators.rb' # Offense count: 4 # Cop supports --auto-correct. Performance/RedundantBlockCall: - Enabled: false + Exclude: + - 'app/controllers/katello/application_controller.rb' + - 'app/helpers/katello/layout_helper.rb' + - 'test/source_code_test.rb' # Offense count: 1 # Cop supports --auto-correct. Performance/RedundantMatch: - Enabled: false + Exclude: + - 'app/lib/katello/validators/gpg_key_content_validator.rb' -# Offense count: 7 +# Offense count: 16 # Cop supports --auto-correct. # Configuration parameters: MaxKeyValuePairs. Performance/RedundantMerge: - Enabled: false + Exclude: + - 'app/lib/katello/resources/candlepin/owner.rb' + - 'app/services/katello/pulp3/alternate_content_source.rb' + - 'app/services/katello/pulp3/repository.rb' + - 'app/services/katello/pulp3/repository/apt.rb' + - 'app/services/katello/pulp3/repository/generic.rb' + - 'app/services/katello/pulp3/repository/yum.rb' + - 'app/services/katello/pulp3/repository_mirror.rb' + - 'lib/katello/url_constrained_cookie_store.rb' + - 'spec/models/product_spec.rb' # Offense count: 1 # Cop supports --auto-correct. -# Configuration parameters: AutoCorrect. +# Configuration parameters: AutoCorrect, SafeMultiline. Performance/StartWith: - Enabled: false + Exclude: + - 'test/support/actions/fixtures.rb' -# Offense count: 7 +# Offense count: 11 # Cop supports --auto-correct. Performance/StringReplacement: - Enabled: false + Exclude: + - 'app/controllers/katello/api/v2/generic_content_units_controller.rb' + - 'app/helpers/katello/errata_mailer_helper.rb' + - 'app/lib/actions/katello/repository/errata_mail.rb' + - 'app/models/katello/host/subscription_facet.rb' + - 'app/models/katello/repository.rb' + - 'app/services/cert/rhsm_client.rb' + - 'app/services/katello/ui_notifications/hosts/lifecycle_expire_soon.rb' + - 'test/controllers/api/v2/organizations_controller_test.rb' + - 'test/models/activation_key_test.rb' # Offense count: 5 # Cop supports --auto-correct. # Configuration parameters: AutoCorrect. Performance/TimesMap: - Enabled: false + Exclude: + - 'test/lib/validators/katello_label_format_validator_test.rb' + - 'test/models/host_collection_test.rb' + - 'test/models/rpm_test.rb' + - 'test/models/srpm_test.rb' -# Offense count: 9 -# Cop supports --auto-correct. -# Configuration parameters: Include. -# Include: **/test/**/* -Rails/AssertNot: - Enabled: false - -# Offense count: 17 -# Configuration parameters: EnforcedStyle. +# Offense count: 34 +# Configuration parameters: EnforcedStyle, AllowToTime. # SupportedStyles: strict, flexible Rails/Date: - Enabled: false + Exclude: + - 'app/controllers/katello/api/v2/api_controller.rb' + - 'app/models/katello/pool.rb' + - 'app/models/katello/rhel_lifecycle_status.rb' + - 'test/controllers/api/v2/subscriptions_controller_test.rb' + - 'test/controllers/foreman/hosts_controller_test.rb' + - 'test/factories/pool_factory.rb' + - 'test/models/rhel_lifecycle_status_test.rb' -# Offense count: 16 +# Offense count: 14 # Configuration parameters: EnforcedStyle. # SupportedStyles: slashes, arguments Rails/FilePath: - Enabled: false + Exclude: + - 'app/controllers/katello/api/registry/registry_proxies_controller.rb' + - 'app/controllers/katello/api/v2/subscriptions_controller.rb' + - 'app/lib/actions/katello/repository/upload_files.rb' + - 'app/lib/actions/middleware/record_fixtures.rb' + - 'lib/katello/tasks/annotate_scenarios.rake' + - 'test/controllers/api/registry/registry_proxies_controller_test.rb' + - 'test/katello_test_helper.rb' + - 'test/lib/access_permissions_test.rb' + - 'test/lib/event_daemon/runner_test.rb' + - 'test/lib/tasks/receptor/extract_orgs_test.rb' -# Offense count: 20 -# Cop supports --auto-correct. -# Configuration parameters: Include. -# Include: app/models/**/*.rb -Rails/FindBy: - Enabled: false - -# Offense count: 3 +# Offense count: 7 # Cop supports --auto-correct. -# Configuration parameters: Include. +# Configuration parameters: Include, IgnoredMethods. # Include: app/models/**/*.rb +# IgnoredMethods: order, limit, select, lock Rails/FindEach: - Enabled: false + Exclude: + - 'app/models/katello/concerns/host_managed_extensions.rb' + - 'app/models/katello/concerns/operatingsystem_extensions.rb' + - 'app/models/katello/content.rb' + - 'app/models/katello/content_view.rb' + - 'app/models/katello/repository.rb' -# Offense count: 13 +# Offense count: 17 # Configuration parameters: Include. # Include: app/helpers/**/*.rb Rails/HelperInstanceVariable: - Enabled: false + Exclude: + - 'app/helpers/katello/katello_urls_helper.rb' + - 'app/helpers/katello/subscription_mailer_helper.rb' + - 'app/helpers/katello/taxonomy_helper.rb' -# Offense count: 29 +# Offense count: 22 # Configuration parameters: Include. # Include: app/models/**/*.rb Rails/InverseOf: - Enabled: false - -# Offense count: 30 + Exclude: + - 'app/models/katello/concerns/content_facet_host_extensions.rb' + - 'app/models/katello/concerns/host_managed_extensions.rb' + - 'app/models/katello/concerns/organization_extensions.rb' + - 'app/models/katello/concerns/subscription_facet_host_extensions.rb' + - 'app/models/katello/content_view.rb' + - 'app/models/katello/content_view_deb_filter.rb' + - 'app/models/katello/content_view_docker_filter.rb' + - 'app/models/katello/content_view_erratum_filter.rb' + - 'app/models/katello/content_view_module_stream_filter.rb' + - 'app/models/katello/content_view_package_filter.rb' + - 'app/models/katello/content_view_package_group_filter.rb' + - 'app/models/katello/kt_environment.rb' + - 'app/models/katello/product.rb' + - 'app/models/katello/repository.rb' + +# Offense count: 45 # Configuration parameters: Include. # Include: app/controllers/**/*.rb Rails/LexicallyScopedActionFilter: Enabled: false -# Offense count: 9 +# Offense count: 10 Rails/OutputSafety: - Enabled: false + Exclude: + - 'app/helpers/katello/application_helper.rb' + - 'app/helpers/katello/errata_mailer_helper.rb' + - 'app/helpers/katello/hosts_and_hostgroups_helper.rb' + - 'app/helpers/katello/layout_helper.rb' + - 'engines/bastion/app/helpers/bastion/layout_helper.rb' -# Offense count: 14 +# Offense count: 15 # Cop supports --auto-correct. Rails/Presence: - Enabled: false - -# Offense count: 104 + Exclude: + - 'app/controllers/katello/api/v2/api_controller.rb' + - 'app/controllers/katello/api/v2/errata_controller.rb' + - 'app/helpers/katello/hosts_and_hostgroups_helper.rb' + - 'app/helpers/katello/taxonomy_helper.rb' + - 'app/lib/actions/katello/organization/manifest_refresh.rb' + - 'app/models/katello/content_view_filter.rb' + - 'app/services/katello/managed_content_medium_provider.rb' + - 'app/services/katello/pulp3/repository/ansible_collection.rb' + - 'app/services/katello/pulp3/repository/apt.rb' + - 'app/services/katello/pulp3/task.rb' + - 'db/migrate/20160619223332_fix_viewer_role.rb' + - 'db/seeds.d/102-organizations.rb' + +# Offense count: 123 # Cop supports --auto-correct. # Configuration parameters: NotNilAndNotEmpty, NotBlank, UnlessBlank. Rails/Present: Enabled: false -# Offense count: 12 +# Offense count: 10 +# Cop supports --auto-correct. # Configuration parameters: Include. # Include: **/Rakefile, **/*.rake Rails/RakeEnvironment: - Enabled: false + Exclude: + - 'lib/katello/tasks/jenkins.rake' + - 'lib/katello/tasks/reset.rake' + - 'lib/katello/tasks/rubocop.rake' + - 'lib/katello/tasks/test.rake' -# Offense count: 622 +# Offense count: 757 # Cop supports --auto-correct. -# Configuration parameters: Include. +# Configuration parameters: EnforcedStyle, Include. +# SupportedStyles: assert_not, refute # Include: **/test/**/* Rails/RefuteMethods: Enabled: false -# Offense count: 111 -# Configuration parameters: Blacklist, Whitelist. -# Blacklist: decrement!, decrement_counter, increment!, increment_counter, toggle!, touch, update_all, update_attribute, update_column, update_columns, update_counters +# Offense count: 89 +# Configuration parameters: ForbiddenMethods, AllowedMethods. +# ForbiddenMethods: decrement!, decrement_counter, increment!, increment_counter, insert, insert!, insert_all, insert_all!, toggle!, touch, touch_all, update_all, update_attribute, update_column, update_columns, update_counters, upsert, upsert_all Rails/SkipsModelValidations: Enabled: false -# Offense count: 68 +# Offense count: 78 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: strict, flexible @@ -306,33 +513,43 @@ Rails/TimeZone: # Configuration parameters: EnforcedStyle, AutoCorrect. # SupportedStyles: conservative, aggressive Rails/UniqBeforePluck: - Enabled: false + Exclude: + - 'test/controllers/api/v2/api_controller_test.rb' # Offense count: 1 Security/Open: - Enabled: false + Exclude: + - 'lib/katello/tasks/clean_old_file_repos.rake' # Offense count: 9 -# Configuration parameters: EnforcedStyle. +# Configuration parameters: EnforcedStyle, AllowModifiersOnSymbols. # SupportedStyles: inline, group Style/AccessModifierDeclarations: - Enabled: false + Exclude: + - 'app/controllers/katello/api/v2/content_view_components_controller.rb' + - 'app/services/katello/product_content_importer.rb' -# Offense count: 10 +# Offense count: 1 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: prefer_alias, prefer_alias_method Style/Alias: - Enabled: false + Exclude: + - 'app/models/katello/content_view_environment.rb' -# Offense count: 254 +# Offense count: 294 # Cop supports --auto-correct. -# Configuration parameters: AutoCorrect, EnforcedStyle. +# Configuration parameters: EnforcedStyle. # SupportedStyles: nested, compact Style/ClassAndModuleChildren: Enabled: false -# Offense count: 50 +# Offense count: 1 +Style/CombinableLoops: + Exclude: + - 'test/services/katello/pulp3/api/client_api_test.rb' + +# Offense count: 67 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SingleLineConditionsOnly, IncludeTernaryExpressions. # SupportedStyles: assign_to_condition, assign_inside_condition @@ -342,121 +559,177 @@ Style/ConditionalAssignment: # Offense count: 2 # Cop supports --auto-correct. Style/EmptyCaseCondition: - Enabled: false - -# Offense count: 11 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle. -# SupportedStyles: compact, expanded -Style/EmptyMethod: - Enabled: false + Exclude: + - 'app/lib/katello/resources/discovery/container.rb' + - 'app/models/katello/content_view_version.rb' -# Offense count: 8 +# Offense count: 5 # Cop supports --auto-correct. Style/ExpandPathArguments: - Enabled: false + Exclude: + - 'bin/rails' + - 'lib/katello/permissions.rb' + - 'lib/katello/repository_types.rb' -# Offense count: 304 -# Configuration parameters: EnforcedStyle. +# Offense count: 396 +# Configuration parameters: EnforcedStyle, MaxUnannotatedPlaceholdersAllowed, IgnoredMethods. # SupportedStyles: annotated, template, unannotated Style/FormatStringToken: Enabled: false +# Offense count: 12 +# Cop supports --auto-correct. +# Configuration parameters: AllowedReceivers. Style/HashEachMethods: - Enabled: false + Exclude: + - 'app/lib/actions/katello/repository/multi_clone_contents.rb' + - 'app/lib/katello/event_daemon/monitor.rb' + - 'app/lib/katello/http_resource.rb' + - 'app/models/katello/concerns/smart_proxy_extensions.rb' + - 'app/models/katello/content_view_version.rb' + - 'app/models/katello/glue/pulp/repos.rb' + - 'app/services/katello/repository_type_manager.rb' + - 'lib/katello/tasks/upgrades/4.1/reupdate_content_import_export_perms.rake' + - 'test/katello_test_helper.rb' + - 'test/models/file_unit_test.rb' + - 'test/services/katello/pulp3/repository_integration_test.rb' +# Offense count: 1 +# Cop supports --auto-correct. Style/HashTransformKeys: - Enabled: false - -Style/HashTransformValues: - Enabled: false + Exclude: + - 'app/models/katello/content_view_version.rb' # Offense count: 11 +# Cop supports --auto-correct. Style/IdenticalConditionalBranches: - Enabled: false + Exclude: + - 'app/controllers/katello/api/registry/registry_proxies_controller.rb' + - 'app/lib/actions/katello/repository/finish_upload.rb' + - 'app/models/katello/kt_environment.rb' + - 'app/services/katello/pulp3/repository.rb' + - 'lib/katello/url_constrained_cookie_store.rb' -# Offense count: 16 +# Offense count: 19 +# Cop supports --auto-correct. # Configuration parameters: AllowIfModifier. Style/IfInsideElse: Enabled: false -# Offense count: 16 +# Offense count: 25 # Cop supports --auto-correct. # Configuration parameters: InverseMethods, InverseBlocks. Style/InverseMethods: Enabled: false -# Offense count: 2 -Lint/MissingSuper: - Enabled: false - -# Offense count: 2 +# Offense count: 1 Style/MissingRespondToMissing: - Enabled: false + Exclude: + - 'app/presenters/katello/content_view_version_compare_presenter.rb' -# Offense count: 2 +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: AllowMethodComparison. Style/MultipleComparison: - Enabled: false + Exclude: + - 'test/controllers/api/v2/content_views_controller_test.rb' -# Offense count: 5 +# Offense count: 3 # Cop supports --auto-correct. # Configuration parameters: EnforcedOctalStyle. # SupportedOctalStyles: zero_with_o, zero_only Style/NumericLiteralPrefix: - Enabled: false + Exclude: + - 'app/controllers/katello/api/registry/registry_proxies_controller.rb' + - 'app/controllers/katello/api/v2/subscriptions_controller.rb' -# Offense count: 85 +# Offense count: 93 # Cop supports --auto-correct. -# Configuration parameters: AutoCorrect, EnforcedStyle, IgnoredMethods. +# Configuration parameters: EnforcedStyle, IgnoredMethods. # SupportedStyles: predicate, comparison Style/NumericPredicate: Enabled: false -# Offense count: 10 +# Offense count: 15 # Cop supports --auto-correct. Style/ParallelAssignment: - Enabled: false - -# Offense count: 131 + Exclude: + - 'app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb' + - 'app/lib/katello/errors.rb' + - 'app/lib/katello/lazy_accessor.rb' + - 'app/lib/katello/resources/discovery/yum.rb' + - 'app/lib/katello/util/path_with_substitutions.rb' + - 'app/models/katello/rpm.rb' + - 'app/models/katello/sync_plan.rb' + - 'app/services/katello/pulp3/repository.rb' + - 'test/models/erratum_test.rb' + - 'test/models/file_unit_test.rb' + - 'test/services/katello/pulp3/erratum_test.rb' + +# Offense count: 83 # Cop supports --auto-correct. # Configuration parameters: PreferredDelimiters. Style/PercentLiteralDelimiters: Enabled: false -# Offense count: 35 +# Offense count: 41 # Cop supports --auto-correct. Style/RedundantInterpolation: Enabled: false -# Offense count: 11 +# Offense count: 12 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, AllowInnerSlashes. # SupportedStyles: slashes, percent_r, mixed Style/RegexpLiteral: - Enabled: false - -# Offense count: 11 + Exclude: + - 'app/helpers/katello/katello_urls_helper.rb' + - 'app/lib/katello/util/path_with_substitutions.rb' + - 'app/lib/katello/validators/alternate_content_source_path_validator.rb' + - 'app/lib/katello/validators/container_image_name_validator.rb' + - 'app/lib/katello/validators/gpg_key_content_validator.rb' + - 'app/models/katello/repository.rb' + - 'app/services/katello/pulp3/repository.rb' + - 'config/routes.rb' + - 'test/controllers/api/v2/content_export_incrementals_controller_test.rb' + - 'test/models/activation_key_test.rb' + - 'test/support/actions/fixtures.rb' + +# Offense count: 19 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: single_quotes, double_quotes Style/StringLiteralsInInterpolation: - Enabled: false + Exclude: + - 'app/controllers/katello/api/v2/activation_keys_controller.rb' + - 'app/controllers/katello/api/v2/generic_content_units_controller.rb' + - 'app/lib/actions/pulp3/repository/multi_copy_units.rb' + - 'app/lib/katello/resources/cdn/katello_cdn.rb' + - 'app/lib/katello/util/package.rb' + - 'app/lib/katello/util/report_table.rb' + - 'app/models/katello/content_view.rb' + - 'db/migrate/20160701180402_add_sortable_version_to_puppet_modules.rb' + - 'engines/bastion/lib/bastion/engine.rb' + - 'lib/katello/plugin.rb' + - 'test/lib/util/cdn_var_subsitutor_test.rb' + - 'test/models/content_view_test.rb' -# Offense count: 353 +# Offense count: 11 # Cop supports --auto-correct. -# Configuration parameters: MinSize. -# SupportedStyles: percent, brackets -Style/SymbolArray: - EnforcedStyle: brackets +# Configuration parameters: EnforcedStyleForMultiline. +# SupportedStylesForMultiline: comma, consistent_comma, no_comma +Style/TrailingCommaInArrayLiteral: + Exclude: + - 'lib/katello/tasks/test.rake' -# Offense count: 16 +# Offense count: 30 # Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, AllowSafeAssignment. -# SupportedStyles: require_parentheses, require_no_parentheses, require_parentheses_when_complex -Style/TernaryParentheses: +Style/ZeroLengthPredicate: Enabled: false -# Offense count: 24 +# Offense count: 3186 # Cop supports --auto-correct. -Style/ZeroLengthPredicate: - Enabled: false +# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. +# URISchemes: http, https +Layout/LineLength: + Max: 273 diff --git a/app/controllers/katello/api/registry/registry_proxies_controller.rb b/app/controllers/katello/api/registry/registry_proxies_controller.rb index 334672f47ae..f224f725e49 100644 --- a/app/controllers/katello/api/registry/registry_proxies_controller.rb +++ b/app/controllers/katello/api/registry/registry_proxies_controller.rb @@ -118,7 +118,7 @@ def parse_blob_push_props(path_string = nil) schema: "label", organization: segments[2], product: segments[3], - name: segments[4] + name: segments[4], } elsif segments.length >= 8 && segments[0] == "" && segments[1] == "v2" && segments[2] == "id" && (segments[6] == "blobs" || segments[6] == "manifests") @@ -128,7 +128,7 @@ def parse_blob_push_props(path_string = nil) schema: "id", organization: segments[3], product: segments[4], - name: segments[5] + name: segments[5], } else return {valid_format: false} @@ -505,7 +505,7 @@ def token # We're keeping the 'expires_at' field for now to maintain compatibility with existing # smart-proxies during 4.11 upgrades. This is not a part of OAuth2 spec. # TODO - Remove 'expires_at' in Katello 4.13 or later. - expires_at: expiry_time.rfc3339 + expires_at: expiry_time.rfc3339, } end @@ -639,7 +639,7 @@ def v1_search authenticate # to set current_user, not to enforce options = { - resource_class: Katello::Repository + resource_class: Katello::Repository, } params[:per_page] = params[:n] || 25 params[:search] = params[:q] @@ -649,7 +649,7 @@ def v1_search results = { num_results: search_results[:subtotal], - query: params[:search] + query: params[:search], } results[:results] = search_results[:results].collect do |repository| { name: repository[:container_repository_name], description: repository[:description] } @@ -672,7 +672,7 @@ def tags_list tags.sort! render json: { name: @repository.container_repository_name, - tags: tags + tags: tags, } end diff --git a/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb b/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb index e8350f45785..e25dc95d7e3 100644 --- a/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +++ b/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb @@ -115,7 +115,7 @@ def rhsm_index :id => env.cp_id, :name => env.label, :display_name => env.name, - :description => env.content_view.description + :description => env.content_view.description, } end diff --git a/app/controllers/katello/api/v2/activation_keys_controller.rb b/app/controllers/katello/api/v2/activation_keys_controller.rb index 76e42b4968c..9acaed3afea 100644 --- a/app/controllers/katello/api/v2/activation_keys_controller.rb +++ b/app/controllers/katello/api/v2/activation_keys_controller.rb @@ -157,7 +157,7 @@ def available_releases response = { :results => @activation_key.available_releases, :total => @activation_key.available_releases.size, - :subtotal => @activation_key.available_releases.size + :subtotal => @activation_key.available_releases.size, } respond_for_index :collection => response end @@ -276,14 +276,13 @@ def index_relation def subscription_index subs = @activation_key.subscriptions - subscriptions = { + { :results => subs, :subtotal => subs.count, :total => subs.count, :page => 1, - :per_page => subs.count + :per_page => subs.count, } - subscriptions end def find_cve_for_single diff --git a/app/controllers/katello/api/v2/api_controller.rb b/app/controllers/katello/api/v2/api_controller.rb index d6317f37319..1b1c23205d7 100644 --- a/app/controllers/katello/api/v2/api_controller.rb +++ b/app/controllers/katello/api/v2/api_controller.rb @@ -170,7 +170,7 @@ def scoped_search_results(query:, subtotal: 0, total: 0, page: 0, per_page: 0, e :selectable => selectable.blank? ? total : selectable, :page => page, :per_page => per_page, - :error => error + :error => error, } end diff --git a/app/controllers/katello/api/v2/capsule_content_controller.rb b/app/controllers/katello/api/v2/capsule_content_controller.rb index c6de230b9be..cd502b401d9 100644 --- a/app/controllers/katello/api/v2/capsule_content_controller.rb +++ b/app/controllers/katello/api/v2/capsule_content_controller.rb @@ -70,7 +70,7 @@ def sync :environment_id => @environment.try(:id), :content_view_id => @content_view.try(:id), :repository_id => @repository.try(:id), - :skip_metadata_check => skip_metadata_check + :skip_metadata_check => skip_metadata_check, } sync_options[:environment_ids] = @capsule.lifecycle_environments&.pluck(:id) unless (@environment || @content_view || @repository) task = async_task(::Actions::Katello::CapsuleContent::Sync, @@ -91,7 +91,7 @@ def update_counts count_options = { :environment_id => @environment.try(:id), :content_view_id => @content_view.try(:id), - :repository_id => @repository.try(:id) + :repository_id => @repository.try(:id), } task = async_task(::Actions::Katello::CapsuleContent::UpdateContentCounts, @capsule, count_options) respond_for_async :resource => task @@ -137,7 +137,7 @@ def verify_checksum repair_options = { :environment_id => @environment.try(:id), :content_view_id => @content_view.try(:id), - :repository_id => @repository.try(:id) + :repository_id => @repository.try(:id), } repair_options[:environment_ids] = @capsule.lifecycle_environments&.pluck(:id) unless (@environment || @content_view || @repository) @@ -153,7 +153,7 @@ def respond_for_lifecycle_environments_index(environments) collection = { :results => environments, :total => environments.size, - :subtotal => environments.size + :subtotal => environments.size, } respond_for_index(:collection => collection, :template => :lifecycle_environments) end diff --git a/app/controllers/katello/api/v2/content_view_components_controller.rb b/app/controllers/katello/api/v2/content_view_components_controller.rb index c6e724d9000..4fc835c4ea8 100644 --- a/app/controllers/katello/api/v2/content_view_components_controller.rb +++ b/app/controllers/katello/api/v2/content_view_components_controller.rb @@ -25,7 +25,7 @@ def index_response { :results => results.uniq, :subtotal => results.count, - :total => results.count + :total => results.count, } end diff --git a/app/controllers/katello/api/v2/content_view_versions_controller.rb b/app/controllers/katello/api/v2/content_view_versions_controller.rb index 02d17246023..f7917c47528 100644 --- a/app/controllers/katello/api/v2/content_view_versions_controller.rb +++ b/app/controllers/katello/api/v2/content_view_versions_controller.rb @@ -28,7 +28,7 @@ class Api::V2::ContentViewVersionsController < Api::V2::ApiController add_scoped_search_description_for(ContentViewVersion) def index options = { - :includes => [:content_view, :environments, :composite_content_views, :history => :task] + :includes => [:content_view, :environments, :composite_content_views, :history => :task], } respond(:collection => scoped_search(index_relation.distinct, :version, :desc, options)) end @@ -200,7 +200,7 @@ def find_version_environments list.each do |combination| version_environment = { :content_view_version => ContentViewVersion.find(combination[:content_view_version_id]), - :environments => KTEnvironment.where(:id => combination[:environment_ids]) + :environments => KTEnvironment.where(:id => combination[:environment_ids]), } view = version_environment[:content_view_version].content_view @@ -230,7 +230,7 @@ def lookup_all_composites(component) component.composites.select { |c| c.environments.any? }.map do |composite| { :content_view_version => composite, - :environments => composite.environments + :environments => composite.environments, } end end diff --git a/app/controllers/katello/api/v2/content_views_controller.rb b/app/controllers/katello/api/v2/content_views_controller.rb index bb6240a2e30..a182c1eaa48 100644 --- a/app/controllers/katello/api/v2/content_views_controller.rb +++ b/app/controllers/katello/api/v2/content_views_controller.rb @@ -41,7 +41,7 @@ class Api::V2::ContentViewsController < Api::V2::ApiController def filtered_associations { :component_ids => Katello::ContentViewVersion, - :repository_ids => Katello::Repository + :repository_ids => Katello::Repository, } end diff --git a/app/controllers/katello/api/v2/environments_controller.rb b/app/controllers/katello/api/v2/environments_controller.rb index 683f690c9a6..764a4aa5810 100644 --- a/app/controllers/katello/api/v2/environments_controller.rb +++ b/app/controllers/katello/api/v2/environments_controller.rb @@ -154,7 +154,7 @@ def paths collection = { :results => paths, :total => paths.size, - :subtotal => paths.size + :subtotal => paths.size, } respond_for_index(:collection => collection, :template => :paths) end diff --git a/app/controllers/katello/api/v2/exports_controller.rb b/app/controllers/katello/api/v2/exports_controller.rb index 9fce3e4440a..55f6b50c776 100644 --- a/app/controllers/katello/api/v2/exports_controller.rb +++ b/app/controllers/katello/api/v2/exports_controller.rb @@ -21,7 +21,7 @@ class Api::V2::ExportsController < Api::V2::ApiController syncable_repos: ::Katello::Repository.exportable_types( format: ::Katello::Pulp3::ContentViewVersion::Export::SYNCABLE).join(", "), importable_repos: ::Katello::Repository.exportable_types( - format: ::Katello::Pulp3::ContentViewVersion::Export::IMPORTABLE).join(", ") + format: ::Katello::Pulp3::ContentViewVersion::Export::IMPORTABLE).join(", "), }), :required => false end diff --git a/app/controllers/katello/api/v2/host_collections_controller.rb b/app/controllers/katello/api/v2/host_collections_controller.rb index e7762e665c0..66d24514c54 100644 --- a/app/controllers/katello/api/v2/host_collections_controller.rb +++ b/app/controllers/katello/api/v2/host_collections_controller.rb @@ -8,7 +8,7 @@ class Api::V2::HostCollectionsController < Api::V2::ApiController :destroy, :add_hosts, :remove_hosts, - :hosts + :hosts, ] before_action :find_readable_activation_key, :only => [:index] before_action :find_editable_host, :only => [:index] @@ -187,7 +187,7 @@ def host_collection_params :description, :max_hosts, :unlimited_hosts, - { :host_ids => [] } + { :host_ids => [] }, ] params.fetch(:host_collection).permit(*attrs) end diff --git a/app/controllers/katello/api/v2/host_errata_controller.rb b/app/controllers/katello/api/v2/host_errata_controller.rb index efe1ce5c25e..a6149f30a4f 100644 --- a/app/controllers/katello/api/v2/host_errata_controller.rb +++ b/app/controllers/katello/api/v2/host_errata_controller.rb @@ -6,7 +6,7 @@ class Api::V2::HostErrataController < Api::V2::ApiController TYPES_FROM_PARAMS = { bugfix: Katello::Erratum::BUGZILLA, # ['bugfix', 'recommended'] security: Katello::Erratum::SECURITY, # ['security'] - enhancement: Katello::Erratum::ENHANCEMENT # ['enhancement', 'optional'] + enhancement: Katello::Erratum::ENHANCEMENT, # ['enhancement', 'optional'] }.freeze before_action :find_host, only: :index diff --git a/app/controllers/katello/api/v2/host_subscriptions_controller.rb b/app/controllers/katello/api/v2/host_subscriptions_controller.rb index a80f4cc83e5..9b8244bb39e 100644 --- a/app/controllers/katello/api/v2/host_subscriptions_controller.rb +++ b/app/controllers/katello/api/v2/host_subscriptions_controller.rb @@ -260,7 +260,7 @@ def find_content_overrides @content_overrides = content_labels.map do |label| { content_label: label, value: Foreman::Cast.to_bool(params[:content_overrides_search][:enabled]), - remove: Foreman::Cast.to_bool(params[:content_overrides_search][:remove]) + remove: Foreman::Cast.to_bool(params[:content_overrides_search][:remove]), } end else diff --git a/app/controllers/katello/api/v2/organizations_controller.rb b/app/controllers/katello/api/v2/organizations_controller.rb index 72db519e884..8d1f0dade8d 100644 --- a/app/controllers/katello/api/v2/organizations_controller.rb +++ b/app/controllers/katello/api/v2/organizations_controller.rb @@ -134,7 +134,7 @@ def releases response = { :results => available_releases, :total => available_releases.size, - :subtotal => available_releases.size + :subtotal => available_releases.size, } respond_for_index :collection => response end diff --git a/app/controllers/katello/api/v2/repositories_controller.rb b/app/controllers/katello/api/v2/repositories_controller.rb index 34344377c68..ad1cc6da3e8 100644 --- a/app/controllers/katello/api/v2/repositories_controller.rb +++ b/app/controllers/katello/api/v2/repositories_controller.rb @@ -350,7 +350,7 @@ def sync sync_options = { :skip_metadata_check => ::Foreman::Cast.to_bool(params[:skip_metadata_check]), :validate_contents => ::Foreman::Cast.to_bool(params[:validate_contents]), - :incremental => ::Foreman::Cast.to_bool(params[:incremental]) + :incremental => ::Foreman::Cast.to_bool(params[:incremental]), } if @repository.url.blank? @@ -515,7 +515,7 @@ def import_uploads upload_args = { content_type: params[:content_type], generate_metadata: generate_metadata, - sync_capsule: sync_capsule + sync_capsule: sync_capsule, } upload_args.merge!(generic_content_type_import_upload_args) diff --git a/app/controllers/katello/api/v2/repository_sets_controller.rb b/app/controllers/katello/api/v2/repository_sets_controller.rb index 7c2640f4f8e..dc7f0b09fef 100644 --- a/app/controllers/katello/api/v2/repository_sets_controller.rb +++ b/app/controllers/katello/api/v2/repository_sets_controller.rb @@ -85,7 +85,7 @@ def available_repositories collection = { :results => sorted_repos.reverse, :subtotal => repos.size, - :total => repos.size + :total => repos.size, } respond_for_index :collection => collection diff --git a/app/controllers/katello/concerns/api/v2/multi_cv_params_handling.rb b/app/controllers/katello/concerns/api/v2/multi_cv_params_handling.rb index 0ea16d2bcf5..1d0f536a003 100644 --- a/app/controllers/katello/concerns/api/v2/multi_cv_params_handling.rb +++ b/app/controllers/katello/concerns/api/v2/multi_cv_params_handling.rb @@ -10,12 +10,12 @@ def handle_errors(labels: [], ids: []) elsif ids.present? fail HttpErrors::UnprocessableEntity, "No content view environments found with ids: #{ids}" end - rescue HttpErrors::UnprocessableEntity => error + rescue HttpErrors::UnprocessableEntity => e respond_for_exception( - error, + e, :status => :unprocessable_entity, - :text => error.message, - :errors => [error.message], + :text => e.message, + :errors => [e.message], :with_logging => true ) end diff --git a/app/controllers/katello/concerns/hosts_controller_extensions.rb b/app/controllers/katello/concerns/hosts_controller_extensions.rb index 37042b02f09..bc17b34ae47 100644 --- a/app/controllers/katello/concerns/hosts_controller_extensions.rb +++ b/app/controllers/katello/concerns/hosts_controller_extensions.rb @@ -101,7 +101,7 @@ def change_content_source_data content_hosts: content_hosts, hosts_without_content: hosts_without_content, content_sources: content_sources, - job_invocation_path: job_invocation_path + job_invocation_path: job_invocation_path, } end end diff --git a/app/helpers/katello/concerns/smart_proxy_helper_extensions.rb b/app/helpers/katello/concerns/smart_proxy_helper_extensions.rb index 979ab3b3ae4..20d314b48ba 100644 --- a/app/helpers/katello/concerns/smart_proxy_helper_extensions.rb +++ b/app/helpers/katello/concerns/smart_proxy_helper_extensions.rb @@ -29,20 +29,20 @@ def download_policies policies = [ { :name => _("On Demand"), - :label => ::Katello::RootRepository::DOWNLOAD_ON_DEMAND + :label => ::Katello::RootRepository::DOWNLOAD_ON_DEMAND, }, { :name => _("Immediate"), - :label => ::Katello::RootRepository::DOWNLOAD_IMMEDIATE + :label => ::Katello::RootRepository::DOWNLOAD_IMMEDIATE, }, { :name => _("Streamed"), - :label => SmartProxy::DOWNLOAD_STREAMED + :label => SmartProxy::DOWNLOAD_STREAMED, }, { :name => _("Inherit from Repository"), - :label => SmartProxy::DOWNLOAD_INHERIT - } + :label => SmartProxy::DOWNLOAD_INHERIT, + }, ] policies.map { |p| OpenStruct.new(p) } diff --git a/app/helpers/katello/hosts_and_hostgroups_helper.rb b/app/helpers/katello/hosts_and_hostgroups_helper.rb index a3f84bcaf92..2d7add46454 100644 --- a/app/helpers/katello/hosts_and_hostgroups_helper.rb +++ b/app/helpers/katello/hosts_and_hostgroups_helper.rb @@ -315,7 +315,7 @@ def content_host_overview_button(host) "/content_hosts/#{host.id}", :title => _("Host content and subscription details"), :class => 'btn btn-default'), - :priority => 900 + :priority => 900, }] end @@ -331,7 +331,7 @@ def host_status_icon(status) icons = { green: "#{colour} host-status pficon pficon-ok status-ok", yellow: "#{colour} host-status pficon pficon-info status-warn", - red: "#{colour} host-status pficon pficon-error-circle-o status-error" + red: "#{colour} host-status pficon pficon-error-circle-o status-error", } "".html_safe diff --git a/app/lib/actions/katello/content_view/incremental_updates.rb b/app/lib/actions/katello/content_view/incremental_updates.rb index 92c642e865b..ef5c814a035 100644 --- a/app/lib/actions/katello/content_view/incremental_updates.rb +++ b/app/lib/actions/katello/content_view/incremental_updates.rb @@ -83,7 +83,7 @@ def run output[:changed_content] = input[:version_outputs].map do |version_output| { :content_view_version => {:id => version_output[:version_id]}, - :added_units => version_output[:output][:added_units] + :added_units => version_output[:output][:added_units], } end end diff --git a/app/lib/actions/katello/content_view/presenters/incremental_updates_presenter.rb b/app/lib/actions/katello/content_view/presenters/incremental_updates_presenter.rb index 2176a581ce2..b2aa7d6c603 100644 --- a/app/lib/actions/katello/content_view/presenters/incremental_updates_presenter.rb +++ b/app/lib/actions/katello/content_view/presenters/incremental_updates_presenter.rb @@ -6,7 +6,7 @@ class IncrementalUpdatesPresenter < Helpers::Presenter::Base HUMANIZED_TYPES = { ::Katello::Erratum::CONTENT_TYPE => "Errata", ::Katello::ModuleStream::CONTENT_TYPE => "Module Streams", - ::Katello::Rpm::CONTENT_TYPE => "Packages" + ::Katello::Rpm::CONTENT_TYPE => "Packages", }.freeze def humanized_output diff --git a/app/lib/actions/katello/content_view_version/import.rb b/app/lib/actions/katello/content_view_version/import.rb index a7c2cc4e719..2b1f7612b77 100644 --- a/app/lib/actions/katello/content_view_version/import.rb +++ b/app/lib/actions/katello/content_view_version/import.rb @@ -40,7 +40,7 @@ def plan(opts = {}) importing: !metadata_map.syncable_format?, syncable: metadata_map.syncable_format?, major: metadata_map.content_view_version.major, - minor: metadata_map.content_view_version.minor + minor: metadata_map.content_view_version.minor, }) plan_self(content_view_id: import.content_view.id) end diff --git a/app/lib/actions/katello/content_view_version/incremental_update.rb b/app/lib/actions/katello/content_view_version/incremental_update.rb index a02c7e7fc56..878c19426dc 100644 --- a/app/lib/actions/katello/content_view_version/incremental_update.rb +++ b/app/lib/actions/katello/content_view_version/incremental_update.rb @@ -8,7 +8,7 @@ class IncrementalUpdate < Actions::EntryAction HUMANIZED_TYPES = { ::Katello::Erratum::CONTENT_TYPE => "Errata", ::Katello::Rpm::CONTENT_TYPE => "Packages", - ::Katello::Deb::CONTENT_TYPE => "Deb Packages" + ::Katello::Deb::CONTENT_TYPE => "Deb Packages", }.freeze def humanized_name @@ -217,7 +217,7 @@ def run content = { ::Katello::Erratum::CONTENT_TYPE => [], ::Katello::Rpm::CONTENT_TYPE => [], ::Katello::ModuleStream::CONTENT_TYPE => [], - ::Katello::Deb::CONTENT_TYPE => [] + ::Katello::Deb::CONTENT_TYPE => [], } base_repos = ::Katello::ContentViewVersion.find(input[:old_version]).repositories diff --git a/app/lib/actions/katello/flatpak/scan_remote.rb b/app/lib/actions/katello/flatpak/scan_remote.rb index 8222d925f95..b9d6db001b3 100644 --- a/app/lib/actions/katello/flatpak/scan_remote.rb +++ b/app/lib/actions/katello/flatpak/scan_remote.rb @@ -15,7 +15,7 @@ def run request_params = { method: :get, headers: { accept: :json }, - url: url + url: url, } results = RestClient::Request.execute(request_params) results = JSON.parse(results) @@ -51,11 +51,10 @@ def format_url(url) end params = [ ['tag', 'latest'], - ['label:org.flatpak.ref:exists', '1'] + ['label:org.flatpak.ref:exists', '1'], ] encoded_params = params.map { |k, v| "#{CGI.escape(k.to_s)}=#{CGI.escape(v.to_s)}" } - url = "#{url}#{encoded_params.sort.join('&')}" - url + "#{url}#{encoded_params.sort.join('&')}" end end end diff --git a/app/lib/actions/katello/host/hypervisors.rb b/app/lib/actions/katello/host/hypervisors.rb index f61e2d7a98d..11031634716 100644 --- a/app/lib/actions/katello/host/hypervisors.rb +++ b/app/lib/actions/katello/host/hypervisors.rb @@ -29,7 +29,7 @@ def self.parse_hypervisors(hypervisor_results) { :name => hypervisor['name'], :uuid => hypervisor['uuid'], - :organization_label => hypervisor['owner']['key'] + :organization_label => hypervisor['owner']['key'], } end end diff --git a/app/lib/actions/katello/repository/discover.rb b/app/lib/actions/katello/repository/discover.rb index 866230c8a3b..be78d647fd5 100644 --- a/app/lib/actions/katello/repository/discover.rb +++ b/app/lib/actions/katello/repository/discover.rb @@ -39,7 +39,7 @@ def run(event = nil) { upstream_username: input[:upstream_username], upstream_password: password, - search: input[:search] + search: input[:search], } ) diff --git a/app/lib/actions/katello/repository/import_upload.rb b/app/lib/actions/katello/repository/import_upload.rb index 253e048d0c8..cce4a7514cc 100644 --- a/app/lib/actions/katello/repository/import_upload.rb +++ b/app/lib/actions/katello/repository/import_upload.rb @@ -32,7 +32,7 @@ def plan(repository, uploads, options = {}) unit_type_id: unit_type_id, unit_key: unit_key.with_indifferent_access, upload_id: upload_id, - unit_metadata: unit_metadata + unit_metadata: unit_metadata, } import_upload_args.merge!(options) diff --git a/app/lib/actions/katello/repository/upload_files.rb b/app/lib/actions/katello/repository/upload_files.rb index 0f988d742ed..839e206db8d 100644 --- a/app/lib/actions/katello/repository/upload_files.rb +++ b/app/lib/actions/katello/repository/upload_files.rb @@ -87,7 +87,7 @@ def unit_key(file, repository) { :checksum => Digest::SHA256.hexdigest(File.read(file[:path])), :name => file[:filename], - :size => File.size(file[:path]) + :size => File.size(file[:path]), } end end diff --git a/app/lib/actions/katello/repository_set/enable_repository.rb b/app/lib/actions/katello/repository_set/enable_repository.rb index c631699d23a..334c00e8c60 100644 --- a/app/lib/actions/katello/repository_set/enable_repository.rb +++ b/app/lib/actions/katello/repository_set/enable_repository.rb @@ -30,7 +30,7 @@ def run output[:repository] = { :name => repo.name, :id => repo.id, - :content_type => repo.content_type + :content_type => repo.content_type, } end end diff --git a/app/lib/actions/katello/repository_set/scan_cdn.rb b/app/lib/actions/katello/repository_set/scan_cdn.rb index e3cc13dab2a..f75b65076e2 100644 --- a/app/lib/actions/katello/repository_set/scan_cdn.rb +++ b/app/lib/actions/katello/repository_set/scan_cdn.rb @@ -50,7 +50,7 @@ def prepare_result(substitutions, _path) name: mapper.content.name, enabled: !repo.nil?, promoted: (!repo.nil? && repo.promoted?), - repository_id: repo.try(:id) + repository_id: repo.try(:id), } end diff --git a/app/lib/actions/katello/upstream_subscriptions/bind_entitlement.rb b/app/lib/actions/katello/upstream_subscriptions/bind_entitlement.rb index 12e87e806ec..ca574802ba6 100644 --- a/app/lib/actions/katello/upstream_subscriptions/bind_entitlement.rb +++ b/app/lib/actions/katello/upstream_subscriptions/bind_entitlement.rb @@ -20,7 +20,7 @@ def rescue_strategy def pool { pool: input[:pool], - quantity: input[:quantity] + quantity: input[:quantity], } end end diff --git a/app/lib/actions/pulp3/orchestration/content_view_version/export_library.rb b/app/lib/actions/pulp3/orchestration/content_view_version/export_library.rb index b04675c67a0..065a8a4f4f1 100644 --- a/app/lib/actions/pulp3/orchestration/content_view_version/export_library.rb +++ b/app/lib/actions/pulp3/orchestration/content_view_version/export_library.rb @@ -9,7 +9,7 @@ def plan(organization, opts = {}) chunk_size: nil, from_history: nil, fail_on_missing_content: false, - format: ::Katello::Pulp3::ContentViewVersion::Export::IMPORTABLE + format: ::Katello::Pulp3::ContentViewVersion::Export::IMPORTABLE, }.merge(opts) action_subject(organization) validate_repositories_immediate!(organization) if options[:fail_on_missing_content] diff --git a/app/lib/actions/pulp3/repository/refresh_distribution.rb b/app/lib/actions/pulp3/repository/refresh_distribution.rb index 8ea433004d7..79fb6cda174 100644 --- a/app/lib/actions/pulp3/repository/refresh_distribution.rb +++ b/app/lib/actions/pulp3/repository/refresh_distribution.rb @@ -13,7 +13,7 @@ def plan(repository, smart_proxy, options = {}) refresh_options = { :repository_id => repository.id, - :smart_proxy_id => smart_proxy.id + :smart_proxy_id => smart_proxy.id, } action = plan_self(refresh_options) diff --git a/app/lib/katello/concerns/base_template_scope_extensions.rb b/app/lib/katello/concerns/base_template_scope_extensions.rb index f2db4ae6e06..d7be33bb9a9 100644 --- a/app/lib/katello/concerns/base_template_scope_extensions.rb +++ b/app/lib/katello/concerns/base_template_scope_extensions.rb @@ -308,7 +308,7 @@ def load_errata_applications(filter_errata_type: nil, include_last_reboot: 'yes' :erratum_id => erratum_id, :erratum_type => current_erratum_errata_type, :issued => current_erratum_issued, - :status => task.result + :status => task.result, } if include_last_reboot == 'yes' diff --git a/app/lib/katello/http_resource.rb b/app/lib/katello/http_resource.rb index dcc9c11ec93..9d84d85ea5c 100644 --- a/app/lib/katello/http_resource.rb +++ b/app/lib/katello/http_resource.rb @@ -40,7 +40,7 @@ def []=(key, value) post: Net::HTTP::Post, put: Net::HTTP::Put, patch: Net::HTTP::Patch, - delete: Net::HTTP::Delete + delete: Net::HTTP::Delete, }.freeze class << self @@ -145,7 +145,7 @@ def rest_client(http_type, method, path) options = { :headers => added_header, :open_timeout => SETTINGS[:katello][:rest_client_timeout], - :timeout => SETTINGS[:katello][:rest_client_timeout] + :timeout => SETTINGS[:katello][:rest_client_timeout], } options[:ssl_ca_file] = self.ssl_ca_file unless self.ssl_ca_file.nil? options[:ssl_client_cert] = self.ssl_client_cert unless self.ssl_client_cert.nil? diff --git a/app/lib/katello/messaging/stomp_connection.rb b/app/lib/katello/messaging/stomp_connection.rb index b271be894b2..ed2c3a4d2f4 100644 --- a/app/lib/katello/messaging/stomp_connection.rb +++ b/app/lib/katello/messaging/stomp_connection.rb @@ -16,8 +16,8 @@ def initialize(settings:) { host: settings[:broker_host], port: settings[:broker_port], - ssl: ssl_params - } + ssl: ssl_params, + }, ], logger: Rails.logger, max_reconnect_attempts: 2, @@ -27,8 +27,8 @@ def initialize(settings:) 'accept-version': '1.2', 'host': settings[:broker_host], 'heart-beat': '30000,30000', - 'client-id': settings[:client_id] - } + 'client-id': settings[:client_id], + }, } @queue_name = settings[:queue_name] diff --git a/app/lib/katello/resources/candlepin/activation_key.rb b/app/lib/katello/resources/candlepin/activation_key.rb index a0a63ae1514..6796e84201e 100644 --- a/app/lib/katello/resources/candlepin/activation_key.rb +++ b/app/lib/katello/resources/candlepin/activation_key.rb @@ -20,7 +20,7 @@ def create(name, owner_key, auto_attach, service_level, release_version, purpose releaseVer: release_version, role: purpose_role, usage: purpose_usage, - addOns: purpose_addons + addOns: purpose_addons, } response = self.post(url, params.to_json, self.default_headers) JSON.parse(response.body).with_indifferent_access diff --git a/app/lib/katello/resources/candlepin/owner.rb b/app/lib/katello/resources/candlepin/owner.rb index a294bd554c1..518bafb0fe7 100644 --- a/app/lib/katello/resources/candlepin/owner.rb +++ b/app/lib/katello/resources/candlepin/owner.rb @@ -18,7 +18,7 @@ def create(key, description, content_access_mode: 'org_environment') :displayName => description, :contentPrefix => "/#{key}/$env", :contentAccessMode => content_access_mode, - :contentAccessModeList => 'org_environment' + :contentAccessModeList => 'org_environment', } owner_json = self.post(path, attrs.to_json, self.default_headers).body JSON.parse(owner_json).with_indifferent_access diff --git a/app/lib/katello/resources/candlepin/product.rb b/app/lib/katello/resources/candlepin/product.rb index 6e6ebf704f6..262e3a2eff2 100644 --- a/app/lib/katello/resources/candlepin/product.rb +++ b/app/lib/katello/resources/candlepin/product.rb @@ -86,7 +86,7 @@ def create_unlimited_subscription(owner_key, product_id, start_date) 'accountNumber' => '', 'productId' => product_id, 'providedProducts' => [], - 'contractNumber' => '' + 'contractNumber' => '', } JSON.parse(Candlepin::Pool.create(owner_key, pool)) end diff --git a/app/lib/katello/resources/cdn.rb b/app/lib/katello/resources/cdn.rb index 9ee86708517..e6944f9b36f 100644 --- a/app/lib/katello/resources/cdn.rb +++ b/app/lib/katello/resources/cdn.rb @@ -51,7 +51,7 @@ def initialize(url, options = {}) @options = options end - def self.create(product: nil, cdn_configuration:) + def self.create(cdn_configuration:, product: nil) options = {} if cdn_configuration.redhat_cdn? options[:ssl_client_cert] = OpenSSL::X509::Certificate.new(product.certificate) diff --git a/app/lib/katello/resources/cdn/katello_cdn.rb b/app/lib/katello/resources/cdn/katello_cdn.rb index 4e9116a5abc..ae61566017c 100644 --- a/app/lib/katello/resources/cdn/katello_cdn.rb +++ b/app/lib/katello/resources/cdn/katello_cdn.rb @@ -27,7 +27,7 @@ def fetch_paths(content_path) organization_id: organization['id'], content_view_id: content_view_id, environment_id: lifecycle_environment_id, - search: CGI.escape("content_label = #{repo_set['label']}") + search: CGI.escape("content_label = #{repo_set['label']}"), } query_params = params.map { |key, value| "#{key}=#{value}" } @@ -78,7 +78,7 @@ def lifecycle_environment_id def repository_url(content_label:, arch:, major:, minor:) params = { - search: CGI.escape("content_label = #{content_label}") + search: CGI.escape("content_label = #{content_label}"), } params[:content_view_id] = content_view_id if @content_view_label @@ -95,7 +95,7 @@ def repository_url(content_label:, arch:, major:, minor:) minor: minor, org_label: @organization_label, cv_label: @content_view_label || Katello::OrganizationCreator::DEFAULT_CONTENT_VIEW_LABEL, - env_label: @lifecycle_environment_label || Katello::OrganizationCreator::DEFAULT_LIFECYCLE_ENV_LABEL + env_label: @lifecycle_environment_label || Katello::OrganizationCreator::DEFAULT_LIFECYCLE_ENV_LABEL, } fail _("Repository with content label: '%{content_label}'#{arch ? ', arch: \'%{arch}\'' : ''}#{minor ? ', version: \'%{minor}\'' : ''} was not found in upstream organization '%{org_label}',"\ diff --git a/app/lib/katello/resources/discovery/container.rb b/app/lib/katello/resources/discovery/container.rb index d4f90775dfa..1d076163b1c 100644 --- a/app/lib/katello/resources/discovery/container.rb +++ b/app/lib/katello/resources/discovery/container.rb @@ -3,11 +3,13 @@ module Resources module Discovery class Container < RepoDiscovery attr_reader :found, :crawled, :to_follow + + # rubocop:disable Metrics/ParameterLists def initialize(url, crawled = [], found = [], to_follow = [], upstream_credentials_and_search = { upstream_username: nil, upstream_password: nil, - search: '*' + search: '*', }) @uri = uri(url) @upstream_username = upstream_credentials_and_search[:upstream_username].presence @@ -94,7 +96,7 @@ def docker_search request_params = { method: :get, headers: { accept: :json }, - url: "#{@uri}v1/search?q=#{@search}" + url: "#{@uri}v1/search?q=#{@search}", } request_params[:user] = @upstream_username if @upstream_username @@ -107,7 +109,7 @@ def docker_search @found << result['name'] end rescue - # Note: v2 endpoint does not support search + # NOTE: v2 endpoint does not support search request_params[:url] = "#{@uri}v2/_catalog" loop do results = RestClient::Request.execute(request_params) diff --git a/app/lib/katello/resources/discovery/yum.rb b/app/lib/katello/resources/discovery/yum.rb index 36b53d8a025..b1c8d32620d 100644 --- a/app/lib/katello/resources/discovery/yum.rb +++ b/app/lib/katello/resources/discovery/yum.rb @@ -5,10 +5,12 @@ module Resources module Discovery class Yum < RepoDiscovery attr_reader :found, :crawled, :to_follow + + # rubocop:disable Metrics/ParameterLists def initialize(url, crawled = [], found = [], to_follow = [], upstream_credentials_and_search = { upstream_username: nil, - upstream_password: nil + upstream_password: nil, }) @uri = uri(url) @upstream_username = upstream_credentials_and_search[:upstream_username].presence diff --git a/app/lib/katello/util/deduplication_migrator.rb b/app/lib/katello/util/deduplication_migrator.rb index ff75975f03f..fff7751e47a 100644 --- a/app/lib/katello/util/deduplication_migrator.rb +++ b/app/lib/katello/util/deduplication_migrator.rb @@ -7,25 +7,25 @@ def models_to_clean [ { :model => ::Katello::CapsuleLifecycleEnvironment, - :fields => [:lifecycle_environment_id, :capsule_id] + :fields => [:lifecycle_environment_id, :capsule_id], }, { :model => ::Katello::ContentViewErratumFilterRule, - :fields => [:errata_id, :content_view_filter_id] + :fields => [:errata_id, :content_view_filter_id], }, { :model => ::Katello::ContentViewModuleStreamFilterRule, - :fields => [:module_stream_id, :content_view_filter_id] + :fields => [:module_stream_id, :content_view_filter_id], }, { :model => ::Katello::ContentViewPackageGroupFilterRule, - :fields => [:uuid, :content_view_filter_id] + :fields => [:uuid, :content_view_filter_id], }, { :model => ::Katello::ContentViewRepository, - :fields => [:content_view_id, :repository_id] - } + :fields => [:content_view_id, :repository_id], + }, ] end @@ -33,8 +33,8 @@ def models_to_rename [ { :model => ::Katello::ContentView, - :fields => [:name, :organization_id] - } + :fields => [:name, :organization_id], + }, ] end diff --git a/app/lib/katello/util/model.rb b/app/lib/katello/util/model.rb index 4d0226c79f9..5b7601a80d6 100644 --- a/app/lib/katello/util/model.rb +++ b/app/lib/katello/util/model.rb @@ -4,7 +4,7 @@ module Model # hardcoded model names (uses kp_ prefix) def self.table_to_model_hash { - "kt_environment" => "KTEnvironment" + "kt_environment" => "KTEnvironment", } end @@ -29,7 +29,7 @@ def self.uuid def self.controller_path_to_model_hash { - "katello/environments" => "Katello::KTEnvironment" + "katello/environments" => "Katello::KTEnvironment", } end diff --git a/app/lib/katello/util/search.rb b/app/lib/katello/util/search.rb index 579e205945f..9c00f79e79d 100644 --- a/app/lib/katello/util/search.rb +++ b/app/lib/katello/util/search.rb @@ -7,13 +7,13 @@ def self.custom_analyzers { "kt_name_analyzer" => { "type" => "custom", - "tokenizer" => "keyword" + "tokenizer" => "keyword", }, "autcomplete_name_analyzer" => { "type" => "custom", "tokenizer" => "keyword", - "filter" => %w(standard lowercase ngram_filter) - } + "filter" => %w(standard lowercase ngram_filter), + }, } end @@ -23,8 +23,8 @@ def self.custom_filters "type" => "edgeNGram", "side" => "front", "min_gram" => 1, - "max_gram" => 30 - } + "max_gram" => 30, + }, } end diff --git a/app/lib/katello/util/task_status.rb b/app/lib/katello/util/task_status.rb index c8e5d9e134c..81530fba1da 100644 --- a/app/lib/katello/util/task_status.rb +++ b/app/lib/katello/util/task_status.rb @@ -17,9 +17,9 @@ module TaskStatus :finished => [N_('Package Install Complete'), N_('Package installation: "%{package}" '), N_('%{package} (%{total} other packages) installed')], :error => [N_('Package Install Failed'), N_('Package install failed: "%{package}"'), N_('%{package} (%{total} other packages) install failed')], :cancelled => [N_('Package Install Canceled'), N_('%{package} package install canceled'), N_('%{package} (%{total} other packages) install canceled')], - :timed_out => [N_('Package Install Timed Out'), N_('%{package} package install timed out'), N_('%{package} (%{total} other packages) install timed out')] + :timed_out => [N_('Package Install Timed Out'), N_('%{package} package install timed out'), N_('%{package} (%{total} other packages) install timed out')], }, - :user_message => _('Package Install scheduled by %s') + :user_message => _('Package Install scheduled by %s'), }, :package_update => { @@ -31,9 +31,9 @@ module TaskStatus :finished => [N_('Package Update Complete'), N_('%{package} package updated'), N_('%{package} (%{total} other packages) updated')], :error => [N_('Package Update Failed'), N_('%{package} package update failed'), N_('%{package} (%{total} other packages) update failed')], :cancelled => [N_('Package Update Canceled'), N_('%{package} package update canceled'), N_('%{package} (%{total} other packages) update canceled')], - :timed_out => [N_('Package Update Timed Out'), N_('%{package} package update timed out'), N_('%{package} (%{total} other packages) update timed out')] + :timed_out => [N_('Package Update Timed Out'), N_('%{package} package update timed out'), N_('%{package} (%{total} other packages) update timed out')], }, - :user_message => _('Package Update scheduled by %s') + :user_message => _('Package Update scheduled by %s'), }, :package_remove => { :english_name => N_("Package Remove"), @@ -44,9 +44,9 @@ module TaskStatus :finished => [N_('Package Remove Complete'), N_('%{package} package removed'), N_('%{package} (%{total} other packages) removed')], :error => [N_('Package Remove Failed'), N_('%{package} package remove failed'), N_('%{package} (%{total} other packages) remove failed')], :cancelled => [N_('Package Remove Canceled'), N_('%{package} package remove canceled'), N_('%{package} (%{total} other packages) remove canceled')], - :timed_out => [N_('Package Remove Timed Out'), N_('%{package} package remove timed out'), N_('%{package} (%{total} other packages) remove timed out')] + :timed_out => [N_('Package Remove Timed Out'), N_('%{package} package remove timed out'), N_('%{package} (%{total} other packages) remove timed out')], }, - :user_message => _('Package Remove scheduled by %s') + :user_message => _('Package Remove scheduled by %s'), }, #package group tasks :package_group_install => { @@ -58,9 +58,9 @@ module TaskStatus :finished => [N_('Package Group Install Complete'), N_('%{group} package group installed'), N_('%{group} (%{total} other package groups) installed')], :error => [N_('Package Group Install Failed'), N_('%{group} package group install failed'), N_('%{group} (%{total} other package groups) install failed')], :cancelled => [N_('Package Group Install Canceled'), N_('%{group} package group install canceled'), N_('%{group} (%{total} other package groups) install canceled')], - :timed_out => [N_('Package Group Install Timed Out'), N_('%{group} package group install timed out'), N_('%{group} (%{total} other package groups) install timed out')] + :timed_out => [N_('Package Group Install Timed Out'), N_('%{group} package group install timed out'), N_('%{group} (%{total} other package groups) install timed out')], }, - :user_message => _('Package Group Install scheduled by %s') + :user_message => _('Package Group Install scheduled by %s'), }, :package_group_update => { :english_name => N_("Package Group Update"), @@ -71,10 +71,10 @@ module TaskStatus :finished => [N_('Package group update complete'), N_('%{group} package group updated'), N_('%{group} (%{total} other package groups) updated')], :error => [N_('Package group update failed'), N_('%{group} package group update failed'), N_('%{group} (%{total} other package groups) update failed')], :cancelled => [N_('Package group update canceled'), N_('%{group} package group update canceled'), N_('%{group} (%{total} other package groups) update canceled')], - :timed_out => [N_('Package group update timed out'), N_('%{group} package group update timed out'), N_('%{group} (%{total} other package groups) update timed out')] + :timed_out => [N_('Package group update timed out'), N_('%{group} package group update timed out'), N_('%{group} (%{total} other package groups) update timed out')], }, - :user_message => _('Package Group Update scheduled by %s') + :user_message => _('Package Group Update scheduled by %s'), }, :package_group_remove => { :english_name => N_("Package Group Remove"), @@ -85,10 +85,10 @@ module TaskStatus :finished => [N_('Package Group Remove Complete'), N_('%{group} package group removed'), N_('%{group} (%{total} other package groups) removed')], :error => [N_('Package Group Remove Failed'), N_('%{group} package group remove failed'), N_('%{group} (%{total} other package groups) remove failed')], :cancelled => [N_('Package Group Remove Canceled'), N_('%{group} package group remove canceled'), N_('%{group} (%{total} other package groups) remove canceled')], - :timed_out => [N_('Package Group Remove Timed Out'), N_('%{group} package group remove timed out'), N_('%{group} (%{total} other package groups) remove timed out')] + :timed_out => [N_('Package Group Remove Timed Out'), N_('%{group} package group remove timed out'), N_('%{group} (%{total} other package groups) remove timed out')], }, - :user_message => _('Package Group Remove scheduled by %s') + :user_message => _('Package Group Remove scheduled by %s'), }, :errata_install => { :english_name => N_("Errata Install"), @@ -99,29 +99,29 @@ module TaskStatus :finished => [N_('Erratum Install Complete'), N_('%{errata} erratum installed'), N_('%{errata} (%{total} other errata) installed')], :error => [N_('Erratum Install Failed'), N_('%{errata} erratum install failed'), N_('%{errata} (%{total} other errata) install failed')], :cancelled => [N_('Erratum Install Canceled'), N_('%{errata} erratum install canceled'), N_('%{errata} (%{total} other errata) install canceled')], - :timed_out => [N_('Erratum Install Timed Out'), N_('%{errata} erratum install timed out'), N_('%{errata} (%{total} other errata) install timed out')] + :timed_out => [N_('Erratum Install Timed Out'), N_('%{errata} erratum install timed out'), N_('%{errata} (%{total} other errata) install timed out')], }, - :user_message => _('Errata Install scheduled by %s') + :user_message => _('Errata Install scheduled by %s'), }, :candlepin_event => { :english_name => N_("Candlepin Event"), :type => :candlepin_event, :event_messages => { }, - :user_message => nil + :user_message => nil, }, :content_view_publish => { :english_name => N_("content view publish"), - :type => :content_view_publish + :type => :content_view_publish, }, :content_view_node_publish => { :english_name => N_("content view node publish"), - :type => :content_view_node_publish + :type => :content_view_node_publish, }, :content_view_refresh => { :english_name => N_("content view refresh"), - :type => :content_view_refresh - } + :type => :content_view_refresh, + }, }.with_indifferent_access TYPES.each_pair do |_name, value| diff --git a/app/models/katello/alternate_content_source.rb b/app/models/katello/alternate_content_source.rb index 57fbdbdca9f..15a2f82b190 100644 --- a/app/models/katello/alternate_content_source.rb +++ b/app/models/katello/alternate_content_source.rb @@ -40,25 +40,25 @@ class AlternateContentSource < Katello::Model # verify ssl must be validated this way due to presence: failing on a value of false validates :verify_ssl, if: -> { custom? || rhui? }, inclusion: { in: [true, false], - message: "must be provided for custom or rhui ACS" + message: "must be provided for custom or rhui ACS", } validates :verify_ssl, if: :simplified?, inclusion: { in: [nil], - message: "cannot be provided for simplified ACS" + message: "cannot be provided for simplified ACS", } validates :alternate_content_source_type, inclusion: { in: ->(_) { ACS_TYPES }, allow_blank: false, - message: ->(_, _) { _("is not a valid type. Must be one of the following: %s") % ACS_TYPES.join(',') } + message: ->(_, _) { _("is not a valid type. Must be one of the following: %s") % ACS_TYPES.join(',') }, } validates :content_type, inclusion: { in: ->(_) { RepositoryTypeManager.defined_repository_types.keys & CONTENT_TYPES }, allow_blank: false, - message: ->(_, _) { _("is not allowed for ACS. Must be one of the following: %s") % (RepositoryTypeManager.defined_repository_types.keys & CONTENT_TYPES).sort.join(',') } + message: ->(_, _) { _("is not allowed for ACS. Must be one of the following: %s") % (RepositoryTypeManager.defined_repository_types.keys & CONTENT_TYPES).sort.join(',') }, } validates :content_type, if: -> { rhui? }, inclusion: { in: [::Katello::Repository::YUM_TYPE], - message: "'%{value}' is not valid for RHUI ACS" + message: "'%{value}' is not valid for RHUI ACS", } validate :constraint_acs_update, on: :update validates_with Validators::AlternateContentSourcePathValidator, :attributes => [:base_url, :subpaths], :if => :custom? diff --git a/app/models/katello/concerns/content_facet_host_extensions.rb b/app/models/katello/concerns/content_facet_host_extensions.rb index d08226e18a2..5d6fecb83e1 100644 --- a/app/models/katello/concerns/content_facet_host_extensions.rb +++ b/app/models/katello/concerns/content_facet_host_extensions.rb @@ -8,13 +8,13 @@ module ContentFacetHostExtensions :security_needed => Katello::ErrataStatus::NEEDED_SECURITY_ERRATA, :errata_needed => Katello::ErrataStatus::NEEDED_ERRATA, :updated => Katello::ErrataStatus::UP_TO_DATE, - :unknown => Katello::ErrataStatus::UNKNOWN + :unknown => Katello::ErrataStatus::UNKNOWN, }.freeze TRACE_STATUS_MAP = { :reboot_needed => Katello::TraceStatus::REQUIRE_REBOOT, :process_restart_needed => Katello::TraceStatus::REQUIRE_PROCESS_RESTART, - :updated => Katello::TraceStatus::UP_TO_DATE + :updated => Katello::TraceStatus::UP_TO_DATE, }.freeze has_one :errata_status_object, :class_name => 'Katello::ErrataStatus', :foreign_key => 'host_id', :dependent => :destroy diff --git a/app/models/katello/concerns/host_managed_extensions.rb b/app/models/katello/concerns/host_managed_extensions.rb index ce2bf0a8e66..74c051ed0ec 100644 --- a/app/models/katello/concerns/host_managed_extensions.rb +++ b/app/models/katello/concerns/host_managed_extensions.rb @@ -240,11 +240,11 @@ def find_by_installed_debs(_key, _operator, value) hosts = debs.joins(:host_installed_debs).select("#{Katello::HostInstalledDeb.table_name}.host_id as host_id").pluck(:host_id) if hosts.empty? { - :conditions => "1=0" + :conditions => "1=0", } else { - :conditions => "#{::Host::Managed.table_name}.id IN (#{hosts.join(',')})" + :conditions => "#{::Host::Managed.table_name}.id IN (#{hosts.join(',')})", } end end @@ -343,7 +343,7 @@ def import_module_streams(module_streams) { name: module_stream["name"], stream: module_stream["stream"], - context: module_stream["context"] + context: module_stream["context"], } end if streams.any? @@ -386,7 +386,7 @@ def sync_available_module_stream_associations(new_available_module_streams) host_id: self.id, available_module_stream_id: new_id, installed_profiles: module_stream["installed_profiles"], - status: status + status: status, } end HostAvailableModuleStream.insert_all(hams_to_create) if hams_to_create.any? diff --git a/app/models/katello/concerns/organization_extensions.rb b/app/models/katello/concerns/organization_extensions.rb index 9c04520f6b0..187389c2cd8 100644 --- a/app/models/katello/concerns/organization_extensions.rb +++ b/app/models/katello/concerns/organization_extensions.rb @@ -201,7 +201,7 @@ def self.check_informable_type!(informable_type, options = {}) defaults = { :message => _("Informable Type must be one of the following [ %{list} ]") % { :list => ALLOWED_DEFAULT_INFO_TYPES.join(", ") }, - :error => RuntimeError + :error => RuntimeError, } options = defaults.merge(options) diff --git a/app/models/katello/concerns/redhat_extensions.rb b/app/models/katello/concerns/redhat_extensions.rb index 05777007c66..44e4c35c1db 100644 --- a/app/models/katello/concerns/redhat_extensions.rb +++ b/app/models/katello/concerns/redhat_extensions.rb @@ -32,7 +32,7 @@ def create_operating_system(name, major, minor) 'name' => name, 'major' => major.to_s, 'minor' => minor.to_s, - 'family' => 'Redhat' + 'family' => 'Redhat', } return ::Redhat.create!(params) diff --git a/app/models/katello/concerns/smart_proxy_extensions.rb b/app/models/katello/concerns/smart_proxy_extensions.rb index fb9d6b0ce25..12eac3bd72d 100644 --- a/app/models/katello/concerns/smart_proxy_extensions.rb +++ b/app/models/katello/concerns/smart_proxy_extensions.rb @@ -62,7 +62,7 @@ def refresh validates :download_policy, inclusion: { :in => DOWNLOAD_POLICIES, - :message => _("must be one of the following: %s") % DOWNLOAD_POLICIES.join(', ') + :message => _("must be one of the following: %s") % DOWNLOAD_POLICIES.join(', '), } scope :with_content, -> { with_features(PULP_FEATURE, PULP_NODE_FEATURE, PULP3_FEATURE) } @@ -192,7 +192,7 @@ def translate_counts(repo, repo_mirror_service, repo_content_counts) env_id: repo.environment_id, library_instance_id: repo.library_instance_or_self.id, product_id: repo.product_id, - content_type: repo.content_type + content_type: repo.content_type, } repo_content_counts&.each do |name, count| count = count[:count] @@ -321,8 +321,8 @@ def pulp_disk_usage used: -1, free: -1, percentage: -1, - label: 'cloud-storage' - }.with_indifferent_access + label: 'cloud-storage', + }.with_indifferent_access, ] else [ @@ -332,8 +332,8 @@ def pulp_disk_usage used: storage['used'], free: storage['free'], percentage: (storage['used'] / storage['total'].to_f * 100).to_i, - label: 'pulp_dir' - }.with_indifferent_access + label: 'pulp_dir', + }.with_indifferent_access, ] end end diff --git a/app/models/katello/content.rb b/app/models/katello/content.rb index 663c0e9dff3..2986f62b054 100644 --- a/app/models/katello/content.rb +++ b/app/models/katello/content.rb @@ -73,18 +73,18 @@ def can_update_to_url?(new_url) current_subs == new_url_subs end - def self.substitute_content_path(arch: nil, releasever: nil, content_path:) + def self.substitute_content_path(content_path:, arch: nil, releasever: nil) arch = nil if arch == "noarch" substitutions = { :releasever => releasever, - :basearch => arch + :basearch => arch, }.compact path = substitutions.inject(content_path) do |path_url, (key, value)| path_url.gsub("$#{key}", value) end { path: path, - substitutions: substitutions + substitutions: substitutions, } end end diff --git a/app/models/katello/content_view.rb b/app/models/katello/content_view.rb index 37473e87ba4..4630db38c3e 100644 --- a/app/models/katello/content_view.rb +++ b/app/models/katello/content_view.rb @@ -124,7 +124,7 @@ def self.find_components_by_cv_name(_key, operator, value) kcv = Katello::ContentView.table_name kcvc = Katello::ContentViewComponent.table_name { :conditions => "#{kcv}.composite = 't' AND #{kcv}.id IN (SELECT #{kcvc}.composite_content_view_id FROM #{kcvc} WHERE #{kcvc}.content_view_id IN (SELECT #{kcv}.id FROM #{kcv} WHERE #{kcv}.name #{operator} ?))", - :parameter => [value] + :parameter => [value], } end @@ -144,7 +144,7 @@ def self.completer_scope_options(search) library_import: 3, repository_import: 4, library_export_syncable: 5, - repository_export_syncable: 6 + repository_export_syncable: 6, }, _prefix: true set_crud_hooks :content_view @@ -301,7 +301,7 @@ def as_json(options = {}) { :version => v.version, :published => v.created_at.to_s, - :environments => v.environments.map { |e| e.name } + :environments => v.environments.map { |e| e.name }, } end @@ -713,7 +713,7 @@ def check_remove_from_environment!(env) errors = [] dependencies = { hosts: _("hosts"), - activation_keys: _("activation keys") + activation_keys: _("activation keys"), } dependencies.each do |key, name| @@ -733,7 +733,7 @@ def check_ready_to_destroy! dependencies = { environments: _("environments"), hosts: _("hosts"), - activation_keys: _("activation keys") + activation_keys: _("activation keys"), } dependencies.each do |key, name| @@ -775,7 +775,7 @@ def related_composite_cvs content_views.push( { id: cv_id, - name: cv_name + name: cv_name, } ) end @@ -890,7 +890,7 @@ def filtered? def blocking_task blocking_task_labels = [ - ::Actions::Katello::ContentView::Publish.name + ::Actions::Katello::ContentView::Publish.name, ] ForemanTasks::Task::DynflowTask.where(:label => blocking_task_labels) .where.not(state: 'stopped') diff --git a/app/models/katello/content_view_environment.rb b/app/models/katello/content_view_environment.rb index 9dac17f36c8..7e782c320c1 100644 --- a/app/models/katello/content_view_environment.rb +++ b/app/models/katello/content_view_environment.rb @@ -66,14 +66,15 @@ def default_environment? end def priority(content_object) - if content_object.is_a? Katello::ActivationKey + case content_object + when Katello::ActivationKey content_view_environment_activation_keys.find_by(:activation_key_id => content_object.id).try(:priority) - elsif content_object.is_a? Katello::Host::ContentFacet + when Katello::Host::ContentFacet content_view_environment_content_facets.find_by(:content_facet_id => content_object.id).try(:priority) end end - def self.fetch_content_view_environments(labels: [], ids: [], organization:) + def self.fetch_content_view_environments(organization:, labels: [], ids: []) # Must ensure CVEs remain in the same order. # Using ActiveRecord .where will return them in a different order. id_errors = [] diff --git a/app/models/katello/content_view_erratum_filter_rule.rb b/app/models/katello/content_view_erratum_filter_rule.rb index 04ae63db489..8216de7b898 100644 --- a/app/models/katello/content_view_erratum_filter_rule.rb +++ b/app/models/katello/content_view_erratum_filter_rule.rb @@ -23,7 +23,7 @@ class ContentViewErratumFilterRule < Katello::Model :inclusion => { :in => DATE_TYPES, :allow_blank => false, - :message => (_("must be one of the following: %s") % DATE_TYPES.join(', ')) + :message => (_("must be one of the following: %s") % DATE_TYPES.join(', ')), } def self.in_content_views(content_view_ids) diff --git a/app/models/katello/content_view_filter.rb b/app/models/katello/content_view_filter.rb index 7431ea4de3e..4a61e49f8ba 100644 --- a/app/models/katello/content_view_filter.rb +++ b/app/models/katello/content_view_filter.rb @@ -41,7 +41,7 @@ class ContentViewFilter < Katello::Model def self.yum(include_module_streams = true) types = [::Katello::ContentViewPackageGroupFilter.name, ::Katello::ContentViewErratumFilter.name, - ::Katello::ContentViewPackageFilter.name + ::Katello::ContentViewPackageFilter.name, ] types << ::Katello::ContentViewModuleStreamFilter.name if include_module_streams where(:type => types) @@ -74,7 +74,7 @@ def content_type ContentViewErratumFilter => ERRATA, ContentViewPackageGroupFilter => PACKAGE_GROUP, ContentViewDockerFilter => DOCKER, - ContentViewModuleStreamFilter => MODULE_STREAM + ContentViewModuleStreamFilter => MODULE_STREAM, }[self.class] end diff --git a/app/models/katello/content_view_history.rb b/app/models/katello/content_view_history.rb index e1a467ff44b..c5851ca6607 100644 --- a/app/models/katello/content_view_history.rb +++ b/app/models/katello/content_view_history.rb @@ -33,7 +33,7 @@ class ContentViewHistory < Katello::Model promotion: 2, removal: 3, export: 4, - importing: 5 + importing: 5, } def content_view diff --git a/app/models/katello/content_view_repository.rb b/app/models/katello/content_view_repository.rb index a680703bf7e..9b9797e9c1f 100644 --- a/app/models/katello/content_view_repository.rb +++ b/app/models/katello/content_view_repository.rb @@ -6,7 +6,7 @@ class ContentViewRepository < Katello::Model Repository::FILE_TYPE, Repository::DEB_TYPE, Repository::ANSIBLE_COLLECTION_TYPE, - Katello::RepositoryTypeManager.generic_repository_types(false).keys.flatten + Katello::RepositoryTypeManager.generic_repository_types(false).keys.flatten, ].flatten.freeze ALLOWED_IMPORT_REPOSITORY_TYPES = Repository::EXPORTABLE_TYPES diff --git a/app/models/katello/content_view_version.rb b/app/models/katello/content_view_version.rb index 6f93ff50453..530912a23bc 100644 --- a/app/models/katello/content_view_version.rb +++ b/app/models/katello/content_view_version.rb @@ -357,7 +357,7 @@ def update_content_counts! def auto_publish_composites! metadata = { description: _("Auto Publish - Triggered by '%s'") % self.name, - triggered_by: self.id + triggered_by: self.id, } self.content_view.auto_publish_components.pluck(:composite_content_view_id).each do |composite_id| ::Katello::EventQueue.push_event(::Katello::Events::AutoPublishCompositeView::EVENT_TYPE, composite_id) do |attrs| @@ -443,12 +443,12 @@ def add_applied_filters! repo.slice(:id, :name, :label, :arch, :major, :minor, :content_type, :os_versions, :url, :content_id).merge(redhat: repo.redhat?, root: repo.root.id, product: repo.product.slice(:id, :label)) - end + end, } end self.applied_filters = { applied_filters: applied_filters_and_rules, - dependency_solving: content_view.solve_dependencies + dependency_solving: content_view.solve_dependencies, } save! end diff --git a/app/models/katello/content_view_version_export_history.rb b/app/models/katello/content_view_version_export_history.rb index 24b53661f93..f918c28275b 100644 --- a/app/models/katello/content_view_version_export_history.rb +++ b/app/models/katello/content_view_version_export_history.rb @@ -18,7 +18,7 @@ class ContentViewVersionExportHistory < Katello::Model validates :export_type, :presence => true, :inclusion => { :in => EXPORT_TYPES, :allow_blank => false, - :message => _("must be one of the following: %s" % EXPORT_TYPES.join(', ')) + :message => _("must be one of the following: %s" % EXPORT_TYPES.join(', ')), } validates :metadata, :presence => true serialize :metadata, Hash @@ -51,7 +51,7 @@ def set_export_type self.export_type ||= self.class.export_type_from_metadata(metadata) end - def self.generate_audit_comment(user:, content_view_version:, from_version: nil, metadata:) + def self.generate_audit_comment(user:, content_view_version:, metadata:, from_version: nil) export_type = export_type_from_metadata(metadata) if content_view_version.content_view.generated_for_library? export_descriptor = "library export" diff --git a/app/models/katello/content_view_version_import_history.rb b/app/models/katello/content_view_version_import_history.rb index a859e400c02..7fe476f83a9 100644 --- a/app/models/katello/content_view_version_import_history.rb +++ b/app/models/katello/content_view_version_import_history.rb @@ -35,7 +35,7 @@ class ContentViewVersionImportHistory < Katello::Model def self.generate_audit_comment(user:, content_view_name:) truncate_audit_comment(_("Content imported by %{user} into content view '%{name}'") % { user: user.to_label, - name: content_view_name + name: content_view_name, }) end end diff --git a/app/models/katello/glue/candlepin/activation_key.rb b/app/models/katello/glue/candlepin/activation_key.rb index 171a9dea71a..22accbac491 100644 --- a/app/models/katello/glue/candlepin/activation_key.rb +++ b/app/models/katello/glue/candlepin/activation_key.rb @@ -31,7 +31,7 @@ def get_key_pools key_pools.map do |key_pool| { :amount => (key_pool[:quantity] || 0), - :id => key_pool[:poolId] + :id => key_pool[:poolId], }.with_indifferent_access end end diff --git a/app/models/katello/glue/candlepin/candlepin_object.rb b/app/models/katello/glue/candlepin/candlepin_object.rb index 6030229267f..1c977e0ee33 100644 --- a/app/models/katello/glue/candlepin/candlepin_object.rb +++ b/app/models/katello/glue/candlepin/candlepin_object.rb @@ -21,7 +21,7 @@ def import_candlepin_records(candlepin_objects, org) def import_candlepin_record(record:, organization:) db_attrs = { cp_id: record['id'], - organization: organization + organization: organization, } yield(db_attrs) if block_given? diff --git a/app/models/katello/glue/candlepin/pool.rb b/app/models/katello/glue/candlepin/pool.rb index faeb2825c84..dc0e0ce1630 100644 --- a/app/models/katello/glue/candlepin/pool.rb +++ b/app/models/katello/glue/candlepin/pool.rb @@ -74,7 +74,7 @@ def import_candlepin_record(record:, organization:) end end - def determine_subscription(product_id: nil, source_stack_id: nil, organization:) + def determine_subscription(organization:, product_id: nil, source_stack_id: nil) if source_stack_id self.stacking_subscription(organization, source_stack_id) # isn't it an error if we have a sourceStackID but no stacking subscription? diff --git a/app/models/katello/glue/pulp/repos.rb b/app/models/katello/glue/pulp/repos.rb index 7a59bf54756..124dbe3ae38 100644 --- a/app/models/katello/glue/pulp/repos.rb +++ b/app/models/katello/glue/pulp/repos.rb @@ -95,7 +95,7 @@ def sync_state_aggregated :canceled, :error, :paused, - :running + :running, ] presented.each do |_repoid, task| diff --git a/app/models/katello/host/content_facet.rb b/app/models/katello/host/content_facet.rb index 5894e288143..a2566c45bc7 100644 --- a/app/models/katello/host/content_facet.rb +++ b/app/models/katello/host/content_facet.rb @@ -179,7 +179,7 @@ def update_repositories_by_paths(paths) paths.each do |path| if (prefix = prefixes.find { |pre| path.start_with?(pre) }) # strip prefix and structured_apt postfix before adding to relative_paths - relative_paths << path.sub(prefix, '').sub(/\/?(%3F|\?).*/, '') + relative_paths << path.sub(prefix, '').sub(%r{/?(%3F|\?).*}, '') else Rails.logger.warn("System #{self.host.name} (#{self.host.id}) requested binding to repo with unknown prefix. #{path}") end @@ -221,7 +221,7 @@ def errata_counts installable_hash = { :security => installable_security_errata_count, :bugfix => installable_bugfix_errata_count, - :enhancement => installable_enhancement_errata_count + :enhancement => installable_enhancement_errata_count, } installable_hash[:total] = installable_hash.values.inject(:+) # same for applicable, but we need to get the counts from the db @@ -229,13 +229,13 @@ def errata_counts applicable_hash = { :bugfix => applicable_errata_counts.values_at(*Katello::Erratum::BUGZILLA).compact.sum, :security => applicable_errata_counts.values_at(*Katello::Erratum::SECURITY).compact.sum, - :enhancement => applicable_errata_counts.values_at(*Katello::Erratum::ENHANCEMENT).compact.sum + :enhancement => applicable_errata_counts.values_at(*Katello::Erratum::ENHANCEMENT).compact.sum, } applicable_hash[:total] = applicable_errata_counts.values.sum # keeping installable at the top level for backward compatibility installable_hash.merge({ - :applicable => applicable_hash + :applicable => applicable_hash, }) end diff --git a/app/models/katello/host/info_provider.rb b/app/models/katello/host/info_provider.rb index c359713883c..3d48f7b8ebb 100644 --- a/app/models/katello/host/info_provider.rb +++ b/app/models/katello/host/info_provider.rb @@ -4,7 +4,7 @@ class InfoProvider < ::HostInfo::Provider def host_info info = {} info['parameters'] = { - 'foreman_host_collections' => host.host_collections.map(&:name) + 'foreman_host_collections' => host.host_collections.map(&:name), } if host.content_facet.present? @@ -43,7 +43,7 @@ def content_view_info(content_view_environment) 'latest-version' => content_view.try(:latest_version), 'version' => content_version(content_view_environment).try(:version), 'published' => content_version(content_view_environment).try(:created_at).try(:time).to_s, - 'components' => content_view_components(content_view_environment) + 'components' => content_view_components(content_view_environment), } end diff --git a/app/models/katello/host/subscription_facet.rb b/app/models/katello/host/subscription_facet.rb index bbf6fd8a051..4341e318ab4 100644 --- a/app/models/katello/host/subscription_facet.rb +++ b/app/models/katello/host/subscription_facet.rb @@ -146,7 +146,7 @@ def consumer_attributes :releaseVer => release_version, :environments => self.candlepin_environments, :installedProducts => self.installed_products.map(&:consumer_attributes), - :guestIds => virtual_guest_uuids + :guestIds => virtual_guest_uuids, } attrs[:facts] = facts if facts HashWithIndifferentAccess.new(attrs) @@ -305,7 +305,7 @@ def self.populate_fields_from_facts(host, parser, _type, _source_proxy) # might make you think it was converted2rhel but not with satellite, that is why I have the tenary below. facet = host.subscription_facet || host.build_subscription_facet facet.attributes = { - convert2rhel_through_foreman: has_convert2rhel ? ::Foreman::Cast.to_bool(parser.facts['conversions.env.CONVERT2RHEL_THROUGH_FOREMAN']) : nil + convert2rhel_through_foreman: has_convert2rhel ? ::Foreman::Cast.to_bool(parser.facts['conversions.env.CONVERT2RHEL_THROUGH_FOREMAN']) : nil, }.compact facet.save unless facet.new_record? end diff --git a/app/models/katello/host_available_module_stream.rb b/app/models/katello/host_available_module_stream.rb index cb1f5c9f25a..dad991ebd5d 100644 --- a/app/models/katello/host_available_module_stream.rb +++ b/app/models/katello/host_available_module_stream.rb @@ -22,7 +22,7 @@ class HostAvailableModuleStream < Katello::Model DISABLED => :disabled, UNKNOWN => :unknown, INSTALLED => :installed, - UPGRADABLE => :upgradable + UPGRADABLE => :upgradable, }.with_indifferent_access scoped_search :on => :name, :relation => :available_module_stream, :complete_value => true diff --git a/app/models/katello/installed_product.rb b/app/models/katello/installed_product.rb index 400c44d46ea..6532ea8107d 100644 --- a/app/models/katello/installed_product.rb +++ b/app/models/katello/installed_product.rb @@ -11,7 +11,7 @@ def self.find_or_create_from_consumer(consumer_attributes) :arch => consumer_attributes['arch'], :version => consumer_attributes['version'], :name => consumer_attributes['productName'], - :cp_product_id => consumer_attributes['productId'] + :cp_product_id => consumer_attributes['productId'], } Katello::Util::Support.active_record_retry do unless self.where(attributes).exists? @@ -26,7 +26,7 @@ def consumer_attributes :arch => arch, :version => version, :productName => name, - :productId => cp_product_id + :productId => cp_product_id, } end end diff --git a/app/models/katello/ping.rb b/app/models/katello/ping.rb index 3eb1bac4500..a4743cc31a0 100644 --- a/app/models/katello/ping.rb +++ b/app/models/katello/ping.rb @@ -34,7 +34,7 @@ def ping!(services: nil, capsule_id: nil) def status { version: Katello::VERSION, - timeUTC: Time.now.getutc + timeUTC: Time.now.getutc, } end diff --git a/app/models/katello/repository.rb b/app/models/katello/repository.rb index 4ecca3bf9fe..4b7da96c535 100644 --- a/app/models/katello/repository.rb +++ b/app/models/katello/repository.rb @@ -647,7 +647,7 @@ def create_smart_proxy_sync_history(smart_proxy) sp_history_args = { :smart_proxy_id => smart_proxy.id, :repository_id => self.id, - :started_at => Time.now + :started_at => Time.now, } sp_history = ::Katello::SmartProxySyncHistory.create sp_history_args sp_history.save! @@ -680,7 +680,7 @@ def blocking_task ::Actions::Katello::Repository::Sync.name, ::Actions::Katello::Repository::UploadFiles.name, ::Actions::Katello::Repository::RemoveContent.name, - ::Actions::Katello::Repository::MetadataGenerate.name + ::Actions::Katello::Repository::MetadataGenerate.name, ] ForemanTasks::Task::DynflowTask.where(:label => blocking_task_labels) .where.not(state: 'stopped') @@ -798,7 +798,7 @@ def distribution_information distribution_arch: self.distribution_arch, distribution_family: self.distribution_family, distribution_variant: self.distribution_variant, - distribution_bootable: self.distribution_bootable + distribution_bootable: self.distribution_bootable, } end @@ -954,7 +954,7 @@ def self.safe_render_container_name(repository, pattern = nil) product: repository.product, lifecycle_environment: repository.environment, content_view: repository.content_view_version.content_view, - content_view_version: repository.content_view_version + content_view_version: repository.content_view_version, } box = Safemode::Box.new(repository, allowed_methods) erb = ERB.new(pattern) diff --git a/app/models/katello/rhel_lifecycle_status.rb b/app/models/katello/rhel_lifecycle_status.rb index 0630f0d34cd..fcd77d8d9bf 100644 --- a/app/models/katello/rhel_lifecycle_status.rb +++ b/app/models/katello/rhel_lifecycle_status.rb @@ -16,40 +16,40 @@ def self.end_of_day(date) 'RHEL9' => { 'full_support' => end_of_day('2027-05-31'), 'maintenance_support' => end_of_day('2032-05-31'), - 'extended_support' => end_of_day('2035-05-31') + 'extended_support' => end_of_day('2035-05-31'), }, 'RHEL8' => { 'full_support' => end_of_day('2024-05-31'), 'maintenance_support' => end_of_day('2029-05-31'), - 'extended_support' => end_of_day('2032-05-31') + 'extended_support' => end_of_day('2032-05-31'), }, 'RHEL7' => { 'full_support' => end_of_day('2019-08-06'), 'maintenance_support' => end_of_day('2024-06-30'), - 'extended_support' => end_of_day('2028-06-30') + 'extended_support' => end_of_day('2028-06-30'), }, 'RHEL7 (System z (Structure A))' => { 'full_support' => end_of_day('2019-08-06'), - 'maintenance_support' => end_of_day('2021-05-31') + 'maintenance_support' => end_of_day('2021-05-31'), }, 'RHEL7 (ARM)' => { 'full_support' => end_of_day('2019-08-06'), - 'maintenance_support' => end_of_day('2020-11-30') + 'maintenance_support' => end_of_day('2020-11-30'), }, 'RHEL7 (POWER9)' => { 'full_support' => end_of_day('2019-08-06'), - 'maintenance_support' => end_of_day('2021-05-31') + 'maintenance_support' => end_of_day('2021-05-31'), }, 'RHEL6' => { 'full_support' => end_of_day('2016-05-10'), 'maintenance_support' => end_of_day('2020-11-30'), - 'extended_support' => end_of_day('2024-06-30') + 'extended_support' => end_of_day('2024-06-30'), }, 'RHEL5' => { 'full_support' => end_of_day('2013-01-08'), 'maintenance_support' => end_of_day('2017-03-31'), - 'extended_support' => end_of_day('2020-11-30') - } + 'extended_support' => end_of_day('2020-11-30'), + }, }.freeze EOS_WARNING_THRESHOLD = 1.year @@ -61,7 +61,7 @@ def self.status_map approaching_end_of_maintenance: APPROACHING_END_OF_MAINTENANCE, extended_support: EXTENDED_SUPPORT, approaching_end_of_support: APPROACHING_END_OF_SUPPORT, - support_ended: SUPPORT_ENDED + support_ended: SUPPORT_ENDED, } map.default = UNKNOWN diff --git a/app/models/katello/root_repository.rb b/app/models/katello/root_repository.rb index 64a29cb8034..bebc763a9af 100644 --- a/app/models/katello/root_repository.rb +++ b/app/models/katello/root_repository.rb @@ -23,7 +23,7 @@ class RootRepository < Katello::Model SKIPABLE_METADATA_TYPES = [Repository::YUM_TYPE, Repository::DEB_TYPE].freeze CONTENT_ATTRIBUTE_RESTRICTIONS = { - :download_policy => [Repository::YUM_TYPE, Repository::DEB_TYPE, Repository::DOCKER_TYPE] + :download_policy => [Repository::YUM_TYPE, Repository::DEB_TYPE, Repository::DOCKER_TYPE], }.freeze MAX_EXPIRE_TIME = 7 * 24 * 60 * 60 @@ -96,15 +96,15 @@ class RootRepository < Katello::Model validates :content_type, :inclusion => { :in => ->(_) { Katello::RepositoryTypeManager.enabled_repository_types.keys }, :allow_blank => false, - :message => ->(_, _) { _("is not enabled. must be one of the following: %s") % Katello::RepositoryTypeManager.enabled_repository_types.keys.join(', ') } + :message => ->(_, _) { _("is not enabled. must be one of the following: %s") % Katello::RepositoryTypeManager.enabled_repository_types.keys.join(', ') }, } validates :download_policy, inclusion: { :in => DOWNLOAD_POLICIES, - :message => _("must be one of the following: %s") % DOWNLOAD_POLICIES.join(', ') + :message => _("must be one of the following: %s") % DOWNLOAD_POLICIES.join(', '), }, if: :yum? validates :http_proxy_policy, inclusion: { :in => HTTP_PROXY_POLICIES, - :message => _("must be one of the following: %s") % HTTP_PROXY_POLICIES.join(', ') + :message => _("must be one of the following: %s") % HTTP_PROXY_POLICIES.join(', '), } validates :metadata_expire, @@ -113,7 +113,7 @@ class RootRepository < Katello::Model less_than_or_equal_to: MAX_EXPIRE_TIME, greater_than: 0, allow_nil: true, - only_integer: true + only_integer: true, } validates :container_push_name_format, inclusion: { in: ['label', 'id'].freeze, allow_nil: true} @@ -432,7 +432,7 @@ def calculate_updated_name def substitutions { :releasever => self.minor, - :basearch => self.arch + :basearch => self.arch, }.compact end diff --git a/app/models/katello/task_status.rb b/app/models/katello/task_status.rb index ac33769ab41..6a356dfd35f 100644 --- a/app/models/katello/task_status.rb +++ b/app/models/katello/task_status.rb @@ -247,7 +247,7 @@ def rmi_error_description # Handle not very friendly Pulp message case errors when /^\(.*\)$/ - if stacktrace.class == Array + if stacktrace.instance_of?(Array) stacktrace.last.split(":").first else stacktrace.split("(").first diff --git a/app/models/katello/upstream_pool.rb b/app/models/katello/upstream_pool.rb index 9297518a5d1..6d55f14eb64 100644 --- a/app/models/katello/upstream_pool.rb +++ b/app/models/katello/upstream_pool.rb @@ -24,7 +24,7 @@ def respond(pools, total) { pools: pools, total: total, - subtotal: pools.count + subtotal: pools.count, } end @@ -59,7 +59,7 @@ def kat_to_cp_map consumed: 'consumed', product_name: 'productName', product_id: 'productId', - subscription_id: 'subscriptionId' + subscription_id: 'subscriptionId', } end diff --git a/app/presenters/katello/product_content_presenter.rb b/app/presenters/katello/product_content_presenter.rb index a374cf42a8b..727a55bba9d 100644 --- a/app/presenters/katello/product_content_presenter.rb +++ b/app/presenters/katello/product_content_presenter.rb @@ -29,12 +29,12 @@ def status if overidden_value.nil? { status: enabled ? "enabled" : "disabled", - overridden: false + overridden: false, } else { status: overidden_value ? "enabled" : "disabled", - overridden: true + overridden: true, } end end diff --git a/app/presenters/katello/repository_presenter.rb b/app/presenters/katello/repository_presenter.rb index aee60724d3f..c4cac376944 100644 --- a/app/presenters/katello/repository_presenter.rb +++ b/app/presenters/katello/repository_presenter.rb @@ -14,12 +14,12 @@ def content_view_environments { :content_view_version => { :id => repository.content_view_version.id, - :name => repository.content_view_version.name + :name => repository.content_view_version.name, }, :environment => { :id => repository.environment.id, - :name => repository.environment.name - } + :name => repository.environment.name, + }, } end end diff --git a/app/presenters/katello/sync_status_presenter.rb b/app/presenters/katello/sync_status_presenter.rb index 24f4ca62145..735ea95ad75 100644 --- a/app/presenters/katello/sync_status_presenter.rb +++ b/app/presenters/katello/sync_status_presenter.rb @@ -8,7 +8,7 @@ class SyncStatusPresenter :never_synced => _("Never Synced"), :running => _("Running"), :canceled => _("Canceled"), - :paused => _("Paused") + :paused => _("Paused"), }.with_indifferent_access def initialize(repo, task) @@ -34,7 +34,7 @@ def sync_progress :display_size => display_output, :size => display_output, :is_running => @task.pending && @task.state != 'paused', - :error_details => @task.errors + :error_details => @task.errors, } end @@ -47,7 +47,7 @@ def empty_task(repo) :product_id => repo.product.id, :progress => {}, :state => format_state(OpenStruct.new(:state => state)), - :raw_state => state + :raw_state => state, } end diff --git a/app/services/katello/candlepin_event_listener.rb b/app/services/katello/candlepin_event_listener.rb index 9deb0e24f93..3dec55b00f3 100644 --- a/app/services/katello/candlepin_event_listener.rb +++ b/app/services/katello/candlepin_event_listener.rb @@ -40,7 +40,7 @@ def self.status { processed_count: @processed_count, failed_count: @failed_count, - running: running? + running: running?, } end diff --git a/app/services/katello/event_monitor/poller_thread.rb b/app/services/katello/event_monitor/poller_thread.rb index 4fac317616d..a5355c92683 100644 --- a/app/services/katello/event_monitor/poller_thread.rb +++ b/app/services/katello/event_monitor/poller_thread.rb @@ -46,7 +46,7 @@ def status { processed_count: @processed_count, failed_count: @failed_count, - running: running? + running: running?, } end diff --git a/app/services/katello/event_queue.rb b/app/services/katello/event_queue.rb index 00967f1bd30..0adf2cdb48f 100644 --- a/app/services/katello/event_queue.rb +++ b/app/services/katello/event_queue.rb @@ -53,7 +53,7 @@ def self.reset_in_progress def self.push_event(event_type, id) attrs = { event_type: event_type, - object_id: id + object_id: id, } yield(attrs) if block_given? diff --git a/app/services/katello/product_content_importer.rb b/app/services/katello/product_content_importer.rb index 5eca9e0f117..c5875378786 100644 --- a/app/services/katello/product_content_importer.rb +++ b/app/services/katello/product_content_importer.rb @@ -152,7 +152,7 @@ def import vendor: content[:vendor], gpg_url: content[:gpgUrl], content_url: content[:contentUrl], - organization_id: product.organization_id + organization_id: product.organization_id, } end diff --git a/app/services/katello/pulp3/alternate_content_source.rb b/app/services/katello/pulp3/alternate_content_source.rb index 0e31f391b74..f5587a15d5c 100644 --- a/app/services/katello/pulp3/alternate_content_source.rb +++ b/app/services/katello/pulp3/alternate_content_source.rb @@ -54,7 +54,7 @@ def remote_options proxy_url: smart_proxy.http_proxy&.url, proxy_username: smart_proxy.http_proxy&.username, proxy_password: smart_proxy.http_proxy&.password, - total_timeout: Setting[:sync_connect_timeout] + total_timeout: Setting[:sync_connect_timeout], } if acs.content_type == ::Katello::Repository::FILE_TYPE && acs.subpaths.empty? && !remote_options[:url].end_with?('/PULP_MANIFEST') remote_options[:url] = acs.base_url + '/PULP_MANIFEST' @@ -73,7 +73,7 @@ def ssl_remote_options { client_cert: acs.ssl_client_cert&.content, client_key: acs.ssl_client_key&.content, - ca_cert: acs.ssl_ca_cert&.content + ca_cert: acs.ssl_ca_cert&.content, } end end diff --git a/app/services/katello/pulp3/ansible_collection.rb b/app/services/katello/pulp3/ansible_collection.rb index 5245f9b387f..57e378c0244 100644 --- a/app/services/katello/pulp3/ansible_collection.rb +++ b/app/services/katello/pulp3/ansible_collection.rb @@ -26,7 +26,7 @@ def self.generate_model_row(unit) namespace: unit['namespace'], version: unit['version'], name: unit['name'], - description: unit['description'] + description: unit['description'], } end diff --git a/app/services/katello/pulp3/content.rb b/app/services/katello/pulp3/content.rb index 645ab57b4df..3a43e3eafa3 100644 --- a/app/services/katello/pulp3/content.rb +++ b/app/services/katello/pulp3/content.rb @@ -4,6 +4,7 @@ module Pulp3 class Content extend Katello::Abstract::Pulp::Content class << self + # rubocop:disable Metrics/ParameterLists def create_upload(size = 0, checksum = nil, content_type = nil, repository = nil) content_unit_href = nil content_type = ::Katello::RepositoryTypeManager.find_content_type(content_type) diff --git a/app/services/katello/pulp3/content_view_version/export.rb b/app/services/katello/pulp3/content_view_version/export.rb index d92b767d56e..a6f6a3a4a3a 100644 --- a/app/services/katello/pulp3/content_view_version/export.rb +++ b/app/services/katello/pulp3/content_view_version/export.rb @@ -130,11 +130,7 @@ def generate_metadata MetadataGenerator.new(export_service: self).generate! end - def self.find_generated_export_view(create_by_default: false, - destination_server:, - organization:, - name:, - generated_for:) + def self.find_generated_export_view(destination_server:, organization:, name:, generated_for:, create_by_default: false) name += "-#{destination_server}" unless destination_server.blank? select_method = create_by_default ? :first_or_create : :first ::Katello::ContentView.where(name: name, @@ -146,9 +142,7 @@ def format is_a?(SyncableFormatExport) ? SYNCABLE : IMPORTABLE end - def self.find_library_export_view(create_by_default: false, - destination_server:, - organization:, + def self.find_library_export_view(destination_server:, organization:, create_by_default: false, format: IMPORTABLE) if format == IMPORTABLE generated_for = :library_export @@ -165,8 +159,7 @@ def self.find_library_export_view(create_by_default: false, generated_for: generated_for) end - def self.find_repository_export_view(create_by_default: false, - repository:, + def self.find_repository_export_view(repository:, create_by_default: false, format: IMPORTABLE) if format == IMPORTABLE generated_for = :repository_export diff --git a/app/services/katello/pulp3/content_view_version/export_validator.rb b/app/services/katello/pulp3/content_view_version/export_validator.rb index 9c6a97dc59b..d8ef5369522 100644 --- a/app/services/katello/pulp3/content_view_version/export_validator.rb +++ b/app/services/katello/pulp3/content_view_version/export_validator.rb @@ -30,7 +30,7 @@ def validate_has_repos! " is required to be able to export: '%{exportable_types}'." % { content_view: content_view_version.content_view.name, current: content_view_version.version, - exportable_types: ::Katello::Repository.exportable_types(format: format).join("', '") + exportable_types: ::Katello::Repository.exportable_types(format: format).join("', '"), }) end end diff --git a/app/services/katello/pulp3/content_view_version/import.rb b/app/services/katello/pulp3/content_view_version/import.rb index 6d503fa790f..6ea21ebbf1f 100644 --- a/app/services/katello/pulp3/content_view_version/import.rb +++ b/app/services/katello/pulp3/content_view_version/import.rb @@ -135,7 +135,7 @@ def import_content_view_params name: metadata_map.content_view.name, label: metadata_map.content_view.label, description: metadata_map.content_view.description, - generated_for: generated_for + generated_for: generated_for, } end @@ -150,7 +150,7 @@ def import_content_view_params name: import_cv_name_from_export(name: metadata_map.content_view.name, generated_for: generated_for), label: import_cv_name_from_export(name: metadata_map.content_view.label, generated_for: generated_for), description: "Content View used for importing into library", - generated_for: generated_for + generated_for: generated_for, } end diff --git a/app/services/katello/pulp3/content_view_version/import_gpg_keys.rb b/app/services/katello/pulp3/content_view_version/import_gpg_keys.rb index ea1b895a0b9..cbe49121ae6 100644 --- a/app/services/katello/pulp3/content_view_version/import_gpg_keys.rb +++ b/app/services/katello/pulp3/content_view_version/import_gpg_keys.rb @@ -22,7 +22,7 @@ def import! params = { name: gpg.name, content_type: ::Katello::ContentCredential::GPG_KEY_TYPE, - content: gpg.content + content: gpg.content, } create_or_update_gpg!(params) diff --git a/app/services/katello/pulp3/content_view_version/importable_products.rb b/app/services/katello/pulp3/content_view_version/importable_products.rb index e44c353c699..273c8ef1b39 100644 --- a/app/services/katello/pulp3/content_view_version/importable_products.rb +++ b/app/services/katello/pulp3/content_view_version/importable_products.rb @@ -39,7 +39,7 @@ def create_params(metadata_product) gpg_key_id: gpg_key_id(metadata_product), name: find_unique_name(metadata_product), label: metadata_product.label, - description: metadata_product.description + description: metadata_product.description, } end @@ -56,7 +56,7 @@ def find_unique_name(metadata_product) def update_params(metadata_product) { gpg_key_id: gpg_key_id(metadata_product), - description: metadata_product.description + description: metadata_product.description, } end diff --git a/app/services/katello/pulp3/content_view_version/importable_repositories.rb b/app/services/katello/pulp3/content_view_version/importable_repositories.rb index d8feaf04ee5..34a8caa5d42 100644 --- a/app/services/katello/pulp3/content_view_version/importable_repositories.rb +++ b/app/services/katello/pulp3/content_view_version/importable_repositories.rb @@ -46,14 +46,14 @@ def generate! product_content = fetch_product_content(repo.content, product) substitutions = { basearch: repo.arch, - releasever: repo.minor + releasever: repo.minor, } creatable << { product: product, content: product_content, substitutions: substitutions, override_url: fetch_feed_url(repo), - override_arch: repo.arch + override_arch: repo.arch, } else creatable << { repository: product.add_repo(create_repo_params(repo, product)) } @@ -109,7 +109,7 @@ def create_repo_params(metadata_repo, product) :major, :minor, :download_policy, - :mirroring_policy + :mirroring_policy, ] params = { name: find_unique_name(metadata_repo, product) } @@ -142,7 +142,7 @@ def update_repo_params(metadata_repo) :major, :minor, :download_policy, - :mirroring_policy + :mirroring_policy, ] params = {} url = fetch_feed_url(metadata_repo) diff --git a/app/services/katello/pulp3/content_view_version/metadata_generator.rb b/app/services/katello/pulp3/content_view_version/metadata_generator.rb index 2a199dbac6b..0f62e0b5059 100644 --- a/app/services/katello/pulp3/content_view_version/metadata_generator.rb +++ b/app/services/katello/pulp3/content_view_version/metadata_generator.rb @@ -21,7 +21,7 @@ def generate! content_view: content_view.slice(:name, :label, :description, :generated_for), content_view_version: content_view_version.slice(:major, :minor, :description), incremental: from_content_view_version.present?, - format: export_service.format + format: export_service.format, } unless from_content_view_version.blank? ret[:from_content_view_version] = from_content_view_version.slice(:major, :minor) @@ -72,7 +72,7 @@ def generate_content_metadata(repo) content_path: content.content_url) { id: content.cp_content_id, label: content.label, - url: content_data[:path] + url: content_data[:path], } end diff --git a/app/services/katello/pulp3/deb.rb b/app/services/katello/pulp3/deb.rb index 1abb2884f60..d128a4063ef 100644 --- a/app/services/katello/pulp3/deb.rb +++ b/app/services/katello/pulp3/deb.rb @@ -40,7 +40,7 @@ def self.generate_model_row(unit) section: unit[:section], maintainer: unit[:maintainer], homepage: unit[:homepage], - installed_size: unit[:installed_size] + installed_size: unit[:installed_size], } end diff --git a/app/services/katello/pulp3/docker_manifest.rb b/app/services/katello/pulp3/docker_manifest.rb index 57334ed4fef..32c2a4d1c2e 100644 --- a/app/services/katello/pulp3/docker_manifest.rb +++ b/app/services/katello/pulp3/docker_manifest.rb @@ -30,7 +30,7 @@ def self.generate_model_row(unit) annotations: unit['annotations'], labels: unit['labels'], is_bootable: unit['is_bootable'], - is_flatpak: unit['is_flatpak'] + is_flatpak: unit['is_flatpak'], } end end diff --git a/app/services/katello/pulp3/docker_manifest_list.rb b/app/services/katello/pulp3/docker_manifest_list.rb index d21edca2ff6..372403ecfd7 100644 --- a/app/services/katello/pulp3/docker_manifest_list.rb +++ b/app/services/katello/pulp3/docker_manifest_list.rb @@ -32,7 +32,7 @@ def self.generate_model_row(unit) annotations: unit['annotations'], labels: unit['labels'], is_bootable: unit['is_bootable'], - is_flatpak: unit['is_flatpak'] + is_flatpak: unit['is_flatpak'], } end @@ -44,7 +44,7 @@ def self.insert_child_associations(units, pulp_id_to_id) manifest_list_manifests += manifest_ids.map do |manifest_id| { docker_manifest_list_id: katello_id, - docker_manifest_id: manifest_id + docker_manifest_id: manifest_id, } end end diff --git a/app/services/katello/pulp3/docker_tag.rb b/app/services/katello/pulp3/docker_tag.rb index 4bfd03a82ba..e490e067b17 100644 --- a/app/services/katello/pulp3/docker_tag.rb +++ b/app/services/katello/pulp3/docker_tag.rb @@ -18,7 +18,7 @@ def self.ids_for_repository(repo_id) def self.generate_model_row(unit) row = { pulp_id: unit[unit_identifier], - name: unit['name'] + name: unit['name'], } taggable = ::Katello::DockerManifest.find_by(:pulp_id => unit['tagged_manifest']) diff --git a/app/services/katello/pulp3/erratum.rb b/app/services/katello/pulp3/erratum.rb index 27ef78a37bb..670fba54e52 100644 --- a/app/services/katello/pulp3/erratum.rb +++ b/app/services/katello/pulp3/erratum.rb @@ -75,7 +75,7 @@ def self.build_bugzillas(katello_id, ref_list) { bug_id: bugzilla[:id], href: bugzilla[:href], - erratum_id: katello_id + erratum_id: katello_id, } end end @@ -85,7 +85,7 @@ def self.build_cves(katello_id, ref_list) { cve_id: cve[:id], href: cve[:href], - erratum_id: katello_id + erratum_id: katello_id, } end end diff --git a/app/services/katello/pulp3/file_unit.rb b/app/services/katello/pulp3/file_unit.rb index c848ef1d851..df0f20abe2b 100644 --- a/app/services/katello/pulp3/file_unit.rb +++ b/app/services/katello/pulp3/file_unit.rb @@ -27,7 +27,7 @@ def self.generate_model_row(unit) pulp_id: unit[unit_identifier], name: filename, path: unit['relative_path'], - checksum: unit['sha256'] + checksum: unit['sha256'], } end end diff --git a/app/services/katello/pulp3/generic_content_unit.rb b/app/services/katello/pulp3/generic_content_unit.rb index 165db5732d5..15493063339 100644 --- a/app/services/katello/pulp3/generic_content_unit.rb +++ b/app/services/katello/pulp3/generic_content_unit.rb @@ -24,7 +24,7 @@ def self.generate_model_row(unit, content_type) version: content_type&.model_version&.call(unit), filename: content_type&.model_filename&.call(unit), additional_metadata: content_type&.model_additional_metadata&.call(unit), - content_type: content_type&.label + content_type: content_type&.label, } end end diff --git a/app/services/katello/pulp3/module_stream.rb b/app/services/katello/pulp3/module_stream.rb index ee05c2ffae9..c453dbb399c 100644 --- a/app/services/katello/pulp3/module_stream.rb +++ b/app/services/katello/pulp3/module_stream.rb @@ -19,7 +19,7 @@ def self.build_stream_rpms(katello_id, package_hrefs) rpms = package_ids.map do |package_id| { module_stream_id: katello_id, - rpm_id: package_id + rpm_id: package_id, } end add_timestamps(rpms) @@ -38,7 +38,7 @@ def self.build_profiles(katello_id, profiles_json) profiles = profiles_json.map do |profile, _rpms| { module_stream_id: katello_id, - name: profile + name: profile, } end add_timestamps(profiles) diff --git a/app/services/katello/pulp3/repository.rb b/app/services/katello/pulp3/repository.rb index b78fa192556..a333c0e27dc 100644 --- a/app/services/katello/pulp3/repository.rb +++ b/app/services/katello/pulp3/repository.rb @@ -227,7 +227,7 @@ def delete_publication def publication_options(repository) { - repository_version: repository.version_href + repository_version: repository.version_href, } end @@ -325,7 +325,7 @@ def copy_all(source_repository, options = {}) data = api.class.copy_class.new data.config = [{ source_repo_version: source_repository.version_href, - dest_repo: repository_reference.repository_href + dest_repo: repository_reference.repository_href, }] tasks << api.copy_api.copy_content(data) tasks @@ -406,7 +406,7 @@ def common_remote_options connect_timeout: Setting[:sync_connect_timeout_v2], sock_connect_timeout: Setting[:sync_sock_connect_timeout], sock_read_timeout: Setting[:sync_sock_read_timeout], - rate_limit: Setting[:download_rate_limit] + rate_limit: Setting[:download_rate_limit], } remote_options[:url] = root.url unless root.url.blank? remote_options[:download_concurrency] = root.download_concurrency unless root.download_concurrency.blank? @@ -452,23 +452,23 @@ def ssl_remote_options options = { client_cert: root.product.certificate, client_key: root.product.key, - ca_cert: Katello::Repository.feed_ca_cert(root.url) + ca_cert: Katello::Repository.feed_ca_cert(root.url), } elsif root.redhat? && root.cdn_configuration.custom_cdn? options = { - ca_cert: root.cdn_configuration.ssl_ca + ca_cert: root.cdn_configuration.ssl_ca, } elsif root.redhat? && root.cdn_configuration.network_sync? options = { client_cert: root.cdn_configuration.ssl_cert, client_key: root.cdn_configuration.ssl_key, - ca_cert: root.cdn_configuration.ssl_ca + ca_cert: root.cdn_configuration.ssl_ca, } elsif root.custom? options = { client_cert: root.ssl_client_cert&.content, client_key: root.ssl_client_key&.content, - ca_cert: root.ssl_ca_cert&.content + ca_cert: root.ssl_ca_cert&.content, } end append_proxy_cacert(options) if options.key?(:cacert) diff --git a/app/services/katello/pulp3/repository/ansible_collection.rb b/app/services/katello/pulp3/repository/ansible_collection.rb index 2f18534cfb2..1035ef2dda1 100644 --- a/app/services/katello/pulp3/repository/ansible_collection.rb +++ b/app/services/katello/pulp3/repository/ansible_collection.rb @@ -20,7 +20,7 @@ def distribution_options(path) { base_path: path, repository_version: repo.version_href, - name: "#{generate_backend_object_name}" + name: "#{generate_backend_object_name}", } end diff --git a/app/services/katello/pulp3/repository/apt.rb b/app/services/katello/pulp3/repository/apt.rb index 2ddd1cc35c3..2673e5209a0 100644 --- a/app/services/katello/pulp3/repository/apt.rb +++ b/app/services/katello/pulp3/repository/apt.rb @@ -18,7 +18,7 @@ def initialize_empty def remote_options deb_remote_options = { policy: root.download_policy, - distributions: root.deb_releases + distributions: root.deb_releases, } deb_remote_options[:components] = root.deb_components.present? ? root.deb_components : nil deb_remote_options[:architectures] = root.deb_architectures.present? ? root.deb_architectures : nil @@ -61,7 +61,7 @@ def distribution_options(path) { base_path: path, publication: repo.publication_href, - name: "#{generate_backend_object_name}" + name: "#{generate_backend_object_name}", } end @@ -110,7 +110,7 @@ def copy_api_data_dup(data) config_hash = { source_repo_version: repo_config[:source_repo_version], dest_repo: repo_config[:dest_repo], - content: [] + content: [], } config_hash[:dest_base_version] = repo_config[:dest_base_version] if repo_config[:dest_base_version] data_dup.config << config_hash diff --git a/app/services/katello/pulp3/repository/docker.rb b/app/services/katello/pulp3/repository/docker.rb index 70604a6b6c2..fb72a4f8066 100644 --- a/app/services/katello/pulp3/repository/docker.rb +++ b/app/services/katello/pulp3/repository/docker.rb @@ -39,7 +39,7 @@ def mirror_remote_options super.merge( { url: "https://#{SmartProxy.pulp_primary.pulp3_host!.downcase}", - upstream_name: repo.container_repository_name + upstream_name: repo.container_repository_name, } ) end @@ -48,7 +48,7 @@ def distribution_options(path) { base_path: path, repository_version: repo.version_href, - name: "#{generate_backend_object_name}" + name: "#{generate_backend_object_name}", } end diff --git a/app/services/katello/pulp3/repository/file.rb b/app/services/katello/pulp3/repository/file.rb index 52fe623a510..1b7b2bbbc28 100644 --- a/app/services/katello/pulp3/repository/file.rb +++ b/app/services/katello/pulp3/repository/file.rb @@ -12,7 +12,7 @@ def distribution_options(path) { base_path: path, publication: repo.publication_href, - name: "#{generate_backend_object_name}" + name: "#{generate_backend_object_name}", } end diff --git a/app/services/katello/pulp3/repository/generic.rb b/app/services/katello/pulp3/repository/generic.rb index d7b3b959c45..4a9fbbb4ff4 100644 --- a/app/services/katello/pulp3/repository/generic.rb +++ b/app/services/katello/pulp3/repository/generic.rb @@ -9,7 +9,7 @@ def copy_content_for_source(source_repository, _options = {}) def distribution_options(path) options = { base_path: path, - name: "#{generate_backend_object_name}" + name: "#{generate_backend_object_name}", } if ::Katello::RepositoryTypeManager.find(repo.content_type).pulp3_skip_publication diff --git a/app/services/katello/pulp3/repository/yum.rb b/app/services/katello/pulp3/repository/yum.rb index 31ac03874af..b2e365cc814 100644 --- a/app/services/katello/pulp3/repository/yum.rb +++ b/app/services/katello/pulp3/repository/yum.rb @@ -50,7 +50,7 @@ def distribution_options(path) { base_path: path, publication: repo.publication_href, - name: "#{generate_backend_object_name}" + name: "#{generate_backend_object_name}", } end @@ -141,7 +141,7 @@ def copy_api_data_dup(data) config_hash = { source_repo_version: repo_config[:source_repo_version], dest_repo: repo_config[:dest_repo], - content: [] + content: [], } config_hash[:dest_base_version] = repo_config[:dest_base_version] if repo_config[:dest_base_version] data_dup.config << config_hash @@ -253,7 +253,7 @@ def add_filter_content(source_repo_ids, filters, filter_list_map, additional_inc source_repo_ids.each do |repo_id| filter_list_map[:whitelist_ids] += filter.content_unit_pulp_ids(::Katello::Repository.find(repo_id)) end - elsif filter.class == ContentViewErratumFilter + elsif filter.instance_of?(ContentViewErratumFilter) source_repo_ids.each do |repo_id| filter_list_map[:blacklist_ids] += filter.content_unit_pulp_ids(::Katello::Repository.find(repo_id), additional_included_errata) end @@ -280,7 +280,7 @@ def add_modular_content(source_repo_ids, filters, modular_filters, filter_list_m inclusion_modular_filters = modular_filters.select { |filter| filter.inclusion } exclusion_modular_filters = modular_filters - inclusion_modular_filters if inclusion_modular_filters.empty? && - !(filters.any? { |filter| filter.class == ContentViewErratumFilter && filter.inclusion }) + !(filters.any? { |filter| filter.instance_of?(ContentViewErratumFilter) && filter.inclusion }) source_repo_ids.each do |source_repo_id| source_repo = ::Katello::Repository.find(source_repo_id) filter_list_map[:whitelist_ids] += source_repo.rpms.where(:modular => true).pluck(:pulp_id).sort @@ -401,7 +401,7 @@ def copy_content_for_source(source_repository, options = {}) (errata_filters + package_filters).each do |filter| if filter.inclusion whitelist_ids += filter.content_unit_pulp_ids(source_repository) - elsif filter.class == ContentViewErratumFilter + elsif filter.instance_of?(ContentViewErratumFilter) blacklist_ids += filter.content_unit_pulp_ids(source_repository, additional_included_errata) else blacklist_ids += filter.content_unit_pulp_ids(source_repository) diff --git a/app/services/katello/pulp3/repository_mirror.rb b/app/services/katello/pulp3/repository_mirror.rb index 7d002792954..7e0139e8202 100644 --- a/app/services/katello/pulp3/repository_mirror.rb +++ b/app/services/katello/pulp3/repository_mirror.rb @@ -92,7 +92,7 @@ def create_version(options = {}) def distribution_options(path, options = {}) ret = { base_path: path, - name: "#{backend_object_name}" + name: "#{backend_object_name}", } ret[:content_guard] = repo.unprotected ? nil : content_guard_href ret[:publication] = options[:publication] if options.key? :publication @@ -145,7 +145,7 @@ def common_remote_options connect_timeout: Setting[:sync_connect_timeout_v2], sock_connect_timeout: Setting[:sync_sock_connect_timeout], sock_read_timeout: Setting[:sync_sock_read_timeout], - rate_limit: Setting[:download_rate_limit] + rate_limit: Setting[:download_rate_limit], } remote_options.merge!({download_concurrency: repo.download_concurrency}) if repo.download_concurrency remote_options.merge!(ssl_remote_options) @@ -157,7 +157,7 @@ def ssl_remote_options client_cert: ueber_cert[:cert], client_key: ueber_cert[:key], ca_cert: ::Cert::Certs.ca_cert, - tls_validation: true + tls_validation: true, } end diff --git a/app/services/katello/registration_manager.rb b/app/services/katello/registration_manager.rb index cf2d99bc9b9..0ec8f0545a2 100644 --- a/app/services/katello/registration_manager.rb +++ b/app/services/katello/registration_manager.rb @@ -252,7 +252,7 @@ def finalize_registration(host) host.subscription_facet.save! host.refresh_statuses([ ::Katello::ErrataStatus, - ::Katello::RhelLifecycleStatus + ::Katello::RhelLifecycleStatus, ]) end diff --git a/app/services/katello/repository_type.rb b/app/services/katello/repository_type.rb index 86beaefb757..96ac463a332 100644 --- a/app/services/katello/repository_type.rb +++ b/app/services/katello/repository_type.rb @@ -123,7 +123,7 @@ def as_json(_options = {}) :generic_remote_options => translated_generic_remote_options, :import_attributes => translated_import_attributes, :url_description => _(@url_description), - :content_types => content_types.as_json + :content_types => content_types.as_json, } end @@ -170,7 +170,7 @@ def as_json(_options = {}) generic: false, removable: removable, uploadable: uploadable, - indexed: index + indexed: index, } end @@ -220,7 +220,7 @@ def as_json(_options = {}) :generic => true, :pluralized_label => content_type.pluralize, :pluralized_name => pluralized_name, - :details_columns => details_columns + :details_columns => details_columns, } ) end diff --git a/app/services/katello/ui_notifications/subscriptions/expire_soon.rb b/app/services/katello/ui_notifications/subscriptions/expire_soon.rb index eb6efa23cdb..08bf108c48e 100644 --- a/app/services/katello/ui_notifications/subscriptions/expire_soon.rb +++ b/app/services/katello/ui_notifications/subscriptions/expire_soon.rb @@ -48,9 +48,9 @@ def actions { :href => "/subscriptions?search=expires<\"#{Setting[:expire_soon_days]} days from now\"", :title => _('Subscriptions'), - :external => true - } - ] + :external => true, + }, + ], } end diff --git a/app/services/katello/ui_notifications/subscriptions/manifest_expire_soon_warning.rb b/app/services/katello/ui_notifications/subscriptions/manifest_expire_soon_warning.rb index be2df07304b..d64a5637a53 100644 --- a/app/services/katello/ui_notifications/subscriptions/manifest_expire_soon_warning.rb +++ b/app/services/katello/ui_notifications/subscriptions/manifest_expire_soon_warning.rb @@ -58,9 +58,9 @@ def actions { :href => "/subscriptions", :title => _('Subscriptions'), - :external => false - } - ] + :external => false, + }, + ], } end diff --git a/app/services/katello/ui_notifications/task_notification.rb b/app/services/katello/ui_notifications/task_notification.rb index 2fc57ec5c54..4e6c207ff99 100644 --- a/app/services/katello/ui_notifications/task_notification.rb +++ b/app/services/katello/ui_notifications/task_notification.rb @@ -16,8 +16,8 @@ def actions :links => [ { :path_method => :foreman_tasks_task_path, - :title => _('Task detail') - } + :title => _('Task detail'), + }, ] ).actions end diff --git a/app/services/katello/upstream_connection_checker.rb b/app/services/katello/upstream_connection_checker.rb index 25314cbd364..2bd132e0701 100644 --- a/app/services/katello/upstream_connection_checker.rb +++ b/app/services/katello/upstream_connection_checker.rb @@ -5,7 +5,7 @@ class UpstreamConnectionChecker Katello::Errors::ManifestExpired, Katello::Errors::UpstreamConsumerGone, Katello::Errors::UpstreamConsumerNotFound, - Katello::Errors::NoManifestImported + Katello::Errors::NoManifestImported, ].freeze def initialize(organization) diff --git a/app/views/katello/api/v2/activation_keys/base.json.rabl b/app/views/katello/api/v2/activation_keys/base.json.rabl index 76d837f2e1d..e5b3681a118 100644 --- a/app/views/katello/api/v2/activation_keys/base.json.rabl +++ b/app/views/katello/api/v2/activation_keys/base.json.rabl @@ -17,14 +17,14 @@ child :content_view_environments => :content_view_environments do content_view_version_id: cve.content_view_version&.id, content_view_version_latest: cve.content_view_version&.latest?, content_view_default: cve.content_view&.default?, - content_view_environment_id: cve.id + content_view_environment_id: cve.id, } end node :lifecycle_environment do |cve| { id: cve.lifecycle_environment&.id, name: cve.lifecycle_environment&.name, - lifecycle_environment_library: cve.lifecycle_environment&.library? + lifecycle_environment_library: cve.lifecycle_environment&.library?, } end node :label do |cve| @@ -59,7 +59,7 @@ node :permissions do |activation_key| { :view_activation_keys => activation_key.readable?, :edit_activation_keys => activation_key.editable?, - :destroy_activation_keys => activation_key.deletable? + :destroy_activation_keys => activation_key.deletable?, } end diff --git a/app/views/katello/api/v2/alternate_content_sources/base.json.rabl b/app/views/katello/api/v2/alternate_content_sources/base.json.rabl index 541d96c5958..30341158d61 100644 --- a/app/views/katello/api/v2/alternate_content_sources/base.json.rabl +++ b/app/views/katello/api/v2/alternate_content_sources/base.json.rabl @@ -33,7 +33,7 @@ if ::Foreman::Cast.to_bool(params.fetch(:include_permissions, false)) { :view_alternate_content_sources => alternate_content_source.readable?, :edit_alternate_content_sources => alternate_content_source.editable?, - :destroy_alternate_content_sources => alternate_content_source.deletable? + :destroy_alternate_content_sources => alternate_content_source.deletable?, } end end diff --git a/app/views/katello/api/v2/capsule_content/sync_status.json.rabl b/app/views/katello/api/v2/capsule_content/sync_status.json.rabl index 9fac6a9e472..298ad550f7d 100644 --- a/app/views/katello/api/v2/capsule_content/sync_status.json.rabl +++ b/app/views/katello/api/v2/capsule_content/sync_status.json.rabl @@ -45,7 +45,7 @@ child @lifecycle_environments => :lifecycle_environments do :id => last_env_sync_task&.id, :started_at => last_env_sync_task&.started_at, :result => last_env_sync_task&.result, - :last_sync_words => last_env_sync_task.try(:started_at) ? time_ago_in_words(Time.parse(last_env_sync_task.started_at.to_s)) : nil + :last_sync_words => last_env_sync_task.try(:started_at) ? time_ago_in_words(Time.parse(last_env_sync_task.started_at.to_s)) : nil, } attributes end @@ -53,7 +53,7 @@ child @lifecycle_environments => :lifecycle_environments do if @capsule.has_feature?(SmartProxy::PULP_NODE_FEATURE) || @capsule.has_feature?(SmartProxy::PULP3_FEATURE) node :counts do |env| { - :content_views => env.content_views.non_default.count + :content_views => env.content_views.non_default.count, } end @@ -71,7 +71,7 @@ child @lifecycle_environments => :lifecycle_environments do :default => content_view.default, :up_to_date => @capsule.repos_pending_sync(env, content_view).empty?, :counts => { - :repositories => ::Katello::ContentViewVersion.in_environment(env).find_by(:content_view => content_view)&.archived_repos&.count + :repositories => ::Katello::ContentViewVersion.in_environment(env).find_by(:content_view => content_view)&.archived_repos&.count, }, :repositories => ::Katello::ContentViewVersion.in_environment(env)&.find_by(:content_view => content_view)&.archived_repos&.map do |repo| { @@ -79,9 +79,9 @@ child @lifecycle_environments => :lifecycle_environments do :name => repo.name, :library_id => repo.library_instance_id, :product_id => repo.product_id, - :content_type => repo.content_type + :content_type => repo.content_type, } - end + end, } attributes end diff --git a/app/views/katello/api/v2/common/_metadata.json.rabl b/app/views/katello/api/v2/common/_metadata.json.rabl index 7338672a4ae..7ab20f48714 100644 --- a/app/views/katello/api/v2/common/_metadata.json.rabl +++ b/app/views/katello/api/v2/common/_metadata.json.rabl @@ -10,6 +10,6 @@ node(:search) { params[:search] } node(:sort) do { :by => params[:sort_by], - :order => params[:sort_order] + :order => params[:sort_order], } end diff --git a/app/views/katello/api/v2/content_credentials/show.json.rabl b/app/views/katello/api/v2/content_credentials/show.json.rabl index 518e182b175..06a94786a34 100644 --- a/app/views/katello/api/v2/content_credentials/show.json.rabl +++ b/app/views/katello/api/v2/content_credentials/show.json.rabl @@ -116,6 +116,6 @@ node :permissions do |content_credential| { :view_content_credenials => content_credential.readable?, :edit_content_credenials => content_credential.editable?, - :destroy_content_credenials => content_credential.deletable? + :destroy_content_credenials => content_credential.deletable?, } end diff --git a/app/views/katello/api/v2/content_facet/base.json.rabl b/app/views/katello/api/v2/content_facet/base.json.rabl index 7a3616f805a..cc7cb976f66 100644 --- a/app/views/katello/api/v2/content_facet/base.json.rabl +++ b/app/views/katello/api/v2/content_facet/base.json.rabl @@ -17,14 +17,14 @@ child :content_view_environments => :content_view_environments do content_view_version: cve.content_view_version&.version, content_view_version_id: cve.content_view_version&.id, content_view_version_latest: cve.content_view_version&.latest?, - content_view_default: cve.content_view&.default? + content_view_default: cve.content_view&.default?, } end node :lifecycle_environment do |cve| { id: cve.lifecycle_environment&.id, name: cve.lifecycle_environment&.name, - lifecycle_environment_library: cve.lifecycle_environment&.library? + lifecycle_environment_library: cve.lifecycle_environment&.library?, } end node :label do |cve| @@ -45,7 +45,7 @@ node :content_view do |content_facet| { :id => content_view.id, :name => content_view.name, - :composite => content_view.composite? + :composite => content_view.composite?, } end end @@ -55,7 +55,7 @@ node :lifecycle_environment do |content_facet| if lifecycle_environment.present? { :id => lifecycle_environment.id, - :name => lifecycle_environment.name + :name => lifecycle_environment.name, } end end diff --git a/app/views/katello/api/v2/content_facet/show.json.rabl b/app/views/katello/api/v2/content_facet/show.json.rabl index 29cfe0b79cd..5d8cf3235b8 100644 --- a/app/views/katello/api/v2/content_facet/show.json.rabl +++ b/app/views/katello/api/v2/content_facet/show.json.rabl @@ -8,7 +8,7 @@ child :content_facet => :content_facet_attributes do { :content_view_version => version.version, :content_view_version_id => version.id, - :content_view_version_latest => version.latest? + :content_view_version_latest => version.latest?, } end end diff --git a/app/views/katello/api/v2/content_view_filter_rules/show.json.rabl b/app/views/katello/api/v2/content_view_filter_rules/show.json.rabl index 9738df6ade0..38c1b04a2b1 100644 --- a/app/views/katello/api/v2/content_view_filter_rules/show.json.rabl +++ b/app/views/katello/api/v2/content_view_filter_rules/show.json.rabl @@ -20,7 +20,7 @@ if @resource&.try(:module_stream) { :module_stream_id => rule.module_stream.id, :module_stream_name => rule.module_stream.name, - :module_stream_stream => rule.module_stream.stream + :module_stream_stream => rule.module_stream.stream, } end end diff --git a/app/views/katello/api/v2/content_view_filters/show.json.rabl b/app/views/katello/api/v2/content_view_filters/show.json.rabl index 03385509b87..39e918fbb1e 100644 --- a/app/views/katello/api/v2/content_view_filters/show.json.rabl +++ b/app/views/katello/api/v2/content_view_filters/show.json.rabl @@ -20,7 +20,7 @@ child :content_view => :content_view do :package => repo.rpms.count, :package_group => repo.package_groups.count, :erratum => repo.errata.count, - :module_stream => repo.module_streams.count + :module_stream => repo.module_streams.count, } end end diff --git a/app/views/katello/api/v2/content_view_versions/base.json.rabl b/app/views/katello/api/v2/content_view_versions/base.json.rabl index 4f8e2d58055..6d57054a5eb 100644 --- a/app/views/katello/api/v2/content_view_versions/base.json.rabl +++ b/app/views/katello/api/v2/content_view_versions/base.json.rabl @@ -42,7 +42,7 @@ end node :permissions do |cvv| { - :deletable => cvv.removable? + :deletable => cvv.removable?, } end @@ -61,7 +61,7 @@ child :environments => :environments do :readable => env.readable?, :promotable_or_removable => env.promotable_or_removable?, :all_hosts_editable => version.all_hosts_editable?(env), - :all_keys_editable => Katello::ActivationKey.all_editable?(version.content_view_id, env.id) + :all_keys_editable => Katello::ActivationKey.all_editable?(version.content_view_id, env.id), } end diff --git a/app/views/katello/api/v2/content_views/base.json.rabl b/app/views/katello/api/v2/content_views/base.json.rabl index c670b0d799f..21548d18200 100644 --- a/app/views/katello/api/v2/content_views/base.json.rabl +++ b/app/views/katello/api/v2/content_views/base.json.rabl @@ -47,7 +47,7 @@ node :environments do |cv| name: env.name, activation_keys: cv&.activation_keys&.in_environments([env])&.ids, hosts: cv&.hosts&.in_environments([env])&.ids, - permissions: {readable: env.readable?} + permissions: {readable: env.readable?}, } end end @@ -82,7 +82,7 @@ if params.key?(:include_permissions) :edit_content_views => cv.editable?, :destroy_content_views => cv.deletable?, :publish_content_views => cv.publishable?, - :promote_or_remove_content_views => cv.promotable_or_removable? + :promote_or_remove_content_views => cv.promotable_or_removable?, } end end diff --git a/app/views/katello/api/v2/content_views/show.json.rabl b/app/views/katello/api/v2/content_views/show.json.rabl index c9e71b716d6..eabf7f429a0 100644 --- a/app/views/katello/api/v2/content_views/show.json.rabl +++ b/app/views/katello/api/v2/content_views/show.json.rabl @@ -16,7 +16,7 @@ child :duplicate_repositories_to_publish => :duplicate_repositories_to_publish d @resource.components_with_repo(repo).map do |component| { :content_view_name => component.content_view.name, - :content_view_version => component.version + :content_view_version => component.version, } end end diff --git a/app/views/katello/api/v2/docker_tags/_base.json.rabl b/app/views/katello/api/v2/docker_tags/_base.json.rabl index 54addad05e3..423283e7548 100644 --- a/app/views/katello/api/v2/docker_tags/_base.json.rabl +++ b/app/views/katello/api/v2/docker_tags/_base.json.rabl @@ -24,7 +24,7 @@ if @organization attributes = { :id => repo.id, :name => repo.name, - :full_path => repo.full_path + :full_path => repo.full_path, } attributes end @@ -34,7 +34,7 @@ if @organization product = first_repo&.product attributes = { :id => product&.id, - :name => product&.name + :name => product&.name, } attributes end diff --git a/app/views/katello/api/v2/environments/show.json.rabl b/app/views/katello/api/v2/environments/show.json.rabl index acd02d22eef..de31a0583c8 100644 --- a/app/views/katello/api/v2/environments/show.json.rabl +++ b/app/views/katello/api/v2/environments/show.json.rabl @@ -11,7 +11,7 @@ if @content_source.present? { :name => @content_source.name, :id => @content_source_id, - :environment_is_associated => env.content_source_associated?(@content_source) + :environment_is_associated => env.content_source_associated?(@content_source), } end end @@ -31,7 +31,7 @@ end node :counts do |env| counts = { :content_hosts => env.hosts.authorized("view_hosts").count, - :content_views => env.content_views.non_default.count + :content_views => env.content_views.non_default.count, } if env.library? repos = env.repositories.in_default_view @@ -54,7 +54,7 @@ node :permissions do |env| :view_lifecycle_environments => env.readable?, :edit_lifecycle_environments => env.editable?, :destroy_lifecycle_environments => env.deletable?, - :promote_or_remove_content_views_to_environments => env.promotable_or_removable? + :promote_or_remove_content_views_to_environments => env.promotable_or_removable?, } end @@ -62,7 +62,7 @@ node :content_views do |env| env.content_views.non_default.map do |cv| { :name => cv.name, - :id => cv.id + :id => cv.id, } end end diff --git a/app/views/katello/api/v2/gpg_keys/show.json.rabl b/app/views/katello/api/v2/gpg_keys/show.json.rabl index b4fc9819696..9f525f1c35d 100644 --- a/app/views/katello/api/v2/gpg_keys/show.json.rabl +++ b/app/views/katello/api/v2/gpg_keys/show.json.rabl @@ -32,6 +32,6 @@ node :permissions do |gpg_key| { :view_gpg_keys => gpg_key.readable?, :edit_gpg_keys => gpg_key.editable?, - :destroy_gpg_keys => gpg_key.deletable? + :destroy_gpg_keys => gpg_key.deletable?, } end diff --git a/app/views/katello/api/v2/host_collections/base.json.rabl b/app/views/katello/api/v2/host_collections/base.json.rabl index 8405ace125b..36c8875da72 100644 --- a/app/views/katello/api/v2/host_collections/base.json.rabl +++ b/app/views/katello/api/v2/host_collections/base.json.rabl @@ -9,7 +9,7 @@ extends "katello/api/v2/common/timestamps" node :permissions do |host_collection| { :deletable => host_collection.deletable?, - :editable => host_collection.editable? + :editable => host_collection.editable?, } end diff --git a/app/views/katello/api/v2/hosts/base.json.rabl b/app/views/katello/api/v2/hosts/base.json.rabl index 1469b89a69f..4bdf894928d 100644 --- a/app/views/katello/api/v2/hosts/base.json.rabl +++ b/app/views/katello/api/v2/hosts/base.json.rabl @@ -20,7 +20,7 @@ if @facet { :id => content_view.id, :name => content_view.name, - :composite => content_view.composite? + :composite => content_view.composite?, } end end @@ -29,7 +29,7 @@ if @facet if lifecycle_environment.present? { :id => lifecycle_environment.id, - :name => lifecycle_environment.name + :name => lifecycle_environment.name, } end end diff --git a/app/views/katello/api/v2/package_groups/base.json.rabl b/app/views/katello/api/v2/package_groups/base.json.rabl index cc55bfe4ce2..73a107e6493 100644 --- a/app/views/katello/api/v2/package_groups/base.json.rabl +++ b/app/views/katello/api/v2/package_groups/base.json.rabl @@ -13,8 +13,8 @@ node :repository do |package_group| :name => repo.name, :product => { :id => repo.product.id, - :name => repo.product.name - } + :name => repo.product.name, + }, } end end diff --git a/app/views/katello/api/v2/products/show.json.rabl b/app/views/katello/api/v2/products/show.json.rabl index 0b9f2139999..ae0b51ce264 100644 --- a/app/views/katello/api/v2/products/show.json.rabl +++ b/app/views/katello/api/v2/products/show.json.rabl @@ -54,7 +54,7 @@ node :sync_status do |product| :display_size => local_sync_status[:display_size], :size => local_sync_status[:size], :is_running => local_sync_status[:is_running], - :error_details => local_sync_status[:error_details] + :error_details => local_sync_status[:error_details], } end @@ -63,7 +63,7 @@ node :permissions do |product| :view_products => product.readable?, :edit_products => product.editable?, :destroy_products => product.deletable?, - :sync_products => product.syncable? + :sync_products => product.syncable?, } end diff --git a/app/views/katello/api/v2/repositories/show.json.rabl b/app/views/katello/api/v2/repositories/show.json.rabl index 4d7ac98e0d4..db511cb571f 100644 --- a/app/views/katello/api/v2/repositories/show.json.rabl +++ b/app/views/katello/api/v2/repositories/show.json.rabl @@ -71,7 +71,7 @@ end node :permissions do |repo| { :deletable => repo.deletable?, - :deletable_across_cv => Setting[:delete_repo_across_cv] + :deletable_across_cv => Setting[:delete_repo_across_cv], } end diff --git a/app/views/katello/api/v2/repository_sets/show.json.rabl b/app/views/katello/api/v2/repository_sets/show.json.rabl index 7b044d813be..320a4eaffce 100644 --- a/app/views/katello/api/v2/repository_sets/show.json.rabl +++ b/app/views/katello/api/v2/repository_sets/show.json.rabl @@ -11,7 +11,7 @@ glue :content do vendor: content.vendor, type: content.content_type, gpgUrl: content.gpg_url, - contentUrl: content.content_url + contentUrl: content.content_url, } end diff --git a/app/views/katello/api/v2/subscriptions/base.json.rabl b/app/views/katello/api/v2/subscriptions/base.json.rabl index 0725b1ce503..6ddbe99089a 100644 --- a/app/views/katello/api/v2/subscriptions/base.json.rabl +++ b/app/views/katello/api/v2/subscriptions/base.json.rabl @@ -23,6 +23,6 @@ attributes :upstream_pool_id node :hypervisor, :if => lambda { |sub| sub && sub.respond_to?(:hypervisor) && sub.hypervisor } do |subscription| { id: subscription.hypervisor.id, - name: subscription.hypervisor.name + name: subscription.hypervisor.name, } end diff --git a/app/views/katello/api/v2/subscriptions/show.json.rabl b/app/views/katello/api/v2/subscriptions/show.json.rabl index 18bd06688f5..f3a63f44ed4 100644 --- a/app/views/katello/api/v2/subscriptions/show.json.rabl +++ b/app/views/katello/api/v2/subscriptions/show.json.rabl @@ -27,12 +27,12 @@ node :activation_keys do |subscription| service_level: key.service_level, environment: { id: key.environment.try(:id), - name: key.environment.try(:name) + name: key.environment.try(:name), }, content_view: { id: key.content_view.try(:id), - name: key.content_view.try(:name) - } + name: key.content_view.try(:name), + }, } end end diff --git a/app/views/katello/api/v2/sync_plans/show.json.rabl b/app/views/katello/api/v2/sync_plans/show.json.rabl index 20f49f86835..afec921f3e7 100644 --- a/app/views/katello/api/v2/sync_plans/show.json.rabl +++ b/app/views/katello/api/v2/sync_plans/show.json.rabl @@ -25,6 +25,6 @@ node :permissions do |sync_plan| { :view_sync_plans => sync_plan.readable?, :edit_sync_plans => sync_plan.editable?, - :destroy_sync_plans => sync_plan.deletable? + :destroy_sync_plans => sync_plan.deletable?, } end diff --git a/db/migrate/20160808002834_add_files.rb b/db/migrate/20160808002834_add_files.rb index a08845a3dff..dac2e4e0f83 100644 --- a/db/migrate/20160808002834_add_files.rb +++ b/db/migrate/20160808002834_add_files.rb @@ -12,7 +12,7 @@ def change add_index :katello_files, [ :id, :uuid, - :name + :name, ], :name => 'katello_files_fields_index' diff --git a/db/migrate/20161014133811_move_content_view_version_description_to_histories.rb b/db/migrate/20161014133811_move_content_view_version_description_to_histories.rb index 72977203a0d..a333fcd4f46 100644 --- a/db/migrate/20161014133811_move_content_view_version_description_to_histories.rb +++ b/db/migrate/20161014133811_move_content_view_version_description_to_histories.rb @@ -15,7 +15,7 @@ class CVHistory < ApplicationRecord publish: 1, promotion: 2, removal: 3, - export: 4 + export: 4, } end diff --git a/db/migrate/20200818192230_update_system_purpose_status.rb b/db/migrate/20200818192230_update_system_purpose_status.rb index 54871b3565b..66e6b78361a 100644 --- a/db/migrate/20200818192230_update_system_purpose_status.rb +++ b/db/migrate/20200818192230_update_system_purpose_status.rb @@ -5,7 +5,7 @@ def change "Katello::PurposeAddonsStatus", "Katello::PurposeRoleStatus", "Katello::PurposeSlaStatus", - "Katello::PurposeUsageStatus" + "Katello::PurposeUsageStatus", ] # load both sets of host statuses and *then* update them to make sure we update the correct statuses diff --git a/db/migrate/20201012172713_remove_gpg_key_perms.rb b/db/migrate/20201012172713_remove_gpg_key_perms.rb index bad0d4bc5a5..2e207767df4 100644 --- a/db/migrate/20201012172713_remove_gpg_key_perms.rb +++ b/db/migrate/20201012172713_remove_gpg_key_perms.rb @@ -4,7 +4,7 @@ def permission_map Permission.find_by(name: :view_gpg_keys) => Permission.find_by(name: :view_content_credentials), Permission.find_by(name: :edit_gpg_keys) => Permission.find_by(name: :edit_content_credentials), Permission.find_by(name: :destroy_gpg_keys) => Permission.find_by(name: :destroy_content_credentials), - Permission.find_by(name: :create_gpg_keys) => Permission.find_by(name: :create_content_credentials) + Permission.find_by(name: :create_gpg_keys) => Permission.find_by(name: :create_content_credentials), } end diff --git a/db/migrate/20211220185935_clean_duplicate_content_units.rb b/db/migrate/20211220185935_clean_duplicate_content_units.rb index a8c9a79813a..67f291c5cea 100644 --- a/db/migrate/20211220185935_clean_duplicate_content_units.rb +++ b/db/migrate/20211220185935_clean_duplicate_content_units.rb @@ -86,14 +86,14 @@ def up handle_duplicate(Katello::DockerManifestList, 'docker_manifest_list_id', [:pulp_id], associated_models: { Katello::DockerManifestListManifest => :docker_manifest_id, - Katello::RepositoryDockerManifestList => :repository_id + Katello::RepositoryDockerManifestList => :repository_id, }) add_index :katello_docker_manifest_lists, :pulp_id, :unique => true handle_duplicate(Katello::DockerManifest, 'docker_manifest_id', [:pulp_id], associated_models: { Katello::DockerManifestListManifest => :docker_manifest_list_id, - Katello::RepositoryDockerManifest => :repository_id + Katello::RepositoryDockerManifest => :repository_id, }) add_index :katello_docker_manifests, :pulp_id, :unique => true end diff --git a/db/migrate/20230717150442_change_change_content_source_job_template_name.rb b/db/migrate/20230717150442_change_change_content_source_job_template_name.rb index 15ca688f21d..5af3d310002 100644 --- a/db/migrate/20230717150442_change_change_content_source_job_template_name.rb +++ b/db/migrate/20230717150442_change_change_content_source_job_template_name.rb @@ -1,6 +1,6 @@ class ChangeChangeContentSourceJobTemplateName < ActiveRecord::Migration[6.1] TEMPLATE_NAMES = { - "Change content source" => "Configure host for new content source" + "Change content source" => "Configure host for new content source", }.freeze def up diff --git a/db/migrate/20240207191223_remove_entitlement_mode_host_statuses.rb b/db/migrate/20240207191223_remove_entitlement_mode_host_statuses.rb index 016dd7fdfd8..03aa66d81d9 100644 --- a/db/migrate/20240207191223_remove_entitlement_mode_host_statuses.rb +++ b/db/migrate/20240207191223_remove_entitlement_mode_host_statuses.rb @@ -11,7 +11,7 @@ def up "Katello::PurposeAddonsStatus", "Katello::PurposeRoleStatus", "Katello::PurposeSlaStatus", - "Katello::PurposeUsageStatus" + "Katello::PurposeUsageStatus", ] ::HostStatus::Status.where(type: obsolete_statuses).delete_all diff --git a/db/seeds.d/106-mail_notifications.rb b/db/seeds.d/106-mail_notifications.rb index 95c3300dbfd..819c7c12f05 100644 --- a/db/seeds.d/106-mail_notifications.rb +++ b/db/seeds.d/106-mail_notifications.rb @@ -20,21 +20,21 @@ :description => N_('A summary of available and applicable errata for your hosts'), :mailer => 'Katello::ErrataMailer', :method => 'host_errata', - :subscription_type => 'report' + :subscription_type => 'report', }, {:name => :sync_errata, :description => N_('A summary of new errata after a repository is synchronized'), :mailer => 'Katello::ErrataMailer', :method => 'sync_errata', - :subscription_type => 'alert' + :subscription_type => 'alert', }, {:name => :promote_errata, :description => N_('A post-promotion summary of hosts with installable errata'), :mailer => 'Katello::ErrataMailer', :method => 'promote_errata', - :subscription_type => 'alert' + :subscription_type => 'alert', }, {:name => :subscriptions_expiring_soon, @@ -42,36 +42,36 @@ :mailer => 'Katello::SubscriptionMailer', :method => 'subscription_expiry', :subscription_type => 'report', - :queryable => true + :queryable => true, }, {:name => :repository_sync_failure, :description => N_('A notification about failed repository sync'), :mailer => 'Katello::TaskMailer', :method => 'repo_sync_failure', - :subscription_type => 'alert' + :subscription_type => 'alert', }, {:name => :content_view_publish_failure, :description => N_('A notification about failed content view publish'), :mailer => 'Katello::TaskMailer', :method => 'cv_publish_failure', - :subscription_type => 'alert' + :subscription_type => 'alert', }, {:name => :content_view_promote_failure, :description => N_('A notification about failed content view promotion'), :mailer => 'Katello::TaskMailer', :method => 'cv_promote_failure', - :subscription_type => 'alert' + :subscription_type => 'alert', }, {:name => :proxy_sync_failure, :description => N_('A notification about failed proxy sync'), :mailer => 'Katello::TaskMailer', :method => 'proxy_sync_failure', - :subscription_type => 'alert' - } + :subscription_type => 'alert', + }, ] notifications.each do |notification| diff --git a/db/seeds.d/108-subcription-bookmarks.rb b/db/seeds.d/108-subcription-bookmarks.rb index f05467193b5..a4b417c22c2 100644 --- a/db/seeds.d/108-subcription-bookmarks.rb +++ b/db/seeds.d/108-subcription-bookmarks.rb @@ -9,7 +9,7 @@ bookmarks = [ {:name => "list hypervisors", :query => 'hypervisor = true', :controller => "hosts"}, {:name => "future", :query => 'starts > Today', :controller => "katello_subscriptions"}, - {:name => "expiring soon", :query => 'expires 30 days from now', :controller => "katello_subscriptions"} + {:name => "expiring soon", :query => 'expires 30 days from now', :controller => "katello_subscriptions"}, ] bookmarks.each do |input| diff --git a/db/seeds.d/109-katello-notification-blueprints.rb b/db/seeds.d/109-katello-notification-blueprints.rb index d8a0f6c7dc4..bea2c8e6534 100644 --- a/db/seeds.d/109-katello-notification-blueprints.rb +++ b/db/seeds.d/109-katello-notification-blueprints.rb @@ -3,7 +3,7 @@ group: N_('Hosts'), name: 'host_lifecycle_expire_soon', message: N_('%{release}: %{number_of_hosts} hosts are approaching end of %{lifecycle} on %{end_date}. Please upgrade them before support expires. Check Report Host - Statuses for detail.'), - level: 'warning' + level: 'warning', }, { group: N_('Proxies'), @@ -15,87 +15,87 @@ links: [ path_method: :smart_proxy_path, - title: N_('Details') - ] - } + title: N_('Details'), + ], + }, }, { group: N_('Subscriptions'), name: 'subs_expire_soon', message: N_('%{expiring_subs} subscriptions in %{subject} are going to expire in less than %{days} days. Please renew them before they expire to guarantee your hosts will continue receiving content.'), - level: 'warning' + level: 'warning', }, { group: N_('Subscriptions'), name: 'manifest_expire_soon_warning', message: N_('Manifest in organization %{subject} has an identity certificate that will expire in %{days_remaining} days, on %{manifest_expire_date}. To extend the expiration date, please refresh your manifest.'), - level: 'info' + level: 'info', }, { group: N_('Subscriptions'), name: 'manifest_expired_warning', message: N_('The manifest imported within Organization %{subject} is no longer valid. Please import a new manifest.'), - level: 'warning' + level: 'warning', }, { group: N_('Subscriptions'), name: 'manifest_import_success', message: N_('Manifest in \'%{subject}\' imported.'), - level: 'info' + level: 'info', }, { group: N_('Subscriptions'), name: 'manifest_import_error', message: N_('Importing manifest into \'%{subject}\' failed.'), - level: 'error' + level: 'error', }, { group: N_('Subscriptions'), name: 'manifest_refresh_success', message: N_('Manifest in \'%{subject}\' refreshed.'), - level: 'info' + level: 'info', }, { group: N_('Subscriptions'), name: 'manifest_refresh_error', message: N_('Manifest in \'%{subject}\' failed to refresh.'), - level: 'error' + level: 'error', }, { group: N_('Subscriptions'), name: 'manifest_delete_success', message: N_('Manifest in \'%{subject}\' deleted.'), - level: 'info' + level: 'info', }, { group: N_('Subscriptions'), name: 'manifest_delete_error', message: N_('Deleting manifest in \'%{subject}\' failed.'), - level: 'error' + level: 'error', }, { group: N_('Subscriptions'), name: 'sca_enable_success', message: N_('Simple Content Access has been enabled for \'%{subject}\'.'), - level: 'info' + level: 'info', }, { group: N_('Subscriptions'), name: 'sca_enable_error', message: N_('Enabling Simple Content Access failed for \'%{subject}\'.'), - level: 'error' + level: 'error', }, { group: N_('Subscriptions'), name: 'sca_disable_success', message: N_('Simple Content Access has been disabled for \'%{subject}\'.'), - level: 'info' + level: 'info', }, { group: N_('Subscriptions'), name: 'sca_disable_error', message: N_('Disabling Simple Content Access failed for \'%{subject}\'.'), - level: 'error' + level: 'error', }, { group: N_('System Status'), @@ -105,10 +105,10 @@ actions: { links: [ path_method: :about_index_path, - title: N_('About page') - ] - } - } + title: N_('About page'), + ], + }, + }, ] blueprints.each { |blueprint| UINotifications::Seed.new(blueprint).configure } diff --git a/db/seeds.d/110-content-view-autopublish.rb b/db/seeds.d/110-content-view-autopublish.rb index c9971643a01..656a7485f0b 100644 --- a/db/seeds.d/110-content-view-autopublish.rb +++ b/db/seeds.d/110-content-view-autopublish.rb @@ -9,8 +9,8 @@ { links: [ - ] - } + ], + }, }, { group: N_('Content View'), @@ -21,8 +21,8 @@ { links: [ - ] - } + ], + }, - } + }, ].each { |blueprint| UINotifications::Seed.new(blueprint).configure } diff --git a/db/seeds.d/111-container-image-bookmarks.rb b/db/seeds.d/111-container-image-bookmarks.rb index 9aad542a7b3..429ed89e833 100644 --- a/db/seeds.d/111-container-image-bookmarks.rb +++ b/db/seeds.d/111-container-image-bookmarks.rb @@ -7,7 +7,7 @@ User.as_anonymous_admin do Bookmark.without_auditing do bookmarks = [ - {:name => "Without a Tag", :query => 'not has tag', :controller => "katello_docker_manifests"} + {:name => "Without a Tag", :query => 'not has tag', :controller => "katello_docker_manifests"}, ] bookmarks.each do |input| diff --git a/db/seeds.d/111-upgrade_tasks.rb b/db/seeds.d/111-upgrade_tasks.rb index 96d56a36580..26f90aadda9 100644 --- a/db/seeds.d/111-upgrade_tasks.rb +++ b/db/seeds.d/111-upgrade_tasks.rb @@ -10,6 +10,6 @@ {:name => 'katello:upgrades:4.4:publish_import_cvvs'}, {:name => 'katello:upgrades:4.8:fix_incorrect_providers'}, {:name => 'katello:upgrades:4.8:regenerate_imported_repository_metadata'}, - {:name => 'katello:upgrades:4.12:update_content_access_modes'} + {:name => 'katello:upgrades:4.12:update_content_access_modes'}, ] end diff --git a/engines/bastion/lib/bastion.rb b/engines/bastion/lib/bastion.rb index 3143199d693..7cd20e2e3c3 100644 --- a/engines/bastion/lib/bastion.rb +++ b/engines/bastion/lib/bastion.rb @@ -20,7 +20,7 @@ def self.config url_root = ENV['RAILS_RELATIVE_URL_ROOT'] base_config = { 'markTranslated' => SETTINGS[:mark_translated] || false, - 'relativeUrlRoot' => url_root ? url_root + '/' : '/' + 'relativeUrlRoot' => url_root ? url_root + '/' : '/', } Bastion.plugins.each do |_name, plugin| diff --git a/engines/bastion/lib/bastion/engine.rb b/engines/bastion/lib/bastion/engine.rb index eafeefd6f9c..1fb278cc2b5 100644 --- a/engines/bastion/lib/bastion/engine.rb +++ b/engines/bastion/lib/bastion/engine.rb @@ -23,7 +23,7 @@ class Engine < ::Rails::Engine SETTINGS[:bastion][:assets][:precompile] = [ 'bastion/bastion.css', - 'bastion/bastion.js' + 'bastion/bastion.js', ] locale_files = Dir.glob("#{Bastion::Engine.root}/vendor/assets/javascripts/#{Bastion.localization_path("*")}") diff --git a/engines/bastion_katello/lib/bastion_katello/engine.rb b/engines/bastion_katello/lib/bastion_katello/engine.rb index bfc779aa8f5..24f492f6387 100644 --- a/engines/bastion_katello/lib/bastion_katello/engine.rb +++ b/engines/bastion_katello/lib/bastion_katello/engine.rb @@ -35,7 +35,7 @@ class Engine < ::Rails::Engine { 'consumerCertRPM' => consumer_cert_rpm, 'defaultDownloadPolicy' => !Foreman.in_rake? && db_migrated && Setting['default_download_policy'], 'remoteExecutionPresent' => true, - 'hostToolingEnabled' => true + 'hostToolingEnabled' => true, } end ) diff --git a/gemfile.d/test.rb b/gemfile.d/test.rb index a4e052f4d5e..17801f1960e 100644 --- a/gemfile.d/test.rb +++ b/gemfile.d/test.rb @@ -1,4 +1,3 @@ group :test do gem "vcr", "~> 6.1" - gem 'theforeman-rubocop', '~> 0.0.6', require: false end diff --git a/katello.gemspec b/katello.gemspec index b51e844a1c7..0fb3433050b 100644 --- a/katello.gemspec +++ b/katello.gemspec @@ -64,4 +64,6 @@ Gem::Specification.new do |gem| # UI gem.add_dependency "deface", '>= 1.0.2', '< 2.0.0' gem.add_dependency "angular-rails-templates", "~> 1.1.0" + + gem.add_development_dependency "theforeman-rubocop", '~> 0.1.0' end diff --git a/lib/katello/engine.rb b/lib/katello/engine.rb index ee6014140f1..0dc0ed8e668 100644 --- a/lib/katello/engine.rb +++ b/lib/katello/engine.rb @@ -33,29 +33,29 @@ class Engine < ::Rails::Engine :consumer_cert_rpm => 'katello-ca-consumer-latest.noarch.rpm', :consumer_cert_sh => 'katello-rhsm-consumer', :event_daemon => { - enabled: true + enabled: true, }, :pulp => { :default_login => 'admin', :skip_checksum_validation => false, :upload_chunk_size => 1_048_575, # upload size in bytes to pulp. see SSLRenegBufferSize in apache :sync_threads => 4, - :sync_KBlimit => nil + :sync_KBlimit => nil, }, :candlepin => { :url => 'https://localhost:8443/candlepin', :oauth_key => 'katello', :oauth_secret => 'katello', :ca_cert_file => nil, - :bulk_load_size => 1000 + :bulk_load_size => 1000, }, :candlepin_events => { :broker_host => 'localhost', :broker_port => 61_613, :queue_name => 'katello.candlepin', :subscription_name => 'candlepin_events', - :client_id => 'katello_candlepin_event_monitor' - } + :client_id => 'katello_candlepin_event_monitor', + }, } SETTINGS[:katello] = default_settings.deep_merge(SETTINGS[:katello] || {}) diff --git a/lib/katello/permission_creator.rb b/lib/katello/permission_creator.rb index 2f85677dc2a..5e2cfed33a9 100644 --- a/lib/katello/permission_creator.rb +++ b/lib/katello/permission_creator.rb @@ -25,26 +25,26 @@ def activation_keys_permissions 'katello/activation_keys' => [:all, :index], 'katello/api/v2/activation_keys' => [:index, :show, :available_host_collections, :available_releases, :product_content, :auto_complete_search], - 'katello/api/v2/repository_sets' => [:index, :auto_complete_search] + 'katello/api/v2/repository_sets' => [:index, :auto_complete_search], }, :resource_type => 'Katello::ActivationKey', :finder_scope => :readable @plugin.permission :create_activation_keys, { - 'katello/api/v2/activation_keys' => [:create, :copy] + 'katello/api/v2/activation_keys' => [:create, :copy], }, :resource_type => 'Katello::ActivationKey' @plugin.permission :edit_activation_keys, { 'katello/api/v2/activation_keys' => [:update, :content_override, :add_subscriptions, :remove_subscriptions, - :add_host_collections, :remove_host_collections] + :add_host_collections, :remove_host_collections], }, :resource_type => 'Katello::ActivationKey', :finder_scope => :editable @plugin.permission :destroy_activation_keys, { - 'katello/api/v2/activation_keys' => [:destroy] + 'katello/api/v2/activation_keys' => [:destroy], }, :resource_type => 'Katello::ActivationKey', :finder_scope => :deletable @@ -53,22 +53,22 @@ def activation_keys_permissions def capsule_content_permissions @plugin.permission :view_smart_proxies, { - 'katello/api/v2/capsules' => [:index, :show] + 'katello/api/v2/capsules' => [:index, :show], }, :resource_type => "SmartProxy" @plugin.permission :manage_capsule_content, { 'katello/api/v2/capsule_content' => [:add_lifecycle_environment, :remove_lifecycle_environment, :update_counts, :sync, :reclaim_space, :verify_checksum, :cancel_sync], - 'katello/api/v2/capsules' => [:index, :show] + 'katello/api/v2/capsules' => [:index, :show], }, :resource_type => 'SmartProxy' @plugin.permission :view_capsule_content, { 'katello/api/v2/capsule_content' => [:counts, :lifecycle_environments, :available_lifecycle_environments, :sync_status], - 'smart_proxies' => [:pulp_storage, :pulp_status, :show_with_content, :index], - 'katello/api/v2/capsules' => [:index, :show] + 'smart_proxies' => [:pulp_storage, :pulp_status, :show_with_content], + 'katello/api/v2/capsules' => [:index, :show], }, :resource_type => "SmartProxy" end @@ -112,13 +112,13 @@ def content_view_permissions :repo_compare_packages, :view_compare_errata, :view_compare_packages, - :views] + :views], }, :resource_type => 'Katello::ContentView', :finder_scope => :readable @plugin.permission :create_content_views, { - 'katello/api/v2/content_views' => [:create, :copy] + 'katello/api/v2/content_views' => [:create, :copy], }, :resource_type => 'Katello::ContentView' @plugin.permission :edit_content_views, @@ -127,14 +127,14 @@ def content_view_permissions 'katello/api/v2/content_view_versions' => [:update], 'katello/api/v2/content_view_filters' => [:create, :update, :destroy, :remove_filter_rules, :add_filter_rules], 'katello/api/v2/content_view_filter_rules' => [:create, :update, :destroy], - 'katello/api/v2/content_view_components' => [:add_components, :remove_components, :update] + 'katello/api/v2/content_view_components' => [:add_components, :remove_components, :update], }, :resource_type => 'Katello::ContentView', :finder_scope => :editable @plugin.permission :destroy_content_views, { 'katello/api/v2/content_views' => [:destroy, :remove, :bulk_delete_versions], - 'katello/api/v2/content_view_versions' => [:destroy] + 'katello/api/v2/content_view_versions' => [:destroy], }, :resource_type => 'Katello::ContentView', :finder_scope => :deletable @@ -142,14 +142,14 @@ def content_view_permissions { 'katello/api/v2/content_views' => [:publish], 'katello/api/v2/content_view_versions' => [:incremental_update, :republish_repositories, :verify_checksum], - 'katello/api/v2/content_imports' => [:version, :index] + 'katello/api/v2/content_imports' => [:version, :index], }, :resource_type => 'Katello::ContentView', :finder_scope => :publishable @plugin.permission :promote_or_remove_content_views, { 'katello/api/v2/content_view_versions' => [:promote], - 'katello/api/v2/content_views' => [:remove_from_environment, :remove, :republish_repositories, :verify_checksum] + 'katello/api/v2/content_views' => [:remove_from_environment, :remove, :republish_repositories, :verify_checksum], }, :resource_type => 'Katello::ContentView', :finder_scope => :promotable_or_removable @@ -159,27 +159,27 @@ def content_credential_permissions @plugin.permission :view_content_credentials, { 'katello/api/v2/content_credentials' => [:index, :show, :content, :auto_complete_search], - 'katello/api/v2/gpg_keys' => [:index, :show, :content, :auto_complete_search] + 'katello/api/v2/gpg_keys' => [:index, :show, :content, :auto_complete_search], }, :resource_type => 'Katello::ContentCredential', :finder_scope => :readable @plugin.permission :create_content_credentials, { 'katello/api/v2/content_credentials' => [:create], - 'katello/api/v2/gpg_keys' => [:create] + 'katello/api/v2/gpg_keys' => [:create], }, :resource_type => 'Katello::ContentCredential' @plugin.permission :edit_content_credentials, { 'katello/api/v2/content_credentials' => [:update, :set_content], - 'katello/api/v2/gpg_keys' => [:update, :set_content] + 'katello/api/v2/gpg_keys' => [:update, :set_content], }, :resource_type => 'Katello::ContentCredential', :finder_scope => :editable @plugin.permission :destroy_content_credentials, { 'katello/api/v2/content_credentials' => [:destroy], - 'katello/api/v2/gpg_keys' => [:destroy] + 'katello/api/v2/gpg_keys' => [:destroy], }, :resource_type => 'Katello::ContentCredential', :finder_scope => :deletable @@ -188,25 +188,25 @@ def content_credential_permissions def host_collections_permissions @plugin.permission :view_host_collections, { - 'katello/api/v2/host_collections' => [:index, :show, :auto_complete_search] + 'katello/api/v2/host_collections' => [:index, :show, :auto_complete_search], }, :resource_type => 'Katello::HostCollection', :finder_scope => :readable @plugin.permission :create_host_collections, { - 'katello/api/v2/host_collections' => [:create, :copy] + 'katello/api/v2/host_collections' => [:create, :copy], }, :resource_type => 'Katello::HostCollection', :finder_scope => :creatable @plugin.permission :edit_host_collections, { - 'katello/api/v2/host_collections' => [:update, :add_hosts, :remove_hosts] + 'katello/api/v2/host_collections' => [:update, :add_hosts, :remove_hosts], }, :resource_type => 'Katello::HostCollection', :finder_scope => :editable @plugin.permission :destroy_host_collections, { - 'katello/api/v2/host_collections' => [:destroy] + 'katello/api/v2/host_collections' => [:destroy], }, :resource_type => 'Katello::HostCollection', :finder_scope => :deletable @@ -217,25 +217,25 @@ def lifecycle_environment_permissions { 'katello/api/v2/environments' => [:index, :show, :paths, :repositories, :auto_complete_search], 'katello/api/rhsm/candlepin_proxies' => [:rhsm_index], - 'katello/api/v2/content_view_environments' => [:index] + 'katello/api/v2/content_view_environments' => [:index], }, :resource_type => 'Katello::KTEnvironment', :finder_scope => :readable @plugin.permission :create_lifecycle_environments, { - 'katello/api/v2/environments' => [:create] + 'katello/api/v2/environments' => [:create], }, :resource_type => 'Katello::KTEnvironment', :finder_scope => :creatable @plugin.permission :edit_lifecycle_environments, { - 'katello/api/v2/environments' => [:update] + 'katello/api/v2/environments' => [:update], }, :resource_type => 'Katello::KTEnvironment', :finder_scope => :editable @plugin.permission :destroy_lifecycle_environments, { - 'katello/api/v2/environments' => [:destroy] + 'katello/api/v2/environments' => [:destroy], }, :resource_type => 'Katello::KTEnvironment', :finder_scope => :deletable @@ -287,13 +287,13 @@ def product_permissions :repo_compare_errata, :repo_compare_packages], 'katello/api/v2/repository_sets' => [:index, :show, :available_repositories, :auto_complete_search], - 'katello/api/v2/host_packages' => [:installed_packages] + 'katello/api/v2/host_packages' => [:installed_packages], }, :resource_type => 'Katello::Product', :finder_scope => :readable @plugin.permission :create_products, { - 'katello/api/v2/products' => [:create] + 'katello/api/v2/products' => [:create], }, :resource_type => 'Katello::Product', :finder_scope => :editable @@ -304,7 +304,7 @@ def product_permissions 'katello/api/v2/products_bulk_actions' => [:update_sync_plans, :update_http_proxy, :verify_checksum_products], 'katello/api/v2/content_uploads' => [:create, :update, :destroy], 'katello/api/v2/organizations' => [:repo_discover, :cancel_repo_discover], - 'katello/api/v2/repository_sets' => [:enable, :disable] + 'katello/api/v2/repository_sets' => [:enable, :disable], }, :resource_type => 'Katello::Product', :finder_scope => :editable @@ -313,7 +313,7 @@ def product_permissions 'katello/api/v2/products' => [:destroy], 'katello/api/v2/repositories' => [:destroy], 'katello/api/v2/products_bulk_actions' => [:destroy_products], - 'katello/api/v2/repositories_bulk_actions' => [:destroy_repositories] + 'katello/api/v2/repositories_bulk_actions' => [:destroy_repositories], }, :resource_type => 'Katello::Product', :finder_scope => :deletable @@ -324,7 +324,7 @@ def product_permissions 'katello/api/v2/products_bulk_actions' => [:sync_products], 'katello/api/v2/repositories_bulk_actions' => [:sync_repositories, :reclaim_space_from_repositories], 'katello/api/v2/sync' => [:index], - 'katello/sync_management' => [:index, :sync_status, :product_status, :sync, :destroy] + 'katello/sync_management' => [:index, :sync_status, :product_status, :sync, :destroy], }, :resource_type => 'Katello::Product', :finder_scope => :syncable @@ -333,33 +333,33 @@ def product_permissions def subscription_permissions @plugin.permission :view_subscriptions, { - 'katello/api/v2/subscriptions' => [:index, :show, :available, :manifest_history, :auto_complete_search] + 'katello/api/v2/subscriptions' => [:index, :show, :available, :manifest_history, :auto_complete_search], }, :resource_type => 'Katello::Subscription' @plugin.permission :attach_subscriptions, { - 'katello/api/v2/subscriptions' => [:create] + 'katello/api/v2/subscriptions' => [:create], }, :resource_type => 'Katello::Subscription' @plugin.permission :unattach_subscriptions, { - 'katello/api/v2/subscriptions' => [:destroy] + 'katello/api/v2/subscriptions' => [:destroy], }, :resource_type => 'Katello::Subscription' @plugin.permission :import_manifest, { - 'katello/api/v2/subscriptions' => [:upload, :refresh_manifest] + 'katello/api/v2/subscriptions' => [:upload, :refresh_manifest], }, :resource_type => 'Katello::Subscription' @plugin.permission :delete_manifest, { - 'katello/api/v2/subscriptions' => [:delete_manifest] + 'katello/api/v2/subscriptions' => [:delete_manifest], }, :resource_type => 'Katello::Subscription' @plugin.permission :manage_subscription_allocations, { 'katello/api/v2/upstream_subscriptions' => [:index, :create, :destroy, :update, :ping, :enable_simple_content_access, :disable_simple_content_access, :simple_content_access_eligible, :simple_content_access_status], - 'katello/api/v2/simple_content_access' => [:enable, :disable, :eligible, :status] + 'katello/api/v2/simple_content_access' => [:enable, :disable, :eligible, :status], }, :resource_type => 'Katello::Subscription' end @@ -367,31 +367,31 @@ def subscription_permissions def sync_plan_permissions @plugin.permission :view_sync_plans, { - 'katello/api/v2/sync_plans' => [:index, :show, :add_products, :remove_products, :available_products, :auto_complete_search] + 'katello/api/v2/sync_plans' => [:index, :show, :add_products, :remove_products, :available_products, :auto_complete_search], }, :resource_type => 'Katello::SyncPlan', :finder_scope => :readable @plugin.permission :create_sync_plans, { - 'katello/api/v2/sync_plans' => [:create] + 'katello/api/v2/sync_plans' => [:create], }, :resource_type => 'Katello::SyncPlan', :finder_scope => :editable @plugin.permission :edit_sync_plans, { - 'katello/api/v2/sync_plans' => [:update] + 'katello/api/v2/sync_plans' => [:update], }, :resource_type => 'Katello::SyncPlan', :finder_scope => :editable @plugin.permission :destroy_sync_plans, { - 'katello/api/v2/sync_plans' => [:destroy] + 'katello/api/v2/sync_plans' => [:destroy], }, :resource_type => 'Katello::SyncPlan', :finder_scope => :deletable @plugin.permission :sync_sync_plans, { - 'katello/api/v2/sync_plans' => [:sync] + 'katello/api/v2/sync_plans' => [:sync], }, :resource_type => 'Katello::SyncPlan', :finder_scope => :syncable @@ -400,27 +400,27 @@ def sync_plan_permissions def alternate_content_source_permissions @plugin.permission :view_alternate_content_sources, { - 'katello/api/v2/alternate_content_sources' => [:index, :show, :auto_complete_search] + 'katello/api/v2/alternate_content_sources' => [:index, :show, :auto_complete_search], }, :resource_type => 'Katello::AlternateContentSource', :finder_scope => :readable @plugin.permission :create_alternate_content_sources, { - 'katello/api/v2/alternate_content_sources' => [:create] + 'katello/api/v2/alternate_content_sources' => [:create], }, :resource_type => 'Katello::AlternateContentSource', :finder_scope => :editable @plugin.permission :edit_alternate_content_sources, { 'katello/api/v2/alternate_content_sources' => [:update, :refresh], - 'katello/api/v2/alternate_content_sources_bulk_actions' => [:refresh_alternate_content_sources, :refresh_all_alternate_content_sources] + 'katello/api/v2/alternate_content_sources_bulk_actions' => [:refresh_alternate_content_sources, :refresh_all_alternate_content_sources], }, :resource_type => 'Katello::AlternateContentSource', :finder_scope => :editable @plugin.permission :destroy_alternate_content_sources, { 'katello/api/v2/alternate_content_sources' => [:destroy], - 'katello/api/v2/alternate_content_sources_bulk_actions' => [:destroy_alternate_content_sources] + 'katello/api/v2/alternate_content_sources_bulk_actions' => [:destroy_alternate_content_sources], }, :resource_type => 'Katello::AlternateContentSource', :finder_scope => :deletable @@ -429,7 +429,7 @@ def alternate_content_source_permissions def user_permissions @plugin.permission :my_organizations, { - 'katello/api/rhsm/candlepin_proxies' => [:list_owners] + 'katello/api/rhsm/candlepin_proxies' => [:list_owners], }, :public => true end @@ -437,7 +437,7 @@ def user_permissions def organization_permissions @plugin.permission :import_content, { - 'katello/api/v2/content_imports' => [:library, :version, :index, :repository] + 'katello/api/v2/content_imports' => [:library, :version, :index, :repository], }, :resource_type => 'Organization' @@ -445,7 +445,7 @@ def organization_permissions { 'katello/api/v2/content_view_versions' => [:export, :repository], 'katello/api/v2/content_exports' => [:library, :version, :index, :repository], - 'katello/api/v2/content_export_incrementals' => [:library, :version, :repository] + 'katello/api/v2/content_export_incrementals' => [:library, :version, :repository], }, :resource_type => 'Organization' end diff --git a/lib/katello/permissions/host_permissions.rb b/lib/katello/permissions/host_permissions.rb index b21a26c07bb..4677cdf23f9 100644 --- a/lib/katello/permissions/host_permissions.rb +++ b/lib/katello/permissions/host_permissions.rb @@ -38,7 +38,7 @@ 'katello/api/rhsm/candlepin_proxies/async_hypervisors_update', 'katello/api/rhsm/candlepin_proxies/hypervisors_heartbeat', 'katello/api/rhsm/candlepin_proxies/upload_tracer_profile', - 'hosts/change_content_source_data' + 'hosts/change_content_source_data', ] Foreman::AccessControl.permission(:view_hosts).actions.concat [ @@ -65,12 +65,12 @@ 'katello/remote_execution/new', 'katello/remote_execution/create', 'katello/api/v2/repository_sets/index', - 'katello/api/v2/repository_sets/auto_complete_search' + 'katello/api/v2/repository_sets/auto_complete_search', ] Foreman::AccessControl.permission(:destroy_hosts).actions.concat [ 'katello/api/v2/host_subscriptions/destroy', - 'katello/api/v2/hosts_bulk_actions/destroy_hosts' + 'katello/api/v2/hosts_bulk_actions/destroy_hosts', ] Foreman::AccessControl.permission(:create_hosts).actions.concat [ @@ -78,5 +78,5 @@ 'katello/api/rhsm/candlepin_proxies/consumer_create', 'katello/api/rhsm/candlepin_proxies/consumer_show', 'katello/api/rhsm/candlepin_proxies/hypervisors_update', - 'katello/api/rhsm/candlepin_proxies/async_hypervisors_update' + 'katello/api/rhsm/candlepin_proxies/async_hypervisors_update', ] diff --git a/lib/katello/permissions/organization_permissions.rb b/lib/katello/permissions/organization_permissions.rb index 601ffa1bb79..1cfcd2b4b1e 100644 --- a/lib/katello/permissions/organization_permissions.rb +++ b/lib/katello/permissions/organization_permissions.rb @@ -6,18 +6,18 @@ 'katello/api/v2/organizations/redhat_provider', 'katello/api/v2/organizations/download_debug_certificate', 'katello/api/v2/organizations/releases', - 'katello/api/v2/tasks/index' + 'katello/api/v2/tasks/index', ] Foreman::AccessControl.permission(:create_organizations).actions.concat [ - 'katello/api/v2/organizations/create' + 'katello/api/v2/organizations/create', ] Foreman::AccessControl.permission(:edit_organizations).actions.concat [ 'katello/api/v2/organizations/update', - 'katello/api/v2/organizations/cdn_configuration' + 'katello/api/v2/organizations/cdn_configuration', ] Foreman::AccessControl.permission(:destroy_organizations).actions.concat [ - 'katello/api/v2/organizations/destroy' + 'katello/api/v2/organizations/destroy', ] diff --git a/lib/katello/permissions/registry_permissions.rb b/lib/katello/permissions/registry_permissions.rb index 0c61837d667..40119b16d31 100644 --- a/lib/katello/permissions/registry_permissions.rb +++ b/lib/katello/permissions/registry_permissions.rb @@ -13,5 +13,5 @@ 'katello/api/registry/registry_proxies/check_blob', 'katello/api/registry/registry_proxies/start_upload_blob', 'katello/api/registry/registry_proxies/upload_blob', - 'katello/api/registry/registry_proxies/finish_upload_blob' + 'katello/api/registry/registry_proxies/finish_upload_blob', ] diff --git a/lib/katello/permissions/roles_permissions.rb b/lib/katello/permissions/roles_permissions.rb index 066c463ddf8..4b0aaaa4891 100644 --- a/lib/katello/permissions/roles_permissions.rb +++ b/lib/katello/permissions/roles_permissions.rb @@ -1,5 +1,5 @@ require 'katello/plugin.rb' Foreman::AccessControl.permission(:edit_roles).actions.concat [ - 'katello/auto_complete_search/auto_complete_search' + 'katello/auto_complete_search/auto_complete_search', ] diff --git a/lib/katello/permissions/user_permissions.rb b/lib/katello/permissions/user_permissions.rb index 774f8ad8d89..5518351ed28 100644 --- a/lib/katello/permissions/user_permissions.rb +++ b/lib/katello/permissions/user_permissions.rb @@ -1,5 +1,5 @@ require 'katello/plugin.rb' Foreman::AccessControl.permission(:my_account).actions << [ - 'katello/api/v2/tasks/show' + 'katello/api/v2/tasks/show', ] diff --git a/lib/katello/plugin.rb b/lib/katello/plugin.rb index ed3dcddba2e..515ef6c17aa 100644 --- a/lib/katello/plugin.rb +++ b/lib/katello/plugin.rb @@ -219,7 +219,7 @@ apipie_ignored_controllers %w(::Api::V2::OrganizationsController) ApipieDSL.configuration.dsl_classes_matchers.concat [ "#{Katello::Engine.root}/app/models/katello/**/*.rb", - "#{Katello::Engine.root}/app/lib/actions/**/*.rb" + "#{Katello::Engine.root}/app/lib/actions/**/*.rb", ] parameter_filter ::Host::Managed, :host_collection_ids => [], @@ -343,7 +343,7 @@ class: 'HttpProxy', scope: 'all', value_method: 'name', - text_method: 'name_and_url' + text_method: 'name_and_url', }] download_policies = proc { hashify_parameters(::Katello::RootRepository::DOWNLOAD_POLICIES) } proxy_download_policies = proc { hashify_parameters(::SmartProxy::DOWNLOAD_POLICIES) } @@ -703,7 +703,7 @@ def katello_template_setting_values(name) tests_to_skip("AccessPermissionsTest" => [ 'foreman_tasks/api/tasks/callback should have a permission that grants access', 'bastion/bastion/index should have a permission that grants access', - 'bastion/bastion/index_ie should have a permission that grants access' + 'bastion/bastion/index_ie should have a permission that grants access', ]) add_controller_action_scope('HostsController', :index) do |base_scope| @@ -779,7 +779,7 @@ def find_katello_assets(args = {}) 'bastion_katello/bastion_katello.css', 'bastion_katello/bastion_katello.js', 'katello/sync_management', - 'katello/common' + 'katello/common', ] precompile.concat(javascripts) diff --git a/lib/katello/repository_types/python.rb b/lib/katello/repository_types/python.rb index 0c68c02464f..afabbe801ca 100644 --- a/lib/katello/repository_types/python.rb +++ b/lib/katello/repository_types/python.rb @@ -43,7 +43,7 @@ model_additional_metadata: lambda { |pulp_unit| { "package_type": pulp_unit["packagetype"], - "sha256": pulp_unit["sha256"] + "sha256": pulp_unit["sha256"], } }, removable: true, diff --git a/lib/katello/scheduled_jobs.rb b/lib/katello/scheduled_jobs.rb index 3b5a8d6331f..ce8d136d4f3 100644 --- a/lib/katello/scheduled_jobs.rb +++ b/lib/katello/scheduled_jobs.rb @@ -5,7 +5,7 @@ CreateHostLifecycleExpireSoonNotifications, CreatePulpDiskSpaceNotifications, SendExpireSoonNotifications, - CreateManifestExpireSoonWarningNotifications + CreateManifestExpireSoonWarningNotifications, ].each do |job_class| job_class.spawn_if_missing(world) end diff --git a/lib/katello/tasks/receptor/extract_orgs.rake b/lib/katello/tasks/receptor/extract_orgs.rake index bdadd84d120..1377ce88eeb 100644 --- a/lib/katello/tasks/receptor/extract_orgs.rake +++ b/lib/katello/tasks/receptor/extract_orgs.rake @@ -13,7 +13,7 @@ namespace :katello do id: org.id, redhat_account_number: org.redhat_account_number, cert: org.owner_details.dig(:upstreamConsumer, :idCert, :cert), - key: org.owner_details.dig(:upstreamConsumer, :idCert, :key) + key: org.owner_details.dig(:upstreamConsumer, :idCert, :key), } end diff --git a/lib/katello/tasks/reimport.rake b/lib/katello/tasks/reimport.rake index 96ff7f484e9..b955ce215eb 100644 --- a/lib/katello/tasks/reimport.rake +++ b/lib/katello/tasks/reimport.rake @@ -18,7 +18,7 @@ namespace :katello do models = [ Katello::Subscription, Katello::Pool, - Katello::Content + Katello::Content, ] models.each do |model| diff --git a/lib/katello/tasks/upgrades/4.1/reupdate_content_import_export_perms.rake b/lib/katello/tasks/upgrades/4.1/reupdate_content_import_export_perms.rake index 342efba9ad9..d2b385a5987 100644 --- a/lib/katello/tasks/upgrades/4.1/reupdate_content_import_export_perms.rake +++ b/lib/katello/tasks/upgrades/4.1/reupdate_content_import_export_perms.rake @@ -27,7 +27,7 @@ namespace :katello do permission_map = { Permission.find_by(name: :export_library_content) => Permission.find_by(name: :export_content), - Permission.find_by(name: :import_library_content) => Permission.find_by(name: :import_content) + Permission.find_by(name: :import_library_content) => Permission.find_by(name: :import_content), } permission_map.each do |old_perm, new_perm| diff --git a/lib/katello/tasks/upgrades/4.3/fix_url_auth.rake b/lib/katello/tasks/upgrades/4.3/fix_url_auth.rake index deeac9712db..e5e7348e89f 100644 --- a/lib/katello/tasks/upgrades/4.3/fix_url_auth.rake +++ b/lib/katello/tasks/upgrades/4.3/fix_url_auth.rake @@ -14,7 +14,7 @@ namespace :katello do repo_params = { upstream_username: user, upstream_password: password, - url: upstream_url + url: upstream_url, } ForemanTasks.sync_task(Actions::Katello::Repository::Update, repo.root, repo_params) end diff --git a/spec/helpers/product_test_data.rb b/spec/helpers/product_test_data.rb index 19bb352bbd9..e76287882ff 100644 --- a/spec/helpers/product_test_data.rb +++ b/spec/helpers/product_test_data.rb @@ -7,7 +7,7 @@ module ProductTestData { 'productId' => 'product_1' }, { 'productId' => 'product_2', 'providedProductIds' => ['p product 1', 'p product 2'] }, { 'productId' => 'product_3', 'providedProductIds' => ['p product 1', 'p product 3'] }, - { 'productId' => 'product_4', 'providedProductIds' => ['p product 4', 'p product 3'] } + { 'productId' => 'product_4', 'providedProductIds' => ['p product 4', 'p product 3'] }, ].freeze PRODUCT_NAME ||= "Load_Balancing".freeze @@ -19,7 +19,7 @@ module ProductTestData :cp_id => 1, :attrs => [], :multiplier => 1, - :organization_id => 1 + :organization_id => 1, }.with_indifferent_access SIMPLE_PRODUCT_WITH_INVALID_NAME ||= HashWithIndifferentAccess.new( @@ -37,23 +37,23 @@ module ProductTestData :multiplier => 1, :attrs => [{ "name" => "version", - "value" => "1.0" + "value" => "1.0", }, { "name" => "variant", - "value" => "ALL" + "value" => "ALL", }, { "name" => "arch", - "value" => "ALL" + "value" => "ALL", }, { "name" => "type", - "value" => "SVC" + "value" => "SVC", }, { "name" => "sockets", - "value" => 2 + "value" => 2, }] ) @@ -80,11 +80,11 @@ module ProductTestData "contentUrl" => "/released-extra/RHEL-5-Server/$releasever/$basearch/os/ClusterStorage/", "gpgUrl" => "/some/gpg/url/", "updated" => "2011-01-04T18:47:47.219+0000", - "created" => "2011-01-04T18:47:47.219+0000" + "created" => "2011-01-04T18:47:47.219+0000", }, "enabled" => true, "flexEntitlement" => 0, - "physicalEntitlement" => 0} + "physicalEntitlement" => 0}, ], :attrs => {'name' => ProductTestData::PRODUCT_NAME} ) @@ -96,7 +96,7 @@ module ProductTestData "href" => "/owners/ACME_Corporation", "id" => "ff808081311ad38001311ad3b5b60001", "key" => "ACME_Corporation_spec", - "displayName" => "ACME_Corporation_spec" + "displayName" => "ACME_Corporation_spec", }, "providedProducts" => [ @@ -105,8 +105,8 @@ module ProductTestData "productName" => "Red Hat Enterprise Linux 6 Server SVC", "productId" => "20", "updated" => "2011-07-11T20=>26=>26.511+0000", - "created" => "2011-07-11T20=>26=>26.511+0000" - } + "created" => "2011-07-11T20=>26=>26.511+0000", + }, ], "endDate" => "2025-05-29T00=>00=>00.000+0000", "startDate" => "2011-07-11T20=>10=>22.519+0000", diff --git a/spec/models/environment_spec.rb b/spec/models/environment_spec.rb index 756a8fca11e..bccbdd8bb11 100644 --- a/spec/models/environment_spec.rb +++ b/spec/models/environment_spec.rb @@ -65,7 +65,7 @@ module Katello :prior => @organization.library) id = env.id env.destroy! - lambda { KTEnvironment.find(id) }.must_raise(ActiveRecord::RecordNotFound) + lambda { KTEnvironment.find(id) }.must_raise(ActiveRecord::RecordNotFound) # rubocop:disable Minitest/GlobalExpectations end end diff --git a/spec/models/provider_spec.rb b/spec/models/provider_spec.rb index e304cae00c6..804f125ec9b 100644 --- a/spec/models/provider_spec.rb +++ b/spec/models/provider_spec.rb @@ -7,7 +7,7 @@ module Katello :name => "some name", :description => "a description", :provider_type => Provider::REDHAT, - :organization => @organization + :organization => @organization, } end @@ -16,7 +16,7 @@ module Katello :name => "some name", :description => "a description", :provider_type => Provider::CUSTOM, - :organization => @organization + :organization => @organization, } end @@ -123,7 +123,7 @@ module Katello @provider = Provider.create(to_create_custom) id = @provider.id @provider.destroy - lambda { Provider.find(id) }.must_raise(ActiveRecord::RecordNotFound) + lambda { Provider.find(id) }.must_raise(ActiveRecord::RecordNotFound) # rubocop:disable Minitest/GlobalExpectations end end diff --git a/spec/models/task_status_spec.rb b/spec/models/task_status_spec.rb index 5083968cc52..2e49b81059c 100644 --- a/spec/models/task_status_spec.rb +++ b/spec/models/task_status_spec.rb @@ -55,10 +55,10 @@ module Katello "version" => "1.26.3", "arch" => "noarch", "epoch" => "0", - "release" => "5"}] - } - } - } + "release" => "5"}], + }, + }, + }, }.with_indifferent_access end @@ -104,10 +104,10 @@ module Katello "version" => "1.26.3", "arch" => "noarch", "epoch" => "0", - "release" => "5"}] - } - } - } + "release" => "5"}], + }, + }, + }, }.with_indifferent_access end @@ -153,10 +153,10 @@ module Katello "version" => "8.8", "arch" => "noarch", "epoch" => "0", - "release" => "1"}] - } - } - } + "release" => "1"}], + }, + }, + }, }.with_indifferent_access end @@ -202,10 +202,10 @@ module Katello "version" => "1.26.3", "arch" => "noarch", "epoch" => "0", - "release" => "5"}] - } - } - } + "release" => "5"}], + }, + }, + }, }.with_indifferent_access end @@ -251,10 +251,10 @@ module Katello "version" => "1.26.3", "arch" => "noarch", "epoch" => "0", - "release" => "5"}] - } - } - } + "release" => "5"}], + }, + }, + }, }.with_indifferent_access end diff --git a/test/actions/katello/activation_key_test.rb b/test/actions/katello/activation_key_test.rb index cfdd9b7c543..2c78ed65185 100644 --- a/test/actions/katello/activation_key_test.rb +++ b/test/actions/katello/activation_key_test.rb @@ -20,7 +20,7 @@ class CreateTest < TestBase :release_version => activation_key.release_version, :purpose_usage => activation_key.purpose_usage, :purpose_role => activation_key.purpose_role, - :purpose_addons => [katello_purpose_addons(:addon).name] + :purpose_addons => [katello_purpose_addons(:addon).name], } end it 'plans' do diff --git a/test/actions/katello/capsule_content_test.rb b/test/actions/katello/capsule_content_test.rb index 7202cab2258..5b825ea17aa 100644 --- a/test/actions/katello/capsule_content_test.rb +++ b/test/actions/katello/capsule_content_test.rb @@ -49,7 +49,7 @@ class SyncTest < TestBase content_view_id: nil, repository_id: repo.id, repository_ids_list: nil, - environment_id: nil + environment_id: nil, } assert_tree_planned_with(tree, ::Actions::Pulp3::Orchestration::Repository::RefreshRepos, options) assert_tree_planned_steps(tree, ::Actions::Pulp3::ContentGuard::Refresh) @@ -89,7 +89,7 @@ class SyncTest < TestBase content_view_id: nil, repository_id: repo.id, repository_ids_list: nil, - environment_id: nil + environment_id: nil, } assert_tree_planned_with(tree, ::Actions::Pulp3::Orchestration::Repository::RefreshRepos, options) assert_tree_planned_steps(tree, ::Actions::Pulp3::ContentGuard::Refresh) @@ -148,7 +148,7 @@ class SyncTest < TestBase content_view_id: nil, repository_id: repo.id, repository_ids_list: nil, - environment_id: nil + environment_id: nil, } assert_tree_planned_with(tree, ::Actions::Pulp3::Orchestration::Repository::RefreshRepos, options) @@ -178,7 +178,7 @@ class SyncTest < TestBase content_view_id: nil, repository_id: repo.id, repository_ids_list: nil, - environment_id: nil + environment_id: nil, } assert_tree_planned_with(tree, ::Actions::Pulp3::Orchestration::Repository::RefreshRepos, options) @@ -193,7 +193,7 @@ class SyncTest < TestBase content_view_id: nil, repository_id: repo.id, repository_ids_list: nil, - environment_id: nil + environment_id: nil, } assert_tree_planned_with(tree, ::Actions::Pulp3::Orchestration::Repository::RefreshRepos, options) @@ -208,7 +208,7 @@ class SyncTest < TestBase content_view_id: nil, repository_id: repo.id, repository_ids_list: nil, - environment_id: nil + environment_id: nil, } assert_tree_planned_with(tree, ::Actions::Pulp3::Orchestration::Repository::RefreshRepos, options) @@ -225,7 +225,7 @@ class SyncTest < TestBase content_view_id: nil, repository_id: nil, repository_ids_list: nil, - environment_id: dev_environment.id + environment_id: dev_environment.id, } assert_tree_planned_with(tree, ::Actions::Pulp3::Orchestration::Repository::RefreshRepos, options) diff --git a/test/actions/katello/cdn_configuration/update_test.rb b/test/actions/katello/cdn_configuration/update_test.rb index 3dcf9e9e2ab..ea390ec69aa 100644 --- a/test/actions/katello/cdn_configuration/update_test.rb +++ b/test/actions/katello/cdn_configuration/update_test.rb @@ -27,7 +27,7 @@ def keypair { cert: cert, key: key, - joined: "#{key.to_pem}#{cert.to_pem}" + joined: "#{key.to_pem}#{cert.to_pem}", } end @@ -40,7 +40,7 @@ def test_plans_katello_cdn # rubocop:disable Metrics/AbcSize password: 'test_password', upstream_organization_label: @organization.label, upstream_content_view_label: @library_view.label, - upstream_lifecycle_environment_label: @library.label + upstream_lifecycle_environment_label: @library.label, } ::Katello::Resources::CDN::KatelloCdn.any_instance.expects(:organization).returns(@organization) ::Katello::Resources::CDN::KatelloCdn.any_instance.expects(:content_view_id).returns(2) @@ -75,7 +75,7 @@ def test_plans_katello_cdn # rubocop:disable Metrics/AbcSize def test_plans_redhat_cdn attrs = { - type: ::Katello::CdnConfiguration::CDN_TYPE + type: ::Katello::CdnConfiguration::CDN_TYPE, } plan_action(@action, @cdn_configuration, attrs) @@ -95,7 +95,7 @@ def test_plans_custom_cdn attrs = { type: ::Katello::CdnConfiguration::CUSTOM_CDN_TYPE, url: 'http://newcdn.example.com', - ssl_ca_credential_id: @credential.id + ssl_ca_credential_id: @credential.id, } plan_action(@action, @cdn_configuration, attrs) @@ -111,7 +111,7 @@ def test_plans_custom_cdn def test_plans_airgapped attrs = { - type: ::Katello::CdnConfiguration::EXPORT_SYNC + type: ::Katello::CdnConfiguration::EXPORT_SYNC, } refute @cdn_configuration.export_sync? refute_nil @cdn_configuration.url diff --git a/test/actions/katello/content_view_test.rb b/test/actions/katello/content_view_test.rb index 124e5f2d915..c299b85ebda 100644 --- a/test/actions/katello/content_view_test.rb +++ b/test/actions/katello/content_view_test.rb @@ -284,7 +284,7 @@ class RemoveTest < TestBase options = {content_view_environments: [cv_env], system_content_view_id: default_content_view.id, - system_environment_id: library.id + system_environment_id: library.id, } action.expects(:action_subject).with(content_view) plan_action(action, content_view, options) @@ -299,7 +299,7 @@ class RemoveTest < TestBase version = cve.content_view_version cve.hosts.each { |h| h.content_facet.destroy } options = {content_view_environments: [cv_env, library_cv_env], - content_view_versions: [version] + content_view_versions: [version], } action.expects(:action_subject).with(content_view) @@ -316,7 +316,7 @@ class RemoveTest < TestBase cve.hosts.each { |h| h.content_facet.destroy } options = {content_view_environments: content_view.content_view_environments, content_view_versions: content_view.versions, - destroy_content_view: true + destroy_content_view: true, } action.expects(:action_subject).with(content_view) @@ -507,10 +507,10 @@ class IncrementalUpdatesTest < TestBase :rpm => ["shark-0.1-1.noarch", "penguin-0.9.1-1.noarch", - "walrus-5.21-1.noarch"] - } - } - }] + "walrus-5.21-1.noarch"], + }, + }, + }], } total_count = action.total_counts(data) assert_equal total_count[:errata_count], 1 diff --git a/test/actions/katello/content_view_version/import_library_test.rb b/test/actions/katello/content_view_version/import_library_test.rb index cffa4559293..22b95a51216 100644 --- a/test/actions/katello/content_view_version/import_library_test.rb +++ b/test/actions/katello/content_view_version/import_library_test.rb @@ -40,7 +40,7 @@ class ImportLibraryTest < ActiveSupport::TestCase let(:import_metadata) do { products: { - prod.label => prod.slice(:name, :label).merge(redhat: prod.redhat?) + prod.label => prod.slice(:name, :label).merge(redhat: prod.redhat?), }, gpg_keys: {}, repositories: { @@ -54,19 +54,19 @@ class ImportLibraryTest < ActiveSupport::TestCase unprotected: false, content_type: 'yum', download_policy: 'immediate', - content: { id: repo.content_id, label: 'misc-24037', url: "/org/cv/dump" } - } + content: { id: repo.content_id, label: 'misc-24037', url: "/org/cv/dump" }, + }, }, content_view_version: { major: '1', - minor: '0' + minor: '0', }, content_view: { name: ::Katello::ContentView::EXPORT_LIBRARY, label: ::Katello::ContentView::EXPORT_LIBRARY, description: 'great', - generated_for: :library_export - } + generated_for: :library_export, + }, }.with_indifferent_access end diff --git a/test/actions/katello/content_view_version/import_repository_test.rb b/test/actions/katello/content_view_version/import_repository_test.rb index 411001dabb0..0a28d4959e8 100644 --- a/test/actions/katello/content_view_version/import_repository_test.rb +++ b/test/actions/katello/content_view_version/import_repository_test.rb @@ -34,26 +34,26 @@ class ImportLibraryTest < ActiveSupport::TestCase { products: { - prod.label => prod.slice(:name, :label).merge(redhat: prod.redhat?) + prod.label => prod.slice(:name, :label).merge(redhat: prod.redhat?), }, gpg_keys: {}, repositories: { "misc-24037" => { label: prod.repositories.first.label, product: prod.slice(:label), - redhat: prod.redhat? - } + redhat: prod.redhat?, + }, }, content_view_version: { major: '1', - minor: '0' + minor: '0', }, content_view: { name: "Export-Repository", label: 'Export-Repository', description: 'great', - generated_for: :repository_export + generated_for: :repository_export, }, - destination_server: "wow" + destination_server: "wow", }.with_indifferent_access end diff --git a/test/actions/katello/content_view_version/import_test.rb b/test/actions/katello/content_view_version/import_test.rb index c3e4192ac6f..797586b698a 100644 --- a/test/actions/katello/content_view_version/import_test.rb +++ b/test/actions/katello/content_view_version/import_test.rb @@ -41,21 +41,21 @@ class TestBase < ActiveSupport::TestCase let(:import_metadata) do { products: { - prod.label => prod.slice(:label, :name).merge(redhat: prod.redhat?) + prod.label => prod.slice(:label, :name).merge(redhat: prod.redhat?), }, repositories: { "misc-24037" => { label: prod.repositories.first.label, product: prod.slice(:label), - redhat: prod.redhat? - } + redhat: prod.redhat?, + }, }, gpg_keys: {}, content_view_version: { major: content_view_version.major, minor: content_view_version.minor, - description: description + description: description, }, - content_view: content_view.slice(:label, :name, :description, :generated_for) + content_view: content_view.slice(:label, :name, :description, :generated_for), }.with_indifferent_access end @@ -140,7 +140,7 @@ class ImportTest < TestBase it 'should create the library cv and plan properly' do import_metadata[:content_view] = { name: ::Katello::ContentView::EXPORT_LIBRARY, label: ::Katello::ContentView::EXPORT_LIBRARY, - generated_for: :library_export + generated_for: :library_export, } ::Katello::Pulp3::ContentViewVersion::Import.any_instance.expects(:check!).returns diff --git a/test/actions/katello/flatpak/scan_remote_test.rb b/test/actions/katello/flatpak/scan_remote_test.rb index a53b064beb7..7b37416cedc 100644 --- a/test/actions/katello/flatpak/scan_remote_test.rb +++ b/test/actions/katello/flatpak/scan_remote_test.rb @@ -14,7 +14,7 @@ class ScanRemoteTest < TestScanRemoteBase let(:input) do { remote_id: remote.id, - url: 'https://flatpaks.redhat.io/rhel//index/static?label%3Aorg.flatpak.ref%3Aexists=1&tag=latest' + url: 'https://flatpaks.redhat.io/rhel//index/static?label%3Aorg.flatpak.ref%3Aexists=1&tag=latest', } end diff --git a/test/actions/katello/foreman_test.rb b/test/actions/katello/foreman_test.rb index f37ed489af2..4990033c509 100644 --- a/test/actions/katello/foreman_test.rb +++ b/test/actions/katello/foreman_test.rb @@ -27,7 +27,7 @@ class Actions::Katello::Foreman::ContentUpdateTest < ActiveSupport::TestCase "content_view_id" => content_view.id, "repository_id" => nil, "remote_user" => SETTINGS[:katello][:pulp][:default_login], - "remote_cp_user" => SETTINGS[:katello][:pulp][:default_login] + "remote_cp_user" => SETTINGS[:katello][:pulp][:default_login], } assert_equal expected, action.input diff --git a/test/actions/katello/host/hypervisors_test.rb b/test/actions/katello/host/hypervisors_test.rb index d1d261141b2..4dc0c42cac8 100644 --- a/test/actions/katello/host/hypervisors_test.rb +++ b/test/actions/katello/host/hypervisors_test.rb @@ -12,7 +12,7 @@ class HypervisorsTest < ActiveSupport::TestCase @content_view_environment = katello_content_view_environments(:library_dev_view_library) @hypervisor_params = { 'hypervisor' => ['guest-1', 'guest-2'] } @hypervisor_response = { - 'created' => [{'uuid' => 1, 'name' => 'foo', 'extra' => 'stranger', 'owner' => {'key' => 'org-label'}}] + 'created' => [{'uuid' => 1, 'name' => 'foo', 'extra' => 'stranger', 'owner' => {'key' => 'org-label'}}], } Dynflow::Testing::DummyPlannedAction.any_instance.stubs(:error).returns(nil) end @@ -34,7 +34,7 @@ class HypervisorsTest < ActiveSupport::TestCase json = { 'created' => [{'uuid' => 1, 'name' => 'foo1', 'extra' => 'stranger', 'owner' => owner}], 'updated' => [{'uuid' => 2, 'name' => 'foo2', 'owner' => owner}], - 'unchanged' => [{'uuid' => 3, 'name' => 'foo3', 'owner' => owner}] + 'unchanged' => [{'uuid' => 3, 'name' => 'foo3', 'owner' => owner}], } expected = [{:uuid => 1, :name => 'foo1', :organization_label => 'org-label'}, {:uuid => 2, :name => 'foo2', :organization_label => 'org-label'}, diff --git a/test/actions/katello/host/hypervisors_update_test.rb b/test/actions/katello/host/hypervisors_update_test.rb index 6cde027e89e..3865875e604 100644 --- a/test/actions/katello/host/hypervisors_update_test.rb +++ b/test/actions/katello/host/hypervisors_update_test.rb @@ -30,14 +30,14 @@ def setup @facts = { 'hypervisor.type': 'VMware ESXi', 'cpu.cpu_socket(s)' => '2', - 'hypervisor.version' => '6.7.0' + 'hypervisor.version' => '6.7.0', }.with_indifferent_access @consumer = { uuid: @host.subscription_facet.uuid, guestIds: ['test-id-1'], entitlementCount: 0, facts: @facts, - hypervisorId: {hypervisorId: old_name} + hypervisorId: {hypervisorId: old_name}, }.with_indifferent_access ::Katello::Resources::Candlepin::Consumer.stubs(:get_all_with_facts).returns([@consumer]) end @@ -92,14 +92,14 @@ def test_update_guests_hypervisor def test_hypervisor_duplicate_bios_uuid hypervisor_results = [ {name: "hypervisor1.example.com", uuid: "040d7c29-5075-4173-a8e2-64ebbdef03ca", organization_label: @organization.label}, - {name: "hypervisor2.example.com", uuid: "040d7c29-5075-4173-a8e2-64ebbdef03ca", organization_label: @organization.label} + {name: "hypervisor2.example.com", uuid: "040d7c29-5075-4173-a8e2-64ebbdef03ca", organization_label: @organization.label}, ] consumer = { "uuid" => "040d7c29-5075-4173-a8e2-64ebbdef03ca", "entitlementStatus" => nil, "entitlementCount" => 0, "hypervisorId" => {"hypervisorId" => "hypervisor1.example.com"}, - "type" => {"id" => "1004", "label" => "hypervisor", "manifest" => false} + "type" => {"id" => "1004", "label" => "hypervisor", "manifest" => false}, } Katello::Resources::Candlepin::Consumer.expects(:get_all_with_facts).returns([consumer.with_indifferent_access]) Katello::Resources::Candlepin::Consumer.expects(:virtual_guests).returns({}) diff --git a/test/actions/katello/repository/import_upload_test.rb b/test/actions/katello/repository/import_upload_test.rb index abf2f831cd3..6eb1007fdd9 100644 --- a/test/actions/katello/repository/import_upload_test.rb +++ b/test/actions/katello/repository/import_upload_test.rb @@ -21,7 +21,7 @@ module Actions unit_key: upload.except('id'), upload_id: '1', unit_metadata: nil, - content_type: 'rpm' + content_type: 'rpm', } assert_action_planned_with(action, pulp3_import_class, diff --git a/test/actions/katello/repository/metadata_generate_test.rb b/test/actions/katello/repository/metadata_generate_test.rb index af84de633bf..5438e3bf2fb 100644 --- a/test/actions/katello/repository/metadata_generate_test.rb +++ b/test/actions/katello/repository/metadata_generate_test.rb @@ -15,7 +15,7 @@ module Actions { :source_repository => nil, :matching_content => false, - :force_publication => false + :force_publication => false, } end diff --git a/test/actions/katello/repository_set_test.rb b/test/actions/katello/repository_set_test.rb index 707caf6f92e..386225f5b70 100644 --- a/test/actions/katello/repository_set_test.rb +++ b/test/actions/katello/repository_set_test.rb @@ -112,8 +112,8 @@ class ScanCdnTest < TestBase "pulp_id" => 'foobar', "repository_id" => nil, "enabled" => false, - "promoted" => false - }] + "promoted" => false, + }], } assert_equal expected, action.output diff --git a/test/actions/katello/repository_test.rb b/test/actions/katello/repository_test.rb index b32f19aa610..77f4ac36e9c 100644 --- a/test/actions/katello/repository_test.rb +++ b/test/actions/katello/repository_test.rb @@ -615,7 +615,7 @@ class UploadDockerTest < TestBase unit_metadata: nil, generate_metadata: true, sync_capsule: true, - content_type: 'docker_manifest' + content_type: 'docker_manifest', } assert_action_planned_with(action, ::Actions::Pulp3::Orchestration::Repository::ImportUpload, docker_repository, SmartProxy.pulp_primary, @@ -641,7 +641,7 @@ class UploadDockerTest < TestBase unit_metadata: unit_keys[0], generate_metadata: true, sync_capsule: true, - content_type: 'docker_tag' + content_type: 'docker_tag', } assert_action_planned_with(action, ::Actions::Pulp3::Orchestration::Repository::ImportUpload, docker_repository, SmartProxy.pulp_primary, diff --git a/test/actions/pulp3/orchestration/alternate_content_source_update_test.rb b/test/actions/pulp3/orchestration/alternate_content_source_update_test.rb index f244cce8c35..83157e90aea 100644 --- a/test/actions/pulp3/orchestration/alternate_content_source_update_test.rb +++ b/test/actions/pulp3/orchestration/alternate_content_source_update_test.rb @@ -137,7 +137,7 @@ def test_http_proxy_url_update_simplified_acs proxy_url: "https://bad_url", proxy_username: "bad_username", proxy_password: "bad_password", - total_timeout: 42 + total_timeout: 42, } ) diff --git a/test/controllers/api/registry/registry_proxies_controller_test.rb b/test/controllers/api/registry/registry_proxies_controller_test.rb index 7f34f6d8a88..ae541bf4bc3 100644 --- a/test/controllers/api/registry/registry_proxies_controller_test.rb +++ b/test/controllers/api/registry/registry_proxies_controller_test.rb @@ -306,7 +306,7 @@ def setup_permissions subtotal: 2, page: 1, per_page: per_page, - results: [@docker_repo, @docker_env_repo] + results: [@docker_repo, @docker_env_repo], } @controller.stubs(:scoped_search).returns(scoped_results) get :v1_search, params: { q: "abc", n: 2 } @@ -662,7 +662,7 @@ def setup_permissions "/v2/foo/bar/baz/blobs/uploads?qwertyuiop=asdfghjkl", "/v2/foo/bar/baz/manifests/additional/directories/after/name", "/v2/id/0/0/foo/blobs/uploads", - "/v2/id/867/5309/foo/blobs/uploads?qwertyuiop=asdfghjkl" + "/v2/id/867/5309/foo/blobs/uploads?qwertyuiop=asdfghjkl", ] results = [ {valid_format: true, schema: "label", organization: "foo", product: "bar", name: "baz"}, @@ -671,7 +671,7 @@ def setup_permissions {valid_format: true, schema: "label", organization: "foo", product: "bar", name: "baz"}, {valid_format: true, schema: "label", organization: "foo", product: "bar", name: "baz"}, {valid_format: true, schema: "id", organization: "0", product: "0", name: "foo"}, - {valid_format: true, schema: "id", organization: "867", product: "5309", name: "foo"} + {valid_format: true, schema: "id", organization: "867", product: "5309", name: "foo"}, ] path_strings.each_index do |i| actual_result = @controller.parse_blob_push_props(path_strings[i]) @@ -698,7 +698,7 @@ def setup_permissions "/v2/id/0/0/wrong", "/v2/id/0/0/foo/wrong", "/v2/id/0/0/foo/blobs/", - "/v2/id/0/0/foo/manifests/" + "/v2/id/0/0/foo/manifests/", ] path_strings.each do |path_string| result = @controller.parse_blob_push_props(path_string) @@ -921,7 +921,7 @@ def setup_permissions {valid_format: true, schema: "label", organization: "foo", product: "bar", name: "baz"}, {valid_format: true, schema: "label", organization: "default_organization", product: "test_product", name: "test_name"}, {valid_format: true, schema: "id", organization: "0", product: "0", name: "test_name"}, - {valid_format: true, schema: "id", organization: "867", product: "5309", name: "foo"} + {valid_format: true, schema: "id", organization: "867", product: "5309", name: "foo"}, ] prop_list.each do |props| mock_root_repo = mock('root_repository') diff --git a/test/controllers/api/rhsm/candlepin_proxies_controller_test.rb b/test/controllers/api/rhsm/candlepin_proxies_controller_test.rb index 1f0223d5c2a..6536238aa8c 100644 --- a/test/controllers/api/rhsm/candlepin_proxies_controller_test.rb +++ b/test/controllers/api/rhsm/candlepin_proxies_controller_test.rb @@ -143,18 +143,18 @@ module Katello { "repos" => [ { - "baseurl" => ["https://hostname/pulp/content/foo"] + "baseurl" => ["https://hostname/pulp/content/foo"], }, { - "baseurl" => ["https://hostname/pulp/content/bar"] + "baseurl" => ["https://hostname/pulp/content/bar"], }, { - "baseurl" => ["https://hostname/pulp/content/bar"] + "baseurl" => ["https://hostname/pulp/content/bar"], }, { - "baseurl" => ["https://hostname/pulp/content/baz"] - } - ] + "baseurl" => ["https://hostname/pulp/content/baz"], + }, + ], } end @@ -164,7 +164,7 @@ module Katello "/pulp/content/foo", "/pulp/content/bar", "/pulp/content/bar", - "/pulp/content/baz" + "/pulp/content/baz", ]) put :enabled_repos, params: { :id => @host.subscription_facet.uuid, :enabled_repos => enabled_repos } assert_equal 200, response.status @@ -467,7 +467,7 @@ def test_regenerate_indentity_certificates facts = { "distribution.id" => "Ootpa", "distribution::version" => "8.6", - "distribution::name" => "Red Hat Enterprise Linux" + "distribution::name" => "Red Hat Enterprise Linux", } put :facts, params: { :id => uuid, :facts => facts } assert_response 200 diff --git a/test/controllers/api/v2/activation_keys_controller_test.rb b/test/controllers/api/v2/activation_keys_controller_test.rb index 7014b578ab7..4e8ae0b9595 100644 --- a/test/controllers/api/v2/activation_keys_controller_test.rb +++ b/test/controllers/api/v2/activation_keys_controller_test.rb @@ -156,7 +156,7 @@ def test_create_limited_hosts post :create, params: { :organization_id => @organization.id, - :activation_key => {:name => 'limited Key', :unlimited_hosts => false, :max_hosts => max_hosts} + :activation_key => {:name => 'limited Key', :unlimited_hosts => false, :max_hosts => max_hosts}, } assert_response :success @@ -197,7 +197,7 @@ def test_create_with_description post :create, params: { :organization_id => @organization.id, - :activation_key => {:name => 'new key', :description => key_description} + :activation_key => {:name => 'new key', :description => key_description}, } assert_response :success @@ -220,7 +220,7 @@ def test_create_with_content_view_environments_param post :create, params: { :organization_id => @organization.id, :content_view_environments => content_view_environments, - :activation_key => {:name => 'new key'} + :activation_key => {:name => 'new key'}, } assert_response :success @@ -241,7 +241,7 @@ def test_create_from_angularjs_with_environments_param :organization_id => @organization.id, :environment => {:id => @library.id}, :content_view_id => @acme_view.id, - :activation_key => {:name => 'new key'} + :activation_key => {:name => 'new key'}, } assert_response :success @@ -261,7 +261,7 @@ def test_create_with_content_view_environment_ids_param post :create, params: { :organization_id => @organization.id, :content_view_environment_ids => content_view_environment_ids, - :activation_key => {:name => 'new key'} + :activation_key => {:name => 'new key'}, } assert_response :success @@ -272,7 +272,7 @@ def test_create_with_content_view_environment_ids_param def test_should_not_create_with_no_hosts_limit post :create, params: { :organization_id => @organization.id, - :activation_key => {:name => 'limited Key', :unlimited_hosts => false} + :activation_key => {:name => 'limited Key', :unlimited_hosts => false}, } assert_response :unprocessable_entity assert_match 'Validation failed: Max hosts cannot be nil', @response.body @@ -292,7 +292,7 @@ def test_should_not_create_with_invalid_content_view_environment_ids_param def test_should_not_create_with_invalid_hosts_limit post :create, params: { :organization_id => @organization.id, - :activation_key => {:name => 'limited Key', :unlimited_hosts => false, :max_hosts => 0} + :activation_key => {:name => 'limited Key', :unlimited_hosts => false, :max_hosts => 0}, } assert_response :unprocessable_entity assert_match 'Validation failed: Max hosts cannot be less than one', @response.body @@ -302,7 +302,7 @@ def test_should_not_create_with_invalid_hosts_limit def test_should_not_create_unlimited_and_invalid_max_hosts post :create, params: { :organization_id => @organization.id, - :activation_key => {:name => 'limited Key', :unlimited_hosts => true, :max_hosts => 0} + :activation_key => {:name => 'limited Key', :unlimited_hosts => true, :max_hosts => 0}, } assert_response :error end @@ -334,7 +334,7 @@ def test_should_not_update_with_invalid_max_hosts put :update, params: { :id => @activation_key.id, :organization_id => @organization.id, - :activation_key => { :unlimited_hosts => false, :max_hosts => 0 } + :activation_key => { :unlimited_hosts => false, :max_hosts => 0 }, } assert_response :unprocessable_entity assert_match 'Validation failed: Max hosts cannot be less than one', @response.body @@ -345,7 +345,7 @@ def test_should_not_update_with_invalid_name put :update, params: { :id => @activation_key.id, :organization_id => @organization.id, - :activation_key => { :unlimited_hosts => false, :max_hosts => 0 } + :activation_key => { :unlimited_hosts => false, :max_hosts => 0 }, } assert_response :unprocessable_entity assert_match 'Validation failed: Max hosts cannot be less than one', @response.body @@ -360,7 +360,7 @@ def test_should_not_update_existing_with_invalid_max_hosts put :update, params: { :id => activation_key.id, :organization_id => @organization.id, - :activation_key => { :max_hosts => 'foo' } + :activation_key => { :max_hosts => 'foo' }, } assert_response :unprocessable_entity assert_match 'Validation failed: Max hosts is not a number', @response.body @@ -392,7 +392,7 @@ def test_update_with_cleared_cves put :update, params: { :organization_id => @organization.id, :id => @activation_key.id, - :content_view_environments => [] + :content_view_environments => [], } assert_response :success @@ -410,7 +410,7 @@ def test_update_with_cleared_cve_ids put :update, params: { :organization_id => @organization.id, :id => @activation_key.id, - :content_view_environment_ids => [] + :content_view_environment_ids => [], } assert_response :success @@ -429,7 +429,7 @@ def test_update_with_cleared_cv_lce_ids :organization_id => @organization.id, :id => @activation_key.id, :content_view_id => nil, - :environment_id => nil + :environment_id => nil, } assert_response :success @@ -450,11 +450,11 @@ def test_update_from_angularjs_does_not_clear_cves :content_view_id => nil, :environment_id => nil, :content_view => { - :id => @view.id + :id => @view.id, }, :environment => { - :id => @library.id - } + :id => @library.id, + }, } assert_response :success @@ -471,7 +471,7 @@ def test_update_auto_attach put :update, params: { :id => @activation_key.id, :organization_id => @organization.id, - :activation_key => { :auto_attach => new_auto_attach } + :activation_key => { :auto_attach => new_auto_attach }, } assert_response :success end @@ -570,7 +570,7 @@ def test_content_override_protected assert_protected_action(:content_override, allowed_perms, denied_perms) do put(:content_override, params: { id: @activation_key.id, - content_overrides: [{:content_label => 'fedora', :name => "enabled", :value => true}] + content_overrides: [{:content_label => 'fedora', :name => "enabled", :value => true}], } ) end @@ -579,7 +579,7 @@ def test_content_override_protected def test_bulk_content_override overrides = [{:content_label => 'fedora', :name => "enabled", :value => true}, {:content_label => 'fedora', :value => 0}, - {:content_label => 'fedora', :name => "mirrorlist", :remove => true} + {:content_label => 'fedora', :name => "mirrorlist", :remove => true}, ] expected_content_labels = overrides.map { |o| o[:content_label] } @@ -604,7 +604,7 @@ def test_bulk_content_override_non_existent_content_label_fails overrides = [{:content_label => 'fedora', :name => "enabled", :value => true}, {:content_label => 'fedora', :value => 0}, {:content_label => 'croissant', :name => "mirrorlist", :remove => true}, - {:content_label => 'crepe', :name => "mirrorlist", :remove => true} + {:content_label => 'crepe', :name => "mirrorlist", :remove => true}, ] put(:content_override, params: { :id => @activation_key.id, :content_overrides => overrides }) diff --git a/test/controllers/api/v2/alternate_content_sources_controller_test.rb b/test/controllers/api/v2/alternate_content_sources_controller_test.rb index 9b7f2522044..2923360b8d8 100644 --- a/test/controllers/api/v2/alternate_content_sources_controller_test.rb +++ b/test/controllers/api/v2/alternate_content_sources_controller_test.rb @@ -75,7 +75,7 @@ def test_create verify_ssl: @acs.verify_ssl, use_http_proxies: @acs.use_http_proxies, upstream_username: @acs.upstream_username, - upstream_password: @acs.upstream_password + upstream_password: @acs.upstream_password, } assert_response :success assert_template 'api/v2/common/create' @@ -103,7 +103,7 @@ def test_create_rhui verify_ssl: @acs_rhui.verify_ssl, use_http_proxies: @acs_rhui.use_http_proxies, upstream_username: @acs_rhui.upstream_username, - upstream_password: @acs_rhui.upstream_password + upstream_password: @acs_rhui.upstream_password, } assert_response :success assert_template 'api/v2/common/create' @@ -122,7 +122,7 @@ def test_create_simplified smart_proxy_ids: [@smart_proxy.id], content_type: @acs_simplified.content_type, alternate_content_source_type: @acs_simplified.alternate_content_source_type, - product_ids: [@product.id] + product_ids: [@product.id], } assert_response :success assert_template 'api/v2/common/create' @@ -145,7 +145,7 @@ def test_create_bad_base_url alternate_content_source_type: @acs.alternate_content_source_type, verify_ssl: @acs.verify_ssl, upstream_username: @acs.upstream_username, - upstream_password: @acs.upstream_password + upstream_password: @acs.upstream_password, } assert_response :unprocessable_entity end @@ -167,7 +167,7 @@ def test_create_bad_subpaths alternate_content_source_type: @acs.alternate_content_source_type, verify_ssl: @acs.verify_ssl, upstream_username: @acs.upstream_username, - upstream_password: @acs.upstream_password + upstream_password: @acs.upstream_password, } assert_response :unprocessable_entity end @@ -190,7 +190,7 @@ def test_create_bad_content_type_rhui verify_ssl: @acs_rhui.verify_ssl, use_http_proxies: @acs_rhui.use_http_proxies, upstream_username: @acs_rhui.upstream_username, - upstream_password: @acs_rhui.upstream_password + upstream_password: @acs_rhui.upstream_password, } assert_response :unprocessable_entity end @@ -215,7 +215,7 @@ def test_create_custom_with_simplified_params upstream_password: @acs.upstream_password, # illegal param - product_ids: [@product.id] + product_ids: [@product.id], } assert_response :unprocessable_entity end @@ -231,7 +231,7 @@ def test_create_simplified_with_custom_params product_ids: [@product.id], # illegal param - verify_ssl: @acs.verify_ssl + verify_ssl: @acs.verify_ssl, } assert_response :unprocessable_entity @@ -258,7 +258,7 @@ def test_update verify_ssl: @acs.verify_ssl, use_http_proxies: @acs.use_http_proxies, upstream_username: @acs.upstream_username, - upstream_password: @acs.upstream_password + upstream_password: @acs.upstream_password, } assert_response :success assert_template 'api/v2/alternate_content_sources/show' @@ -281,7 +281,7 @@ def test_update_bad_base_url alternate_content_source_type: @acs.alternate_content_source_type, verify_ssl: @acs.verify_ssl, upstream_username: @acs.upstream_username, - upstream_password: @acs.upstream_password + upstream_password: @acs.upstream_password, } assert_response :unprocessable_entity end @@ -303,7 +303,7 @@ def test_update_bad_subpaths alternate_content_source_type: @acs.alternate_content_source_type, verify_ssl: @acs.verify_ssl, upstream_username: @acs.upstream_username, - upstream_password: @acs.upstream_password + upstream_password: @acs.upstream_password, } assert_response :unprocessable_entity end @@ -313,7 +313,7 @@ def test_update_custom_with_simplified_params id: @acs.id, # illegal param - product_ids: [@product.id] + product_ids: [@product.id], } assert_response :unprocessable_entity end @@ -323,7 +323,7 @@ def test_update_simplified_with_custom_params id: @acs_simplified.id, # illegal param - verify_ssl: @acs.verify_ssl + verify_ssl: @acs.verify_ssl, } assert_response :unprocessable_entity end diff --git a/test/controllers/api/v2/bookmark_controller_test.rb b/test/controllers/api/v2/bookmark_controller_test.rb index 4b8e7473536..34f7009fb5d 100644 --- a/test/controllers/api/v2/bookmark_controller_test.rb +++ b/test/controllers/api/v2/bookmark_controller_test.rb @@ -9,7 +9,7 @@ def setup :public => false, :controller => "katello_host_collections", :name => "new-katello-controller-bookmark", - :query => "name = my_collection" + :query => "name = my_collection", } end diff --git a/test/controllers/api/v2/concerns/authorization_test.rb b/test/controllers/api/v2/concerns/authorization_test.rb index cbfc00d8dd4..595a4f199e8 100644 --- a/test/controllers/api/v2/concerns/authorization_test.rb +++ b/test/controllers/api/v2/concerns/authorization_test.rb @@ -96,16 +96,16 @@ def setup foo2: 3, foo3: { baz: [@repo.id], - baz2: 9 - } - } + baz2: 9, + }, + }, } @filtered_associations = { foo: ::Katello::ContentView, foo3: { - baz: ::Katello::Repository - } + baz: ::Katello::Repository, + }, } end diff --git a/test/controllers/api/v2/concerns/bulk_hosts_extensions_test.rb b/test/controllers/api/v2/concerns/bulk_hosts_extensions_test.rb index cb79248d15b..e23fe7730c9 100644 --- a/test/controllers/api/v2/concerns/bulk_hosts_extensions_test.rb +++ b/test/controllers/api/v2/concerns/bulk_hosts_extensions_test.rb @@ -41,7 +41,7 @@ def test_select_all_hosts_for_errata_apply_bastion @controller.instance_variable_set( :@params, { - :install_all => true + :install_all => true, }) result = @controller.find_bulk_hosts(@edit, {}) diff --git a/test/controllers/api/v2/content_export_incrementals_controller_test.rb b/test/controllers/api/v2/content_export_incrementals_controller_test.rb index 6157bf71194..bad14b9b08d 100644 --- a/test/controllers/api/v2/content_export_incrementals_controller_test.rb +++ b/test/controllers/api/v2/content_export_incrementals_controller_test.rb @@ -65,7 +65,7 @@ def test_version_recent_history export_task.returns(build_task_stub) post :version, params: { id: @library_view_version.id, destination_server: destination, - chunk_size_gb: chunk_size_gb + chunk_size_gb: chunk_size_gb, } assert_response :success end @@ -90,7 +90,7 @@ def test_version_recent_history_with_history_id post :version, params: { id: @library_view_version.id, destination_server: destination, chunk_size_gb: chunk_size_gb, - from_history_id: history[:id] + from_history_id: history[:id], } assert_response :success end @@ -104,7 +104,7 @@ def test_version_not_found_on_incremental .returns post :version, params: { id: @library_view_version.id, - destination_server: destination + destination_server: destination, } response = JSON.parse(@response.body)['displayMessage'] assert_match(%r{No existing export history was found to perform an incremental export}, response) @@ -141,7 +141,7 @@ def test_library post :library, params: { organization_id: org.id, destination_server: destination, chunk_size_gb: chunk_size_gb, - fail_on_missing_content: true + fail_on_missing_content: true, } assert_response :success end @@ -149,7 +149,7 @@ def test_library def test_library_bad_request_on_incremental org = get_organization post :library, params: { organization_id: org.id, - from_latest_increment: true + from_latest_increment: true, } response = JSON.parse(@response.body)['displayMessage'] assert_match(/Unable to incrementally export/, response) diff --git a/test/controllers/api/v2/content_exports_controller_test.rb b/test/controllers/api/v2/content_exports_controller_test.rb index 772d96f4bfc..7bc9b155b0c 100644 --- a/test/controllers/api/v2/content_exports_controller_test.rb +++ b/test/controllers/api/v2/content_exports_controller_test.rb @@ -71,7 +71,7 @@ def test_version post :version, params: { id: @library_view_version.id, destination_server: destination, chunk_size_gb: chunk_size_gb, - fail_on_missing_content: true + fail_on_missing_content: true, } assert_response :success end @@ -91,7 +91,7 @@ def test_library export_task.returns(build_task_stub) post :library, params: { organization_id: org.id, destination_server: destination, - chunk_size_gb: chunk_size_gb + chunk_size_gb: chunk_size_gb, } assert_response :success end diff --git a/test/controllers/api/v2/content_imports_controller_test.rb b/test/controllers/api/v2/content_imports_controller_test.rb index 0daebe0a3d4..4b8492bc447 100644 --- a/test/controllers/api/v2/content_imports_controller_test.rb +++ b/test/controllers/api/v2/content_imports_controller_test.rb @@ -6,7 +6,7 @@ class Api::V2::ContentImportsControllerTest < ActionController::TestCase METADATA = { organization: "org name", products: { - 'label' => { name: 'product name', label: 'label' } + 'label' => { name: 'product name', label: 'label' }, }, gpg_keys: {'foo' => {label: 'lol'} }, repositories: { @@ -14,15 +14,15 @@ class Api::V2::ContentImportsControllerTest < ActionController::TestCase name: 'root repo name', label: 'root_label', product: { label: 'label' }, - redhat: true - } + redhat: true, + }, }, toc: "toc file name", content_view: { name: "cv name", label: 'cv label' }, content_view_version: { major: "4", - minor: "5" - } + minor: "5", + }, }.with_indifferent_access def models diff --git a/test/controllers/api/v2/content_view_environments_controller_test.rb b/test/controllers/api/v2/content_view_environments_controller_test.rb index 1fcff95f8fd..d4d1564be27 100644 --- a/test/controllers/api/v2/content_view_environments_controller_test.rb +++ b/test/controllers/api/v2/content_view_environments_controller_test.rb @@ -39,7 +39,7 @@ def test_index_org assert_response :success assert resp.total > 0 - assert resp.results.all? { |result| result.organization.id == @organization.id } + assert(resp.results.all? { |result| result.organization.id == @organization.id }) assert_template 'api/v2/content_view_environments/index' end @@ -48,7 +48,7 @@ def test_index_in_environment assert_response :success assert resp.total > 0 - assert resp.results.all? { |result| result.lifecycle_environment.id == @staging.id } + assert(resp.results.all? { |result| result.lifecycle_environment.id == @staging.id }) assert_template 'api/v2/content_view_environments/index' end @@ -57,7 +57,7 @@ def test_index_in_content_view assert_response :success assert resp.total > 0 - assert resp.results.all? { |result| result.content_view.id == @library_dev_staging_view.id } + assert(resp.results.all? { |result| result.content_view.id == @library_dev_staging_view.id }) assert_template 'api/v2/content_view_environments/index' end @@ -66,7 +66,7 @@ def test_index_for_activation_key assert_response :success assert resp.total > 0 - assert resp.results.all? { |result| result.activation_keys.map(&:id).include? @library_dev_staging_ak.id } + assert(resp.results.all? { |result| result.activation_keys.map(&:id).include? @library_dev_staging_ak.id }) assert_template 'api/v2/content_view_environments/index' end diff --git a/test/controllers/api/v2/content_view_versions_controller_test.rb b/test/controllers/api/v2/content_view_versions_controller_test.rb index 7f26d0ec424..f291faf1ba9 100644 --- a/test/controllers/api/v2/content_view_versions_controller_test.rb +++ b/test/controllers/api/v2/content_view_versions_controller_test.rb @@ -204,7 +204,7 @@ def test_promote_protected allowed_perms = [[@env_promote_permission, @cv_promote_permission], [@dev_env_promote_permission, @library_dev_staging_view_promote_permission], [@dev_env_promote_permission, @cv_promote_permission], - [@env_promote_permission, @library_dev_staging_view_promote_permission] + [@env_promote_permission, @library_dev_staging_view_promote_permission], ] #ENV['test'] = 'asd' diff --git a/test/controllers/api/v2/content_views_controller_test.rb b/test/controllers/api/v2/content_views_controller_test.rb index 3e7b425f20e..98cc4e1300e 100644 --- a/test/controllers/api/v2/content_views_controller_test.rb +++ b/test/controllers/api/v2/content_views_controller_test.rb @@ -401,10 +401,10 @@ def test_bulk_delete_versions system_environment_id: @library.id, bulk_content_view_version_ids: { included: { - ids: @library_dev_staging_view.versions.map(&:id) - } + ids: @library_dev_staging_view.versions.map(&:id), + }, }, - id: @library_dev_staging_view.id + id: @library_dev_staging_view.id, } assert_response :success @@ -431,7 +431,7 @@ def test_remove_from_environment_protected allowed_perms = [[:promote_or_remove_content_views_to_environments, :promote_or_remove_content_views, dev_env_read_permission], [dev_env_remove_permission, library_dev_staging_view_remove_permission, dev_env_read_permission], [dev_env_remove_permission, :promote_or_remove_content_views, dev_env_read_permission], - [:promote_or_remove_content_views_to_environments, library_dev_staging_view_remove_permission, dev_env_read_permission] + [:promote_or_remove_content_views_to_environments, library_dev_staging_view_remove_permission, dev_env_read_permission], ] denied_perms = [@view_permission, @create_permission, @@ -440,7 +440,7 @@ def test_remove_from_environment_protected :promote_or_remove_content_views_to_environments, :promote_or_remove_content_views, [diff_env_remove_permission, :promote_or_remove_content_views], - [:promote_or_remove_content_views_to_environments, diff_view_remove_permission] + [:promote_or_remove_content_views_to_environments, diff_view_remove_permission], ] assert_protected_action(:remove_from_environment, allowed_perms, denied_perms) do @@ -467,7 +467,7 @@ def test_remove_protected [input_envs_remove_permission, library_dev_staging_view_remove_permission], [input_envs_remove_permission, library_dev_staging_view_remove_permission, library_dev_staging_view_destroy_permission], [input_envs_remove_permission, :promote_or_remove_content_views], - [:promote_or_remove_content_views_to_environments, library_dev_staging_view_remove_permission] + [:promote_or_remove_content_views_to_environments, library_dev_staging_view_remove_permission], ] denied_perms = [@view_permission, @create_permission, @@ -477,7 +477,7 @@ def test_remove_protected :promote_or_remove_content_views, [diff_env_remove_permission, :promote_or_remove_content_views], [single_env_remove_permission, :promote_or_remove_content_views], - [:promote_or_remove_content_views_to_environments, diff_view_remove_permission] + [:promote_or_remove_content_views_to_environments, diff_view_remove_permission], ] env_ids = [@dev.id.to_s, @staging.id.to_s] @@ -504,7 +504,7 @@ def test_remove_protected_with_no_environment_ids @create_permission, @update_permission, diff_view_destroy_permission, - [:promote_or_remove_content_views_to_environments, :promote_or_remove_content_views] + [:promote_or_remove_content_views_to_environments, :promote_or_remove_content_views], ] assert_protected_action(:remove, allowed_perms, denied_perms) do @@ -547,7 +547,7 @@ def test_remove_protected_envs_with_host allowed_perms = [[:edit_hosts, :promote_or_remove_content_views, :view_content_views, :promote_or_remove_content_views_to_environments, :view_lifecycle_environments], [host_edit_permission, host_cv_remove_permission, host_env_remove_permission, - alternate_env_read_permission, alternate_cv_read_permission] + alternate_env_read_permission, alternate_cv_read_permission], ] denied_perms = [[:edit_hosts, :promote_or_remove_content_views, @@ -555,7 +555,7 @@ def test_remove_protected_envs_with_host [host_edit_permission, host_cv_remove_permission, host_env_remove_permission, bad_env_read_permission, alternate_cv_read_permission], [host_edit_permission, host_cv_remove_permission, host_env_remove_permission, - alternate_env_read_permission, bad_cv_read_permission] + alternate_env_read_permission, bad_cv_read_permission], ] env_ids = [environment.id.to_s] with_environments = mock @@ -600,7 +600,7 @@ def test_remove_protected_envs_with_activation_keys allowed_perms = [[:edit_activation_keys, :promote_or_remove_content_views, :view_content_views, :promote_or_remove_content_views_to_environments, :view_lifecycle_environments], [ak_edit_permission, ak_cv_remove_permission, ak_env_remove_permission, - alternate_env_read_permission, alternate_cv_read_permission] + alternate_env_read_permission, alternate_cv_read_permission], ] denied_perms = [[:edit_activation_keys, :promote_or_remove_content_views, @@ -608,7 +608,7 @@ def test_remove_protected_envs_with_activation_keys [ak_edit_permission, ak_cv_remove_permission, ak_env_remove_permission, bad_env_read_permission, alternate_cv_read_permission], [ak_edit_permission, ak_cv_remove_permission, ak_env_remove_permission, - alternate_env_read_permission, bad_cv_read_permission] + alternate_env_read_permission, bad_cv_read_permission], ] assert_protected_action(:remove, allowed_perms, denied_perms) do diff --git a/test/controllers/api/v2/environments_controller_test.rb b/test/controllers/api/v2/environments_controller_test.rb index 320579fffa8..416ba1e043c 100644 --- a/test/controllers/api/v2/environments_controller_test.rb +++ b/test/controllers/api/v2/environments_controller_test.rb @@ -36,7 +36,7 @@ def test_create :name => name, :label => label, :description => description, - :prior => @library.id + :prior => @library.id, } } assert_response :success @@ -56,7 +56,7 @@ def test_create_with_name assert_difference('KTEnvironment.count') do post :create, params: { :organization_id => @organization.id, :environment => { :name => env_name, - :prior => @library.id + :prior => @library.id, } } end assert_response :success @@ -70,7 +70,7 @@ def test_create_with_invalid_name assert_difference('KTEnvironment.count', 0) do post :create, params: { :organization_id => @organization.id, :environment => { :name => '', - :prior => @library.id + :prior => @library.id, } } end assert_response :unprocessable_entity @@ -79,7 +79,7 @@ def test_create_with_invalid_name test_attributes :pid => '55723382-9d98-43c8-85fb-df4702ca7478' def test_update_with_invalid_name put :update, params: { :organization_id => @organization.id, :id => @staging.id, :environment => { - :name => '' + :name => '', } } assert_response :unprocessable_entity end @@ -91,7 +91,7 @@ def test_create_with_pattern :label => 'dev_env', :description => 'This environment is for development.', :prior => @library.id, - :registry_name_pattern => '<%= repository.label %>' + :registry_name_pattern => '<%= repository.label %>', } } assert_response :success @@ -104,7 +104,7 @@ def test_create_with_pattern_spaces :label => 'dev_env', :description => 'This environment is for development.', :prior => @library.id, - :registry_name_pattern => '<%= repository.label %> <%= lifecycle_environment.label %>' + :registry_name_pattern => '<%= repository.label %> <%= lifecycle_environment.label %>', } } assert_response :success @@ -113,7 +113,7 @@ def test_create_with_pattern_spaces def test_create_fail Organization.any_instance.stubs(:save!).returns(@organization) post :create, params: { :organization_id => @organization.id, :environment => { - :description => 'This environment is for development.' + :description => 'This environment is for development.', } } assert_response :bad_request @@ -130,7 +130,7 @@ def test_create_protected :name => 'dev env', :label => 'dev_env', :description => 'This environment is for development.', - :prior => @library.id + :prior => @library.id, } } end end @@ -144,7 +144,7 @@ def test_update :new_name => new_name, :label => 'New Label', :description => new_description, - :registry_unauthenticated_pull => true + :registry_unauthenticated_pull => true, } } assert_response :success @@ -166,7 +166,7 @@ def test_update_pattern_async :environment => { :new_name => 'New Name', :label => 'New Label', - :registry_name_pattern => '<%= repository.label %>' + :registry_name_pattern => '<%= repository.label %>', } } @@ -186,7 +186,7 @@ def test_update_pattern_sync :environment => { :new_name => 'New Name', :label => 'New Label', - :registry_name_pattern => '<%= repository.label %>' + :registry_name_pattern => '<%= repository.label %>', } } @@ -205,7 +205,7 @@ def test_update_pull_async :environment => { :new_name => 'New Name', :label => 'New Label', - :registry_unauthenticated_pull => true + :registry_unauthenticated_pull => true, } } @@ -225,7 +225,7 @@ def test_update_pull_sync :environment => { :new_name => 'New Name', :label => 'New Label', - :registry_unauthenticated_pull => true + :registry_unauthenticated_pull => true, } } @@ -239,7 +239,7 @@ def test_update_pattern_spaces put :update, params: { :organization_id => @organization.id, :id => @staging.id, :environment => { :new_name => 'New Name', :label => 'New Label', - :registry_name_pattern => '<%= repository.label %> <%= organization.label %>' + :registry_name_pattern => '<%= repository.label %> <%= organization.label %>', } } assert_response :success @@ -251,7 +251,7 @@ def test_update_protected assert_protected_action(:update, allowed_perms, denied_perms, [@organization]) do put :update, params: { :organization_id => @organization.id, :id => @staging.id, :environment => { - :new_name => 'New Name' + :new_name => 'New Name', } } end end diff --git a/test/controllers/api/v2/host_errata_controller_test.rb b/test/controllers/api/v2/host_errata_controller_test.rb index ea40ecade92..9895b4bb608 100644 --- a/test/controllers/api/v2/host_errata_controller_test.rb +++ b/test/controllers/api/v2/host_errata_controller_test.rb @@ -41,8 +41,8 @@ def setup def test_search_bulk_errata bulk_params = { :included => { - :search => "errata_id = #{@errata.errata_id}" - } + :search => "errata_id = #{@errata.errata_id}", + }, } result = @controller.find_bulk_errata_ids([@host], bulk_params.to_json) @@ -52,11 +52,11 @@ def test_search_bulk_errata def test_search_bulk_errata_exclude bulk_params = { :included => { - :search => "issued < Yesterday" + :search => "issued < Yesterday", }, :excluded => { - :ids => [@bugfix.errata_id] - } + :ids => [@bugfix.errata_id], + }, } result = @controller.find_bulk_errata_ids([@host], bulk_params.to_json) @@ -67,8 +67,8 @@ def test_search_bulk_errata_exclude def test_search_bulk_errata_ids bulk_params = { :included => { - :ids => [@bugfix.errata_id] - } + :ids => [@bugfix.errata_id], + }, } result = @controller.find_bulk_errata_ids([@host], bulk_params.to_json) @@ -81,9 +81,9 @@ def test_search_bulk_errata_ids_excluded :included => { }, :excluded => { - :ids => [@bugfix.errata_id] + :ids => [@bugfix.errata_id], }, - all: true + all: true, } result = @controller.find_bulk_errata_ids([@host], bulk_params.to_json) @@ -93,7 +93,7 @@ def test_search_bulk_errata_ids_excluded def test_excludes_only_case bulk_params = { - :excluded => {} + :excluded => {}, } exception = assert_raises(HttpErrors::BadRequest) do @controller.find_bulk_errata_ids([@host], bulk_params.to_json) diff --git a/test/controllers/api/v2/host_subscriptions_controller_test.rb b/test/controllers/api/v2/host_subscriptions_controller_test.rb index dae93e3cc0f..0b8a3e5d235 100644 --- a/test/controllers/api/v2/host_subscriptions_controller_test.rb +++ b/test/controllers/api/v2/host_subscriptions_controller_test.rb @@ -142,7 +142,7 @@ def test_create facts = { 'network.hostname' => @host.name} installed_products = [{ 'product_id' => '1', - 'product_name' => 'name' + 'product_name' => 'name', }] expected_consumer_params = { 'type' => 'system', @@ -152,8 +152,8 @@ def test_create 'facts' => facts, 'installedProducts' => [{ 'productId' => '1', - 'productName' => 'name' - }] + 'productName' => 'name', + }], } content_view_environment = ContentViewEnvironment.find(katello_content_view_environments(:library_default_view_environment).id) Resources::Candlepin::Consumer.stubs(:get) @@ -167,7 +167,7 @@ def test_create :installed_products => installed_products, :purpose_role => 'MyRole', :purpose_usage => 'MyUsage', - :purpose_addons => 'Addon1,Addon2' + :purpose_addons => 'Addon1,Addon2', } ) @@ -178,7 +178,7 @@ def test_create_dead_backend facts = { 'network.hostname' => @host.name} installed_products = [{ 'product_id' => '1', - 'product_name' => 'name' + 'product_name' => 'name', }] content_view_environment = ContentViewEnvironment.find(katello_content_view_environments(:library_default_view_environment).id) diff --git a/test/controllers/api/v2/hosts_bulk_actions_controller_test.rb b/test/controllers/api/v2/hosts_bulk_actions_controller_test.rb index 3d33fa35cae..68e402a717e 100644 --- a/test/controllers/api/v2/hosts_bulk_actions_controller_test.rb +++ b/test/controllers/api/v2/hosts_bulk_actions_controller_test.rb @@ -312,7 +312,7 @@ def test_module_streams post :module_streams, params: { included: {:ids => @host_ids}, organization_id: @org.id, - host_collection_ids: [@host_collection1.id, @host_collection2.id] + host_collection_ids: [@host_collection1.id, @host_collection2.id], } assert_response :success @@ -324,7 +324,7 @@ def test_get_host_traces post :traces, params: { organization_id: @org.id, - included: {:ids => @host_ids} + included: {:ids => @host_ids}, } assert_response :success diff --git a/test/controllers/api/v2/hosts_controller_test.rb b/test/controllers/api/v2/hosts_controller_test.rb index 17503cb4bbc..8a0ba302e06 100644 --- a/test/controllers/api/v2/hosts_controller_test.rb +++ b/test/controllers/api/v2/hosts_controller_test.rb @@ -62,8 +62,8 @@ def test_content_facet_attributes_assigned_as_cve :id => host.id, :content_facet_attributes => { :content_view_id => @cv2.id, - :lifecycle_environment_id => @dev.id - } + :lifecycle_environment_id => @dev.id, + }, }, session: set_session_user assert_response :success host.content_facet.reload @@ -88,8 +88,8 @@ def test_host_contents_environments_param put :update, params: { :id => host.id, :content_facet_attributes => { - :content_view_environments => target_cves.map(&:label) - } + :content_view_environments => target_cves.map(&:label), + }, }, session: set_session_user assert_response :success host.content_facet.reload @@ -111,8 +111,8 @@ def test_host_contents_cve_ids_param put :update, params: { :id => host.id, :content_facet_attributes => { - :content_view_environment_ids => target_cves_ids - } + :content_view_environment_ids => target_cves_ids, + }, }, session: set_session_user assert_response :success host.content_facet.reload @@ -128,8 +128,8 @@ def test_host_update_with_env_only put :update, params: { :id => host.id, :content_facet_attributes => { - :lifecycle_environment_id => @dev.id - } + :lifecycle_environment_id => @dev.id, + }, }, session: set_session_user assert_response 422 end @@ -140,8 +140,8 @@ def test_host_update_with_cv_only put :update, params: { :id => host.id, :content_facet_attributes => { - :content_view_id => @cv2.id - } + :content_view_id => @cv2.id, + }, }, session: set_session_user assert_response :unprocessable_entity end @@ -155,8 +155,8 @@ def test_set_content_view_environments_with_valid_content_view_environs_param put :update, params: { :id => host.id, :content_facet_attributes => { - :content_view_environments => ["Library"] - } + :content_view_environments => ["Library"], + }, }, session: set_session_user assert_response :success end @@ -169,8 +169,8 @@ def test_set_content_view_environments_with_valid_ids_param put :update, params: { :id => host.id, :content_facet_attributes => { - :content_view_environment_ids => [@cv4.content_view_environments.first.id] - } + :content_view_environment_ids => [@cv4.content_view_environments.first.id], + }, }, session: set_session_user assert_response :success end @@ -181,8 +181,8 @@ def test_set_content_view_environments_with_invalid_ids_param put :update, params: { :id => host.id, :content_facet_attributes => { - :content_view_environment_ids => ["invalid string"] - } + :content_view_environment_ids => ["invalid string"], + }, }, session: set_session_user assert_response :unprocessable_entity end @@ -193,8 +193,8 @@ def test_set_content_view_environments_with_invalid_content_view_environs_param put :update, params: { :id => host.id, :content_facet_attributes => { - :content_view_environments => ["invalid string"] - } + :content_view_environments => ["invalid string"], + }, }, session: set_session_user assert_response 422 end @@ -207,8 +207,8 @@ def test_host_update_with_invalid_env :id => host.id, :content_facet_attributes => { :content_view_id => @cv2.id, - :lifecycle_environment_id => @dev.id - } + :lifecycle_environment_id => @dev.id, + }, }, session: set_session_user assert_response :error end @@ -259,7 +259,7 @@ def test_create_with_permitted_attributes def test_create_with_unpermitted_attributes cf_attrs = {:content_view_id => @content_view.id, :lifecycle_environment_id => @environment.id, - :uuid => "thisshouldntbeabletobesetbyuser" + :uuid => "thisshouldntbeabletobesetbyuser", } attrs = @host.clone.attributes.merge("name" => "contenthost1.example.com", "content_facet_attributes" => cf_attrs).compact! diff --git a/test/controllers/api/v2/products_controller_test.rb b/test/controllers/api/v2/products_controller_test.rb index 5eb8cb939f1..42940a6b714 100644 --- a/test/controllers/api/v2/products_controller_test.rb +++ b/test/controllers/api/v2/products_controller_test.rb @@ -84,7 +84,7 @@ def test_create product_params = { :name => 'fedora product', :description => 'this is my cool new product.', - :label => 'product_label' + :label => 'product_label', } Api::V2::ProductsController.any_instance.expects(:sync_task).with do |action_class, prod, org| assert_equal action_class, ::Actions::Katello::Product::Create @@ -126,7 +126,7 @@ def test_create_protected def test_create_with_bad_org product_params = { :name => 'fedora product', - :description => 'this is my cool new product.' + :description => 'this is my cool new product.', } post :create, params: { :product => product_params, :organization_id => 'asdfdsafds' } diff --git a/test/controllers/api/v2/repositories_controller_test.rb b/test/controllers/api/v2/repositories_controller_test.rb index 0ac2133bf68..430838cf9f8 100644 --- a/test/controllers/api/v2/repositories_controller_test.rb +++ b/test/controllers/api/v2/repositories_controller_test.rb @@ -317,7 +317,7 @@ def test_create :product_id => @product.id, :description => 'My Description', :url => 'http://www.google.com', - :content_type => 'yum' + :content_type => 'yum', } assert_response 201 assert_template 'api/v2/common/create' diff --git a/test/controllers/api/v2/subscriptions_controller_test.rb b/test/controllers/api/v2/subscriptions_controller_test.rb index c5eb3c4fd5f..a9f8cd0545e 100644 --- a/test/controllers/api/v2/subscriptions_controller_test.rb +++ b/test/controllers/api/v2/subscriptions_controller_test.rb @@ -72,7 +72,7 @@ def test_index_protected def test_include_permissions get :index, params: { organization_id: @organization.id, - include_permissions: true + include_permissions: true, } nodes = JSON.parse(response.body).keys expected_permissions = %w[ diff --git a/test/controllers/api/v2/sync_plans_controller_test.rb b/test/controllers/api/v2/sync_plans_controller_test.rb index 2121eb25fac..cc7f9dbaadf 100644 --- a/test/controllers/api/v2/sync_plans_controller_test.rb +++ b/test/controllers/api/v2/sync_plans_controller_test.rb @@ -62,7 +62,7 @@ def test_create :sync_date => '2014-01-09 17:46:00 +0000', :interval => 'hourly', :description => 'This is my cool new product.', - :enabled => true + :enabled => true, } post :create, params: { :organization_id => @organization.id, :sync_plan => valid_attr } @@ -88,7 +88,7 @@ def test_recurring_logic_create :sync_date => '2014-01-09 17:46:00 +0000', :interval => 'hourly', :description => 'This is my cool new product.', - :enabled => true + :enabled => true, } post :create, params: { :organization_id => @organization.id, :sync_plan => valid_attr } @@ -142,7 +142,7 @@ def test_update :interval => 'weekly', :sync_date => Time.now.utc.strftime(datetime_format), :description => 'New Description', - :enabled => true + :enabled => true, } old_rec_logic = @sync_plan.foreman_tasks_recurring_logic_id put :update, params: { :id => @sync_plan.id, :organization_id => @organization.id, :sync_plan => update_attrs } @@ -159,7 +159,7 @@ def test_update def test_recurring_logic_update_with_sync_date datetime_format = '%Y/%m/%d %H:%M:%S %z' update_attrs = { - :sync_date => Time.now.utc.strftime(datetime_format) + :sync_date => Time.now.utc.strftime(datetime_format), } old_rec_logic = @sync_plan.foreman_tasks_recurring_logic_id put :update, params: { :id => @sync_plan.id, :organization_id => @organization.id, :sync_plan => update_attrs } @@ -172,7 +172,7 @@ def test_recurring_logic_update_with_sync_date def test_recurring_logic_update_with_interval update_attrs = { - :interval => 'weekly' + :interval => 'weekly', } old_rec_logic = @sync_plan.foreman_tasks_recurring_logic_id put :update, params: { :id => @sync_plan.id, :organization_id => @organization.id, :sync_plan => update_attrs } @@ -190,7 +190,7 @@ def test_recurring_logic_update_with_all_params :interval => 'weekly', :sync_date => Time.now.utc.strftime(datetime_format), :description => 'New Description', - :enabled => false + :enabled => false, } old_rec_logic = @sync_plan.foreman_tasks_recurring_logic_id put :update, params: { :id => @sync_plan.id, :organization_id => @organization.id, :sync_plan => update_attrs } diff --git a/test/controllers/foreman/hostgroups_controller_test.rb b/test/controllers/foreman/hostgroups_controller_test.rb index 49732846585..ddbb9efa7cc 100644 --- a/test/controllers/foreman/hostgroups_controller_test.rb +++ b/test/controllers/foreman/hostgroups_controller_test.rb @@ -24,9 +24,9 @@ def test_create :name => "foobar", :content_facet_attributes => { :content_view_id => @library_view.id, - :lifecycle_environment_id => @library.id - } - } + :lifecycle_environment_id => @library.id, + }, + }, } assert_equal 1, ::Hostgroup.unscoped.where(:name => "foobar").count @@ -49,8 +49,8 @@ def test_create_with_ks_repo :content_view_id => repo.content_view.id, :lifecycle_environment_id => repo.environment.id, :content_source_id => smart_proxy.id, - :kickstart_repository_id => repo.id - } + :kickstart_repository_id => repo.id, + }, } diff --git a/test/controllers/foreman/hosts_controller_test.rb b/test/controllers/foreman/hosts_controller_test.rb index 98d5608582b..4d89ec4bcac 100644 --- a/test/controllers/foreman/hosts_controller_test.rb +++ b/test/controllers/foreman/hosts_controller_test.rb @@ -56,8 +56,8 @@ def setup :name => 'test-content', :content_facet_attributes => { :lifecycle_environment_id => "", - :content_source_id => "" - } + :content_source_id => "", + }, } }, session: set_session_user assert_equal_arrays orig_cves, @host.content_facet.content_view_environment_ids end @@ -90,7 +90,7 @@ def test_csv_export 'OS', 'Content View Environments', 'Registered', - 'Last Checkin' + 'Last Checkin', ] assert_equal expected_columns, csv_body.first diff --git a/test/controllers/remote_execution_controller_test.rb b/test/controllers/remote_execution_controller_test.rb index 595c7c727ac..36c48ffbd11 100644 --- a/test/controllers/remote_execution_controller_test.rb +++ b/test/controllers/remote_execution_controller_test.rb @@ -24,8 +24,8 @@ def test_customized_errata_install_shows_new bulk_host_ids = { included: { - ids: [hosts(:one).id] - } + ids: [hosts(:one).id], + }, }.to_json post :create, params: { @@ -39,8 +39,8 @@ def test_customized_errata_install_with_install_all_shows_new bulk_host_ids = { included: { - ids: [hosts(:one).id] - } + ids: [hosts(:one).id], + }, }.to_json post :create, params: { @@ -55,15 +55,15 @@ def test_customized_errata_install_with_errata_id_shows_new bulk_host_ids = { included: { - ids: [hosts(:one).id] - } + ids: [hosts(:one).id], + }, }.to_json bulk_errata_ids = { included: { - ids: [katello_errata(:security).errata_id] - } + ids: [katello_errata(:security).errata_id], + }, }.to_json post :create, params: { diff --git a/test/helpers/hosts_and_hostgroups_helper_test.rb b/test/helpers/hosts_and_hostgroups_helper_test.rb index 10a0e329470..8e57c85fd43 100644 --- a/test/helpers/hosts_and_hostgroups_helper_test.rb +++ b/test/helpers/hosts_and_hostgroups_helper_test.rb @@ -88,7 +88,7 @@ def setup "content_view_id" => @cv.id, "lifecycle_environment_id" => @env.id, "content_source_id" => @content_source.id, - "architecture_id" => @arch.id + "architecture_id" => @arch.id, }}.with_indifferent_access ret = [{:name => "boo" }] ::Operatingsystem.expects(:find).with(@os.id).returns(@os).at_least_once diff --git a/test/lib/access_permissions_test.rb b/test/lib/access_permissions_test.rb index 4eaa1ca9f7d..f7cbeabdd38 100644 --- a/test/lib/access_permissions_test.rb +++ b/test/lib/access_permissions_test.rb @@ -27,7 +27,7 @@ class AccessPermissionsTest < ActiveSupport::TestCase 'katello/api/rhsm/candlepin_proxies/post', 'katello/api/rhsm/candlepin_proxies/get', 'katello/api/rhsm/candlepin_proxies/delete', - 'katello/api/rhsm/candlepin_proxies/serials' + 'katello/api/rhsm/candlepin_proxies/serials', ].freeze KATELLO_NON_AUTH = [ @@ -39,7 +39,7 @@ class AccessPermissionsTest < ActiveSupport::TestCase 'katello/api/v2/katello_ping/index', 'katello/api/v2/katello_ping/server_status', 'katello/api/v2/root/rhsm_resource_list', - 'katello/react/index' + 'katello/react/index', ].freeze check_routes(Katello::Engine.routes, KATELLO_SUB_MAN_AUTH + KATELLO_NON_AUTH) diff --git a/test/lib/concerns/base_template_scope_extensions_test.rb b/test/lib/concerns/base_template_scope_extensions_test.rb index fe609d9a5ff..7072e61f830 100644 --- a/test/lib/concerns/base_template_scope_extensions_test.rb +++ b/test/lib/concerns/base_template_scope_extensions_test.rb @@ -25,7 +25,7 @@ def test_host_redhat_subscriptions_consumed subscriptions = [ stub(redhat?: false, quantity_consumed: 4), stub(redhat?: true, quantity_consumed: 15), - stub(redhat?: true, quantity_consumed: 2) + stub(redhat?: true, quantity_consumed: 2), ] ::Katello::Candlepin::Consumer.any_instance.stubs(:entitlements).returns([]) diff --git a/test/lib/event_daemon/monitor_test.rb b/test/lib/event_daemon/monitor_test.rb index fecfe085a02..68bfaef662a 100644 --- a/test/lib/event_daemon/monitor_test.rb +++ b/test/lib/event_daemon/monitor_test.rb @@ -13,7 +13,7 @@ def self.close def self.status(*) { - running: true + running: true, } end end @@ -58,7 +58,7 @@ def test_check_services_overwrites_initial_status mock_status = { running: true, processed_count: 1, - failed_count: 0 + failed_count: 0, } MockService.stubs(:status).returns(mock_status) Rails.cache.expects(:write).with( diff --git a/test/lib/event_daemon/runner_test.rb b/test/lib/event_daemon/runner_test.rb index 0f2fb80d7b5..c2a284c3f91 100644 --- a/test/lib/event_daemon/runner_test.rb +++ b/test/lib/event_daemon/runner_test.rb @@ -12,7 +12,7 @@ def self.close def self.status(*) { - running: true + running: true, } end end @@ -45,7 +45,7 @@ def test_service_status expected_status = { running: true, processed_count: 1, - failed_count: 0 + failed_count: 0, } Rails.cache.expects(:read).returns(mock_service: expected_status) result = Katello::EventDaemon::Runner.service_status(:mock_service) diff --git a/test/lib/http_resource_test.rb b/test/lib/http_resource_test.rb index 8de8d524a3f..e8e998651d0 100644 --- a/test/lib/http_resource_test.rb +++ b/test/lib/http_resource_test.rb @@ -24,8 +24,8 @@ def test_hash_to_query too: 'tru', arr: [ :arr_one, - :arr_two - ] + :arr_two, + ], } result = TestHttpResource.hash_to_query(params) diff --git a/test/lib/messaging/stomp_connection_test.rb b/test/lib/messaging/stomp_connection_test.rb index e7eb17417d0..f58f129789f 100644 --- a/test/lib/messaging/stomp_connection_test.rb +++ b/test/lib/messaging/stomp_connection_test.rb @@ -12,7 +12,7 @@ def setup @settings = { queue_name: 'my_queue', subscription_name: 'my_subscription', - client_id: 'my_client_id' + client_id: 'my_client_id', } @connection = Katello::Messaging::StompConnection.new(settings: @settings) end @@ -20,7 +20,7 @@ def setup def test_subscribe expected_options = { 'ack' => 'client-individual', - 'durable-subscription-name' => @settings[:subscription_name] + 'durable-subscription-name' => @settings[:subscription_name], } @stomp_client.expects(:subscribe).with(@settings[:queue_name], expected_options) diff --git a/test/lib/repo_discovery_test.rb b/test/lib/repo_discovery_test.rb index 3626558ac58..3c18ebeb5dd 100644 --- a/test/lib/repo_discovery_test.rb +++ b/test/lib/repo_discovery_test.rb @@ -34,7 +34,7 @@ def test_run_http_with_proxy host: "mytest.com", port: 443, user: nil, - password: nil + password: nil, } Spidr.expects(:site).with(base_url, proxy: expected_proxy_params).returns @@ -59,7 +59,7 @@ def test_docker_with_v1_search_no_proxy found = [] to_follow = [base_url] upstream_credentials_and_search = { - search: 'busybox' + search: 'busybox', } RestClient::Request.expects(:execute) @@ -78,7 +78,7 @@ def test_docker_with_v1_search_with_proxy found = [] to_follow = [base_url] upstream_credentials_and_search = { - search: 'busybox' + search: 'busybox', } RestClient::Request.expects(:execute) @@ -103,7 +103,7 @@ def test_docker_with_v2_search_with_proxy found = [] to_follow = [base_url] upstream_credentials_and_search = { - search: 'busybox' + search: 'busybox', } RestClient::Request.expects(:execute) diff --git a/test/lib/resources/candlepin_test.rb b/test/lib/resources/candlepin_test.rb index 7d4614da0d9..b24021f6282 100644 --- a/test/lib/resources/candlepin_test.rb +++ b/test/lib/resources/candlepin_test.rb @@ -63,7 +63,7 @@ def test_create_unlimited_subsciption 'accountNumber' => '', 'productId' => product_id, 'providedProducts' => [], - 'contractNumber' => '' + 'contractNumber' => '', } ::Katello::Resources::Candlepin::Pool.expects(:create).with(owner.label, expected_pool).returns('{}') diff --git a/test/lib/resources/cdn_test.rb b/test/lib/resources/cdn_test.rb index 29c486573fa..3276983c6cd 100644 --- a/test/lib/resources/cdn_test.rb +++ b/test/lib/resources/cdn_test.rb @@ -19,7 +19,7 @@ def test_custom_cdn_auth type: ::Katello::CdnConfiguration::CUSTOM_CDN_TYPE, url: 'http://newcdn.example.com', ssl_ca_credential_id: credential.id, - custom_cdn_auth_enabled: true + custom_cdn_auth_enabled: true, } organization.cdn_configuration.update(attrs) product.expects(:certificate).once.returns('') diff --git a/test/lib/resources/katello_cdn_test.rb b/test/lib/resources/katello_cdn_test.rb index 23a5a6d1ee0..150e73e83f4 100644 --- a/test/lib/resources/katello_cdn_test.rb +++ b/test/lib/resources/katello_cdn_test.rb @@ -10,7 +10,7 @@ def test_katello_cdn_repository_url_with_arch katello_cdn = ::Katello::Resources::CDN::KatelloCdn.new('https://test.com', { organization_label: 'test', content_view_label: 'test', - lifecycle_environment_label: 'test' + lifecycle_environment_label: 'test', }) ::Katello::Resources::CDN::KatelloCdn.any_instance.expects(:organization).returns(@organization) @@ -26,7 +26,7 @@ def test_katello_cdn_repository_url_with_version katello_cdn = ::Katello::Resources::CDN::KatelloCdn.new('https://test.com', { organization_label: 'test', content_view_label: 'test', - lifecycle_environment_label: 'test' + lifecycle_environment_label: 'test', }) ::Katello::Resources::CDN::KatelloCdn.any_instance.expects(:organization).returns(@organization) @@ -42,7 +42,7 @@ def test_katello_cdn_repository_url_throws_error_when_repo_not_found katello_cdn = ::Katello::Resources::CDN::KatelloCdn.new('https://test.com', { organization_label: 'test', content_view_label: 'test', - lifecycle_environment_label: 'test' + lifecycle_environment_label: 'test', }) ::Katello::Resources::CDN::KatelloCdn.any_instance.expects(:organization).returns(@organization) @@ -60,21 +60,21 @@ def test_fetch_paths katello_cdn = ::Katello::Resources::CDN::KatelloCdn.new('https://test.com', { organization_label: 'test', content_view_label: 'test', - lifecycle_environment_label: 'test' + lifecycle_environment_label: 'test', }) content_path = 'rhel-6-server-els-rpms' repo_set = { - 'label' => content_path + 'label' => content_path, } response_body = { 'results' => [ { 'arch' => 'i386', - 'minor' => '6Server' - } - ] + 'minor' => '6Server', + }, + ], } expected_url = "/katello/api/v2/repositories?full_result=true&organization_id=#{@organization['id']}&content_view_id=2&environment_id=2&search=#{CGI.escape("content_label = #{content_path}")}" diff --git a/test/lib/tasks/receptor/extract_orgs_test.rb b/test/lib/tasks/receptor/extract_orgs_test.rb index e12ecc482a3..bfcddf928f5 100644 --- a/test/lib/tasks/receptor/extract_orgs_test.rb +++ b/test/lib/tasks/receptor/extract_orgs_test.rb @@ -31,8 +31,8 @@ def test_output_file upstreamConsumer: { idCert: { cert: "#{org.label}_cert", - key: "#{org.label}_key" - } + key: "#{org.label}_key", + }, } ) end diff --git a/test/lib/tasks/upgrades/4.1/fix_invalid_pools_test.rb b/test/lib/tasks/upgrades/4.1/fix_invalid_pools_test.rb index ca569c1da64..4462e9631dd 100644 --- a/test/lib/tasks/upgrades/4.1/fix_invalid_pools_test.rb +++ b/test/lib/tasks/upgrades/4.1/fix_invalid_pools_test.rb @@ -33,7 +33,7 @@ def test_import_pool_data Katello::Resources::Candlepin::Pool.expects(:find).once.returns( 'productId' => subscription.cp_id, 'owner' => { - 'key' => org_one.label + 'key' => org_one.label, } ) Katello::Pool.any_instance.expects(:import_data).with(true).once @@ -59,7 +59,7 @@ def test_delete_orphaned_by_org Katello::Resources::Candlepin::Pool.expects(:find).once.returns( 'productId' => subscription.cp_id, 'owner' => { - 'key' => nil # org lookup will return nothing + 'key' => nil, # org lookup will return nothing } ) @@ -85,7 +85,7 @@ def test_delete_no_matching_subscription Katello::Resources::Candlepin::Pool.expects(:find).once.returns( 'productId' => '12354', # this returns nothing for the subscription lookup 'owner' => { - 'key' => org_one.label + 'key' => org_one.label, } ) diff --git a/test/lib/tasks/upgrades/4.1/reupdate_content_import_export_perms_test.rb b/test/lib/tasks/upgrades/4.1/reupdate_content_import_export_perms_test.rb index 7b6d3991256..9d61fdd1c85 100644 --- a/test/lib/tasks/upgrades/4.1/reupdate_content_import_export_perms_test.rb +++ b/test/lib/tasks/upgrades/4.1/reupdate_content_import_export_perms_test.rb @@ -84,7 +84,7 @@ def test_reupdate_content_import_export_perms_duplicated # Now just rename import_libray_content to import_content permission_map = { Permission.find_by(name: :export_library_content) => Permission.find_by(name: :export_content), - Permission.find_by(name: :import_library_content) => Permission.find_by(name: :import_content) + Permission.find_by(name: :import_library_content) => Permission.find_by(name: :import_content), } permission_map.each do |old_perm, new_perm| Filtering.where(permission_id: old_perm.id).update_all(:permission_id => new_perm.id) diff --git a/test/lib/util/cdn_var_subsitutor_test.rb b/test/lib/util/cdn_var_subsitutor_test.rb index e92c8d50afc..14c3864c3b6 100644 --- a/test/lib/util/cdn_var_subsitutor_test.rb +++ b/test/lib/util/cdn_var_subsitutor_test.rb @@ -67,16 +67,16 @@ def test_substitute_vars_paths_without_substitutions path: '/content/dist/rhel/server/5/5.8/i386/os', substitutions: { releasever: '5.8', - basearch: 'i386' - } + basearch: 'i386', + }, }, { path: '/content/dist/rhel/server/5/5Server/x86_64/os', substitutions: { releasever: '5Server', - basearch: 'x86_64' - } - } + basearch: 'x86_64', + }, + }, ] resource.expects(:fetch_paths).with(@el5_path).returns(response) @@ -85,7 +85,7 @@ def test_substitute_vars_paths_without_substitutions expected_paths = [ PathWithSubstitutions.new('/content/dist/rhel/server/5/5.8/i386/os', releasever: '5.8', basearch: 'i386'), - PathWithSubstitutions.new('/content/dist/rhel/server/5/5Server/x86_64/os', releasever: '5Server', basearch: 'x86_64') + PathWithSubstitutions.new('/content/dist/rhel/server/5/5Server/x86_64/os', releasever: '5Server', basearch: 'x86_64'), ] assert_equal expected_paths.sort, resolved_list.sort diff --git a/test/lib/util/deduplication_migrator_test.rb b/test/lib/util/deduplication_migrator_test.rb index 58e030dba64..6103cda5943 100644 --- a/test/lib/util/deduplication_migrator_test.rb +++ b/test/lib/util/deduplication_migrator_test.rb @@ -10,14 +10,14 @@ class DeduplicationMigratorTest < ActiveSupport::TestCase let(:model) do { :model => ::Katello::CapsuleLifecycleEnvironment, - :fields => [:lifecycle_environment_id, :capsule_id] + :fields => [:lifecycle_environment_id, :capsule_id], } end let(:content_view) do { :model => ::Katello::ContentView, - :fields => [:name, :organization_id] + :fields => [:name, :organization_id], } end @@ -37,7 +37,7 @@ def test_cleaning_queries .expects(:count) .returns({ [1, 1] => 2, - [6, 1] => 2 + [6, 1] => 2, }) mock_relation .expects(:pluck).with('min(id)') @@ -45,7 +45,7 @@ def test_cleaning_queries result = migrator.cleaning_queries(model) expected = [ {:lifecycle_environment_id => 1, :capsule_id => 1, :min_id => 1}, - {:lifecycle_environment_id => 6, :capsule_id => 1, :min_id => 6} + {:lifecycle_environment_id => 6, :capsule_id => 1, :min_id => 6}, ] assert_equal result, expected end @@ -85,7 +85,7 @@ def test_execute migrator.expects(:cleaning_queries).at_least(5).returns( [ {:lifecycle_environment_id => 1, :capsule_id => 1, :min_id => 1}, - {:lifecycle_environment_id => 6, :capsule_id => 1, :min_id => 6} + {:lifecycle_environment_id => 6, :capsule_id => 1, :min_id => 6}, ]) migrator.expects(:clean_duplicates).at_least(5).returns(5) migrator.expects(:rename_duplicates).at_least_once.returns(1) diff --git a/test/lib/util/hostgroup_facets_helper_test.rb b/test/lib/util/hostgroup_facets_helper_test.rb index c4a529d60f7..3264c6df4d0 100644 --- a/test/lib/util/hostgroup_facets_helper_test.rb +++ b/test/lib/util/hostgroup_facets_helper_test.rb @@ -44,7 +44,7 @@ def test_pick_facet_values_simple content_source_id: @content_source.id, lifecycle_environment_id: @env.id, content_view_id: @cv.id, - kickstart_repository_id: @distro.id + kickstart_repository_id: @distro.id, }.with_indifferent_access audits = [ mock_audit(expected.slice(:content_source_id, :lifecycle_environment_id)), @@ -60,7 +60,7 @@ def test_pick_facet_values_with_conflicts mock_audit(content_source_id: @content_source.id, lifecycle_environment_id: @env.id, content_view_id: @cv.id), - mock_audit(content_view_id: nil) + mock_audit(content_view_id: nil), ] @hostgroup.expects(:audits).returns(audits) @@ -68,7 +68,7 @@ def test_pick_facet_values_with_conflicts expected = { content_source_id: @content_source.id, lifecycle_environment_id: @env.id, - content_view_id: nil + content_view_id: nil, }.with_indifferent_access assert_equal expected, @helper.pick_facet_values(@hostgroup) end diff --git a/test/lib/util/package_test.rb b/test/lib/util/package_test.rb index bf5d704c40f..d99ee733e47 100644 --- a/test/lib/util/package_test.rb +++ b/test/lib/util/package_test.rb @@ -33,7 +33,7 @@ def test_latest_packages {:epoch => '10', :version => '2', :release => '4'}, {:epoch => '10', :version => '3.2', :release => '4'}, {:epoch => '10', :version => '3.10', :release => '3.2'}, - {:epoch => '10', :version => '3.10', :release => '3.10'} + {:epoch => '10', :version => '3.10', :release => '3.10'}, ] packages.each do |package| package[:version_sortable] = Util::Package.sortable_version(package[:version]) @@ -41,7 +41,7 @@ def test_latest_packages end expected_packages = [ packages[0].with_indifferent_access, - packages[-1].with_indifferent_access + packages[-1].with_indifferent_access, ] assert_equal expected_packages, Util::Package.find_latest_packages(packages) end diff --git a/test/lib/util/pulpcore_content_filters_test.rb b/test/lib/util/pulpcore_content_filters_test.rb index 2ddcd4d9807..3e3f245b69a 100644 --- a/test/lib/util/pulpcore_content_filters_test.rb +++ b/test/lib/util/pulpcore_content_filters_test.rb @@ -10,7 +10,7 @@ def setup @metadata2_href = "/href2" @metadatafiles_results = [ PulpRpmClient::RpmRepoMetadataFileResponse.new(:pulp_href => @metadata1_href), - PulpRpmClient::RpmRepoMetadataFileResponse.new(:pulp_href => @metadata2_href) + PulpRpmClient::RpmRepoMetadataFileResponse.new(:pulp_href => @metadata2_href), ] end @@ -36,7 +36,7 @@ def setup @distribution_tree2_href = "/href2" @distribution_trees_results = [ PulpRpmClient::RpmDistributionTreeResponse.new(:pulp_href => @distribution_tree1_href), - PulpRpmClient::RpmDistributionTreeResponse.new(:pulp_href => @distribution_tree2_href) + PulpRpmClient::RpmDistributionTreeResponse.new(:pulp_href => @distribution_tree2_href), ] end diff --git a/test/lib/validators/hostgroup_kickstart_repository_validator_test.rb b/test/lib/validators/hostgroup_kickstart_repository_validator_test.rb index 228ac75db45..9efe2a06749 100644 --- a/test/lib/validators/hostgroup_kickstart_repository_validator_test.rb +++ b/test/lib/validators/hostgroup_kickstart_repository_validator_test.rb @@ -20,7 +20,7 @@ def setup :missing_content_source => 'Please select a content source before assigning a kickstart repository', :missing_content_view => 'The selected/Inherited Content View is not available for this Lifecycle Environment', :mismatched_ks_repo => 'The selected kickstart repository is not part of the assigned content view, lifecycle environment, ' \ - 'content source, operating system, and architecture' + 'content source, operating system, and architecture', } @content_facet = Katello::Hostgroup::ContentFacet.new( :kickstart_repository_id => 4, diff --git a/test/migrations/20211220185935_clean_duplicate_content_units_test.rb b/test/migrations/20211220185935_clean_duplicate_content_units_test.rb index 02287e17f6e..5ee1363be43 100644 --- a/test/migrations/20211220185935_clean_duplicate_content_units_test.rb +++ b/test/migrations/20211220185935_clean_duplicate_content_units_test.rb @@ -13,7 +13,7 @@ class CleanDuplicateContentUnitsTest < ActiveSupport::TestCase let(:migrations) do [ ActiveRecord::MigrationProxy.new("AddContentViewAndLifecycleEnvironment", previous_version, "#{Katello::Engine.root}/db/migrate//20211208034230_add_content_view_and_lifecycle_environment.rb", ""), - ActiveRecord::MigrationProxy.new("CleanDuplicateContentUnits", current_version, "#{Katello::Engine.root}/db/migrate/20211220185935_clean_duplicate_content_units.rb", "") + ActiveRecord::MigrationProxy.new("CleanDuplicateContentUnits", current_version, "#{Katello::Engine.root}/db/migrate/20211220185935_clean_duplicate_content_units.rb", ""), ] end diff --git a/test/models/association_test.rb b/test/models/association_test.rb index 20bff5b9224..50f69626faa 100644 --- a/test/models/association_test.rb +++ b/test/models/association_test.rb @@ -20,7 +20,7 @@ def ignorable_foreign_keys { "katello_task_statuses" => ["task_owner_id"], "katello_content_view_erratum_filter_rules" => ["errata_id"], - "katello_repositories" => ["content_id"] + "katello_repositories" => ["content_id"], } end @@ -67,7 +67,7 @@ def self.ignorable_models "Katello::SmartProxySyncHistory", "Katello::SubscriptionFacetActivationKey", "Katello::SubscriptionFacetInstalledProduct", - "Katello::SubscriptionFacetPurposeAddon" + "Katello::SubscriptionFacetPurposeAddon", ] end diff --git a/test/models/concerns/host_managed_extensions_test.rb b/test/models/concerns/host_managed_extensions_test.rb index 73c38f90889..7f4fc70f736 100644 --- a/test/models/concerns/host_managed_extensions_test.rb +++ b/test/models/concerns/host_managed_extensions_test.rb @@ -372,6 +372,7 @@ def test_import_repos end class HostAvailableModulesTest < HostManagedExtensionsTestBase + # rubocop:disable Metrics/ParameterLists def make_module_json(name = "foo", status = "unknown", context = nil, installed_profiles = [], active = nil) { "name" => name, @@ -382,11 +383,11 @@ def make_module_json(name = "foo", status = "unknown", context = nil, installed_ "profiles" => [ "development", "minimal", - "default" + "default", ], "installed_profiles" => installed_profiles, "status" => status, - "active" => active + "active" => active, } end @@ -395,7 +396,7 @@ def test_import_modules make_module_json("enabled-installed", "enabled", 'blahcontext', ["default"]), make_module_json("enabled2", "enabled"), make_module_json("disabled", "disabled", "abacadaba"), - make_module_json("unknown", "unknown") + make_module_json("unknown", "unknown"), ] @foreman_host.import_module_streams(modules_json) assert_equal 1, @foreman_host.host_available_module_streams.installed.size @@ -419,7 +420,7 @@ def test_import_modules_with_active_field modules_json = [ make_module_json("enabled-varying-activity", "enabled", "12347", [], true), make_module_json("enabled-varying-activity", "enabled", "12345", [], false), - make_module_json("enabled-varying-activity", "enabled", "12346", [], false) + make_module_json("enabled-varying-activity", "enabled", "12346", [], false), ] @foreman_host.import_module_streams(modules_json) @@ -469,12 +470,12 @@ def setup tracer_json = { "sshd": { "type": "daemon", - "helper": "sudo systemctl restart sshd" + "helper": "sudo systemctl restart sshd", }, "tuned": { "type": "daemon", - "helper": "" - } + "helper": "", + }, } @foreman_host.import_tracer_profile(tracer_json) @foreman_host.reload diff --git a/test/models/concerns/redhat_extensions_test.rb b/test/models/concerns/redhat_extensions_test.rb index cdbf51bf94a..cf677eafacb 100644 --- a/test/models/concerns/redhat_extensions_test.rb +++ b/test/models/concerns/redhat_extensions_test.rb @@ -21,7 +21,7 @@ def test_find_or_create_operating_system_when_os_present 'name' => 'RedHat', 'major' => "2", 'minor' => "1", - 'family' => 'Redhat' + 'family' => 'Redhat', } os = ::Redhat.create!(params) assert_equal os.title, "RedHat 2.1" @@ -36,7 +36,7 @@ def test_find_or_create_operating_system_when_title_conflicts 'major' => "2", 'minor' => "5", 'family' => 'Redhat', - 'description' => 'RedHat 2.1' + 'description' => 'RedHat 2.1', } os = ::Redhat.create!(params) assert_equal os.title, "RedHat 2.1" @@ -148,7 +148,7 @@ def setup @hostgroup = ::Hostgroup.new(:name => "testhg", :content_facet_attributes => { :lifecycle_environment_id => @repo_with_distro.environment.id, - :content_view_id => @repo_with_distro.content_view.id + :content_view_id => @repo_with_distro.content_view.id, } ) @hostgroup.architecture = architectures(:x86_64) diff --git a/test/models/concerns/smart_proxy_extensions_test.rb b/test/models/concerns/smart_proxy_extensions_test.rb index ebe8315af4a..107d0da2243 100644 --- a/test/models/concerns/smart_proxy_extensions_test.rb +++ b/test/models/concerns/smart_proxy_extensions_test.rb @@ -30,7 +30,7 @@ def setup_yum_repo "rpm.modulemd" => {count: 7, href: 'href'}, "rpm.modulemd_defaults" => {count: 3, href: 'href'}, "rpm.packagegroup" => {count: 7, href: 'href'}, - "rpm.packagecategory" => {count: 1, href: 'href'} + "rpm.packagecategory" => {count: 1, href: 'href'}, } yum_service.expects(:latest_content_counts).once.returns(yum_counts) yum_repo @@ -42,7 +42,7 @@ def setup_file_repo file_service = file_repo.backend_service(@proxy).with_mirror_adapter file_repo.expects(:backend_service).with(@proxy).once.returns(file_service) file_counts = { - "file.file" => {count: 100, href: 'href'} + "file.file" => {count: 100, href: 'href'}, } file_service.expects(:latest_content_counts).once.returns(file_counts) file_repo @@ -54,7 +54,7 @@ def setup_ansible_collection_repo ansible_service = ansible_repo.backend_service(@proxy).with_mirror_adapter ansible_repo.expects(:backend_service).with(@proxy).once.returns(ansible_service) ansible_counts = { - "ansible.collection" => {count: 802, href: 'href'} + "ansible.collection" => {count: 802, href: 'href'}, } ansible_service.expects(:latest_content_counts).once.returns(ansible_counts) ansible_repo @@ -70,7 +70,7 @@ def setup_container_repo container_counts = { "container.blob" => {count: 30, href: 'href'}, "container.manifest" => {count: 10, href: 'href'}, - "container.tag" => {count: 5, href: 'href'} + "container.tag" => {count: 5, href: 'href'}, } container_service.expects(:latest_content_counts).once.returns(container_counts) container_repo @@ -87,7 +87,7 @@ def setup_cvv_container_repo container_counts = { "container.blob" => {count: 30, href: 'href'}, "container.manifest" => {count: 10, href: 'href'}, - "container.tag" => {count: 5, href: 'href'} + "container.tag" => {count: 5, href: 'href'}, } container_service.expects(:latest_content_counts).once.returns(container_counts) container_repo @@ -99,7 +99,7 @@ def setup_ostree_repo ostree_service = ostree_repo.backend_service(@proxy).with_mirror_adapter ostree_repo.expects(:backend_service).with(@proxy).once.returns(ostree_service) ostree_counts = { - "ostree.refs" => {count: 30, href: 'href'} + "ostree.refs" => {count: 30, href: 'href'}, } ostree_service.expects(:latest_content_counts).once.returns(ostree_counts) ostree_repo @@ -111,7 +111,7 @@ def setup_deb_repo deb_service = deb_repo.backend_service(@proxy).with_mirror_adapter deb_repo.expects(:backend_service).with(@proxy).once.returns(deb_service) deb_counts = { - "deb.package" => {count: 987, href: 'href'} + "deb.package" => {count: 987, href: 'href'}, } deb_service.expects(:latest_content_counts).once.returns(deb_counts) deb_repo @@ -123,7 +123,7 @@ def setup_python_repo python_service = python_repo.backend_service(@proxy).with_mirror_adapter python_repo.expects(:backend_service).with(@proxy).once.returns(python_service) python_counts = { - "python.python" => {count: 42, href: 'href'} + "python.python" => {count: 42, href: 'href'}, } python_service.expects(:latest_content_counts).once.returns(python_counts) python_repo @@ -154,19 +154,19 @@ def test_update_global_content_counts "env_id" => yum_repo.environment.id, "library_instance_id" => yum_repo.library_instance_or_self.id, "product_id" => yum_repo.product_id, - "content_type" => yum_repo.content_type + "content_type" => yum_repo.content_type, }, - "counts" => { "erratum" => 4, "srpm" => 1, "rpm" => 31, "module_stream" => 7, "rpm.modulemd_defaults" => 3, "package_group" => 7, "rpm.packagecategory" => 1 } + "counts" => { "erratum" => 4, "srpm" => 1, "rpm" => 31, "module_stream" => 7, "rpm.modulemd_defaults" => 3, "package_group" => 7, "rpm.packagecategory" => 1 }, }, file_repo.id.to_s => { "metadata" => { "env_id" => file_repo.environment.id, "library_instance_id" => file_repo.library_instance_or_self.id, "product_id" => file_repo.product_id, - "content_type" => file_repo.content_type + "content_type" => file_repo.content_type, }, "counts" => - { "file" => 100 } + { "file" => 100 }, }, ansible_repo.id.to_s => { "metadata" => { @@ -175,49 +175,49 @@ def test_update_global_content_counts "product_id" => ansible_repo.product_id, "content_type" => ansible_repo.content_type}, "counts" => - { "ansible.collection" => 802 } + { "ansible.collection" => 802 }, }, container_repo.id.to_s => { "metadata" => { "env_id" => container_repo.environment.id, "library_instance_id" => container_repo.library_instance_or_self.id, "product_id" => container_repo.product_id, - "content_type" => container_repo.content_type + "content_type" => container_repo.content_type, }, "counts" => - { "container.blob" => 30, "docker_manifest_list" => 1, "docker_manifest" => 9, "docker_tag" => 5 } + { "container.blob" => 30, "docker_manifest_list" => 1, "docker_manifest" => 9, "docker_tag" => 5 }, }, ostree_repo.id.to_s => { "metadata" => { "env_id" => ostree_repo.environment.id, "library_instance_id" => ostree_repo.library_instance_or_self.id, "product_id" => ostree_repo.product_id, - "content_type" => ostree_repo.content_type + "content_type" => ostree_repo.content_type, }, "counts" => - {"ostree_ref" => 30 } + {"ostree_ref" => 30 }, }, deb_repo.id.to_s => { "metadata" => { "env_id" => deb_repo.environment.id, "library_instance_id" => deb_repo.library_instance_or_self.id, "product_id" => deb_repo.product_id, - "content_type" => deb_repo.content_type + "content_type" => deb_repo.content_type, }, "counts" => - { "deb" => 987 } + { "deb" => 987 }, }, python_repo.id.to_s => { "metadata" => { "env_id" => python_repo.environment.id, "library_instance_id" => python_repo.library_instance_or_self.id, "product_id" => python_repo.product_id, - "content_type" => python_repo.content_type + "content_type" => python_repo.content_type, }, "counts" => - { "python_package" => 42 } - } - } + { "python_package" => 42 }, + }, + }, }, cvv_container_repo.content_view_version.id.to_s => { "repositories" => @@ -226,13 +226,13 @@ def test_update_global_content_counts "env_id" => cvv_container_repo.environment.id, "library_instance_id" => cvv_container_repo.library_instance_or_self.id, "product_id" => cvv_container_repo.product_id, - "content_type" => cvv_container_repo.content_type + "content_type" => cvv_container_repo.content_type, }, - "counts" => { "container.blob" => 30, "docker_manifest_list" => 1, "docker_manifest" => 9, "docker_tag" => 5 } - } - } - } - } + "counts" => { "container.blob" => 30, "docker_manifest_list" => 1, "docker_manifest" => 9, "docker_tag" => 5 }, + }, + }, + }, + }, } assert_equal expected_counts, counts end @@ -257,14 +257,14 @@ def test_update_environment_content_counts "env_id" => container_repo.environment.id, "library_instance_id" => container_repo.library_instance_or_self.id, "product_id" => container_repo.product_id, - "content_type" => container_repo.content_type + "content_type" => container_repo.content_type, }, "counts" => - { "container.blob" => 30, "docker_manifest_list" => 1, "docker_manifest" => 9, "docker_tag" => 5 } - } - } - } - } + { "container.blob" => 30, "docker_manifest_list" => 1, "docker_manifest" => 9, "docker_tag" => 5 }, + }, + }, + }, + }, } assert_equal expected_counts, counts end @@ -289,14 +289,14 @@ def test_update_content_view_counts "env_id" => cvv_container_repo.environment.id, "library_instance_id" => cvv_container_repo.library_instance_or_self.id, "product_id" => cvv_container_repo.product_id, - "content_type" => cvv_container_repo.content_type + "content_type" => cvv_container_repo.content_type, }, "counts" => - { "container.blob" => 30, "docker_manifest_list" => 1, "docker_manifest" => 9, "docker_tag" => 5 } - } - } - } - } + { "container.blob" => 30, "docker_manifest_list" => 1, "docker_manifest" => 9, "docker_tag" => 5 }, + }, + }, + }, + }, } assert_equal expected_counts, counts end @@ -314,14 +314,14 @@ def test_update_repository_counts "env_id" => cvv_container_repo.environment.id, "library_instance_id" => cvv_container_repo.library_instance_or_self.id, "product_id" => cvv_container_repo.product_id, - "content_type" => cvv_container_repo.content_type + "content_type" => cvv_container_repo.content_type, }, "counts" => - { "container.blob" => 30, "docker_manifest_list" => 1, "docker_manifest" => 9, "docker_tag" => 5 } - } - } - } - } + { "container.blob" => 30, "docker_manifest_list" => 1, "docker_manifest" => 9, "docker_tag" => 5 }, + }, + }, + }, + }, } assert_equal expected_counts, counts end @@ -397,7 +397,7 @@ def test_sync_container_gateway capsule_content.smart_proxy.add_lifecycle_environment(environment) expected_repo_list_args = { - :repositories => [{:repository => "empty_organization-puppet_product-busybox", :auth_required => true}, {:repository => "busybox", :auth_required => true}] + :repositories => [{:repository => "empty_organization-puppet_product-busybox", :auth_required => true}, {:repository => "busybox", :auth_required => true}], } repo_list_update_expectation = ProxyAPI::ContainerGateway.any_instance.expects(:repository_list).with do |value| Set.new(value[:repositories]) == Set.new(expected_repo_list_args[:repositories]) @@ -466,7 +466,7 @@ def test_fix_pulp3_capabilities_not_needed 'ansible': Katello::Repository::ANSIBLE_COLLECTION_TYPE, 'deb': Katello::Repository::DEB_TYPE, 'ostree': Katello::Repository::OSTREE_TYPE, - 'python': 'python' + 'python': 'python', } pulpcore_features.each_pair do |feature_name, repo_type| diff --git a/test/models/content_test.rb b/test/models/content_test.rb index 496db134c0c..29d3159e645 100644 --- a/test/models/content_test.rb +++ b/test/models/content_test.rb @@ -32,11 +32,11 @@ def test_import_all "id" => SecureRandom.uuid, "type" => "file", "name" => "import_all_content", - "contentUrl" => "/content/dist/rhel/server/6/$releasever/$basearch/satellite/5.7/iso" + "contentUrl" => "/content/dist/rhel/server/6/$releasever/$basearch/satellite/5.7/iso", }, - "enabled" => false - } - ] + "enabled" => false, + }, + ], } end end @@ -58,7 +58,7 @@ def test_can_update_url { from: '/content/rhel/$aaa/$bbb/', to: '/content/foo/xxxx-$bbb/yyyy-$aaa', expected_result: true }, { from: '/content/rhel/$aaa/$bbb', to: '$aaa/content/$bbb', expected_result: true }, { from: '/content/rhel/$aaa', to: '/content/foo', expected_result: false }, - { from: '/content/rhel/$aaa', to: '/content/$bbb', expected_result: false } + { from: '/content/rhel/$aaa', to: '/content/$bbb', expected_result: false }, ] fixtures.each do |fixture| @content.content_url = fixture[:from] diff --git a/test/models/content_view_environment_activation_key_test.rb b/test/models/content_view_environment_activation_key_test.rb index de98a7c3b42..dfbf81e32f7 100644 --- a/test/models/content_view_environment_activation_key_test.rb +++ b/test/models/content_view_environment_activation_key_test.rb @@ -15,7 +15,8 @@ def test_reprioritize_for_activation_key Setting['allow_multiple_content_views'] = true @activation_key.content_view_environments = [ katello_content_view_environments(:library_dev_view_dev), - katello_content_view_environments(:library_dev_staging_view_dev)] + katello_content_view_environments(:library_dev_staging_view_dev), + ] cve1 = @activation_key.content_view_environments.first cve2 = @activation_key.content_view_environments.last diff --git a/test/models/erratum_test.rb b/test/models/erratum_test.rb index 9cb21584402..3d48f9e766c 100644 --- a/test/models/erratum_test.rb +++ b/test/models/erratum_test.rb @@ -229,7 +229,7 @@ def test_returns_installable_errata_for_host_with_hostgroup { name: "view_hostgroups", search: "name=#{hostgroup.name}"}, { name: "edit_hostgroups", search: "name=#{hostgroup.name}"}, { name: 'view_host_collections'}, - { name: 'edit_host_collections'} + { name: 'edit_host_collections'}, ], organizations: [@host.organization], locations: [@host.location]) diff --git a/test/models/host/content_facet_test.rb b/test/models/host/content_facet_test.rb index a528c295cc9..1b7a64d9c1f 100644 --- a/test/models/host/content_facet_test.rb +++ b/test/models/host/content_facet_test.rb @@ -426,8 +426,8 @@ def test_errata_counts :security => 0, :bugfix => 0, :enhancement => 0, - :total => 0 - } + :total => 0, + }, } assert_equal expected, content_facet.errata_counts @@ -457,7 +457,7 @@ def test_save_bound_repos_by_paths content_facet.update_repositories_by_paths([ "/pulp/content/#{repo.relative_path}", "/pulp/content/#{deb_repo.relative_path}", - "/pulp/content/Library/test/" + "/pulp/content/Library/test/", ]) assert_equal_arrays content_facet.bound_repositories, [deb_repo, repo] diff --git a/test/models/katello/alternate_content_source_test.rb b/test/models/katello/alternate_content_source_test.rb index 32a5d9c32bc..93261d7549a 100644 --- a/test/models/katello/alternate_content_source_test.rb +++ b/test/models/katello/alternate_content_source_test.rb @@ -23,7 +23,7 @@ def test_duplicate_name assert_not_valid yum_acs_dup_name assert_equal yum_acs_dup_name.errors.full_messages, [ "Label has already been taken", - "Name has already been taken" + "Name has already been taken", ] end diff --git a/test/models/module_stream_test.rb b/test/models/module_stream_test.rb index 25d829eebc4..eca4881828c 100644 --- a/test/models/module_stream_test.rb +++ b/test/models/module_stream_test.rb @@ -112,7 +112,7 @@ def test_module_spec [{:name => "boo", :stream => "100", :version => "11111", :context => "cccc", :arch => "noarch"}, "boo:100:11111:cccc:noarch"], [{:name => "boo", :stream => "100", :version => "11111", :arch => "noarch"}, "boo:100:11111"], [{:name => "boo", :stream => "100", :context => "cccc", :arch => "noarch"}, "boo:100"], - [{:name => "boo", :version => "11111", :context => "cccc", :arch => "noarch"}, "boo"] + [{:name => "boo", :version => "11111", :context => "cccc", :arch => "noarch"}, "boo"], ] inputs.each do |params, expectation| assert_equal expectation, ModuleStream.new(params).module_spec diff --git a/test/models/ping_test.rb b/test/models/ping_test.rb index fbce93a109e..d73e4b46d1f 100644 --- a/test/models/ping_test.rb +++ b/test/models/ping_test.rb @@ -9,13 +9,13 @@ def setup {"_ns" => "workers", "last_heartbeat" => "2016-09-13T20:07:54Z", "_id" => "scheduler@chicken.example.com"}, {"_ns" => "workers", "last_heartbeat" => "2016-09-13T20:08:21Z", "_id" => "resource_manager@chicken.example.com"}, {"_ns" => "workers", "last_heartbeat" => "2016-09-13T20:08:20Z", "_id" => "reserved_resource_worker-1@chicken.example.com"}, - {"_ns" => "workers", "last_heartbeat" => "2016-09-13T20:08:20Z", "_id" => "reserved_resource_worker-0@chicken.example.com"} + {"_ns" => "workers", "last_heartbeat" => "2016-09-13T20:08:20Z", "_id" => "reserved_resource_worker-0@chicken.example.com"}, ], "messaging_connection" => {"connected" => true}, "database_connection" => {"connected" => true}, "api_version" => "2", - "versions" => {"platform_version" => "2.9.1" - } + "versions" => {"platform_version" => "2.9.1", + }, } end @@ -182,11 +182,11 @@ def setup "name" => "reserved-resource-worker-1@zeta.partello.example.com", "last_heartbeat" => "2019-06-13T18:59:40.006524Z", "online" => true, - "missing" => false} + "missing" => false}, ], "online_content_apps" => [{"last_heartbeat": "2021-10-20T13:32:36.817752Z", - "name": "3835@katello.example.com"} + "name": "3835@katello.example.com"}, ], "missing_workers" => [], "database_connection" => {"connected" => true}, @@ -212,21 +212,21 @@ def test_failure_on_bad_redis def test_failure_on_all_workers run_exception_test({ "database_connection" => {"connected" => true}, - "redis_connection" => {"connected" => true} + "redis_connection" => {"connected" => true}, }, /No pulpcore workers are running at/) end def test_failure_on_all_workers_empty run_exception_test({ "database_connection" => {"connected" => true}, "redis_connection" => {"connected" => true}, - "online_workers" => [] + "online_workers" => [], }, /No pulpcore workers are running at/) end def test_failure_on_no_reserved_resource_worker run_exception_test({ "database_connection" => {"connected" => true}, "redis_connection" => {"connected" => true}, - "online_workers" => [] + "online_workers" => [], }, /No pulpcore workers are running at/) end @@ -234,7 +234,7 @@ def test_failure_on_content_apps_empty json = { "database_connection" => {"connected" => true}, "redis_connection" => {"connected" => true}, "online_workers" => @ok_pulp_status['online_workers'], - "online_content_apps" => [] + "online_content_apps" => [], } message = /No pulpcore content apps are running at/ diff --git a/test/models/pool_test.rb b/test/models/pool_test.rb index d6f53c8d26e..aa7be3cbdf0 100644 --- a/test/models/pool_test.rb +++ b/test/models/pool_test.rb @@ -111,8 +111,8 @@ def test_import_all_default { @pool_one.cp_id => { 'productId' => @pool_one.subscription.cp_id, - 'id' => @pool_one.cp_id - } + 'id' => @pool_one.cp_id, + }, } ) Pool.expects(:in_organization).with(org).returns([@pool_one]) @@ -131,8 +131,8 @@ def test_import_all_new_record 'providedProducts' => [], 'derivedProvidedProducts' => [], 'owner' => { - 'key' => org.label - } + 'key' => org.label, + }, } FactoryBot.create(:katello_subscription, cp_id: 'SKU001', organization: org) @@ -151,8 +151,8 @@ def test_import_all_no_managed_association { @pool_one.cp_id => { 'productId' => @pool_one.subscription.cp_id, - 'id' => @pool_one.cp_id - } + 'id' => @pool_one.cp_id, + }, } ) Pool.expects(:in_organization).with(org).returns([@pool_one]) @@ -178,7 +178,7 @@ def test_import_pool 'providedProducts' => [], 'derivedProvidedProducts' => [], 'owner' => { - 'key' => @organization.label + 'key' => @organization.label, } ) @@ -202,7 +202,7 @@ def test_import_pool_no_subscription 'providedProducts' => [], 'derivedProvidedProducts' => [], 'owner' => { - 'key' => @organization.label + 'key' => @organization.label, } ) diff --git a/test/models/product_content_test.rb b/test/models/product_content_test.rb index d8d9dac50f2..208b4f0297b 100644 --- a/test/models/product_content_test.rb +++ b/test/models/product_content_test.rb @@ -59,12 +59,12 @@ def test_enabled_value_from_candlepin 'productContent' => [ { 'content' => { - 'id' => @content_id + 'id' => @content_id, }, - 'enabled' => true - } - ] - } + 'enabled' => true, + }, + ], + }, ] ) result = @product_content.enabled_value_from_candlepin diff --git a/test/models/repository_base.rb b/test/models/repository_base.rb index c152c83bdc0..46357175cb6 100644 --- a/test/models/repository_base.rb +++ b/test/models/repository_base.rb @@ -30,7 +30,7 @@ def valid_label_list RFauxFactory.gen_alphanumeric(rand(2..127)), RFauxFactory.gen_alphanumeric(128), RFauxFactory.gen_alpha(rand(2..127)), - RFauxFactory.gen_alpha(128) + RFauxFactory.gen_alpha(128), ] end @@ -51,7 +51,7 @@ def valid_http_credentials_list(escape = false) { login: '', pass: '', quote: false }, { login: RFauxFactory.gen_alpha(rand(1..512)), pass: RFauxFactory.gen_alpha, quote: false }, { login: RFauxFactory.gen_alphanumeric(rand(1..512)), pass: RFauxFactory.gen_alphanumeric, quote: false }, - { login: RFauxFactory.gen_utf8(rand(1..50)), pass: RFauxFactory.gen_utf8, quote: true } + { login: RFauxFactory.gen_utf8(rand(1..50)), pass: RFauxFactory.gen_utf8, quote: true }, ] if escape credentials = credentials.map do |cred| @@ -66,7 +66,7 @@ def invalid_http_credentials(escape = false) credentials = [ { login: RFauxFactory.gen_alpha(1024), pass: '', string_type: :alpha }, { login: RFauxFactory.gen_alpha(512), pass: RFauxFactory.gen_alpha(512), string_type: :alpha }, - { login: RFauxFactory.gen_utf8(512), pass: RFauxFactory.gen_utf8(512), string_type: :utf8 } + { login: RFauxFactory.gen_utf8(512), pass: RFauxFactory.gen_utf8(512), string_type: :utf8 }, ] if escape credentials = credentials.map do |cred| diff --git a/test/models/repository_test.rb b/test/models/repository_test.rb index eb25a521d7d..f7458be4988 100644 --- a/test/models/repository_test.rb +++ b/test/models/repository_test.rb @@ -408,7 +408,7 @@ def test_container_repository_name_pattern ['test', '<%= repository.label %>', 'test'], ['test', '<%= organization.label %> <%= repository.label %>', 'empty_organization_test'], ['test', ' <%= organization.label %> <%= repository.label %> ', 'empty_organization_test'], - ['test', '', 'empty_organization-puppet_product-test'] + ['test', '', 'empty_organization-puppet_product-test'], ] labels.each do |label, pattern, result| @@ -652,7 +652,7 @@ def test_generate_content_path { input: '/content/rhel/x64', expected: '/content/rhel/x64' }, { input: '/content/$releasever/$basearch', expected: '/content/6Server/x86_64' }, { input: '/content/$releasever/f00-$basearch', expected: '/content/6Server/f00-x86_64' }, - { input: '/content/$basearch/foo/$releasever', expected: '/content/x86_64/foo/6Server' } + { input: '/content/$basearch/foo/$releasever', expected: '/content/x86_64/foo/6Server' }, ] fixtures.each do |fixture| diff --git a/test/models/rhel_lifecycle_status_test.rb b/test/models/rhel_lifecycle_status_test.rb index 6f708bfd052..73ee58a97cc 100644 --- a/test/models/rhel_lifecycle_status_test.rb +++ b/test/models/rhel_lifecycle_status_test.rb @@ -30,7 +30,7 @@ def test_eos_schedule_constants 'RHEL7 (System z (Structure A))', 'RHEL7 (ARM)', 'RHEL7 (POWER9)', - 'RHEL5' + 'RHEL5', ].each do |rhel_version| assert eos_schedule_data.key?(rhel_version) assert eos_schedule_data[rhel_version].is_a?(Hash) diff --git a/test/models/root_repository_test.rb b/test/models/root_repository_test.rb index 451e00345f9..85e5498c908 100644 --- a/test/models/root_repository_test.rb +++ b/test/models/root_repository_test.rb @@ -51,7 +51,7 @@ def test_invalid_os_versions assert_not_valid @root assert_equal @root.errors.full_messages, [ "Os versions invalid: Repositories can only require one OS version.", - "Os versions must be one of: rhel-6, rhel-7, rhel-8, rhel-9" + "Os versions must be one of: rhel-6, rhel-7, rhel-8, rhel-9", ] end diff --git a/test/models/smart_proxy_sync_history_test.rb b/test/models/smart_proxy_sync_history_test.rb index 520a11c5dfc..e93a7a4f188 100644 --- a/test/models/smart_proxy_sync_history_test.rb +++ b/test/models/smart_proxy_sync_history_test.rb @@ -32,7 +32,7 @@ def test_repo_smart_proxy_history_unique sp_history_args = { :smart_proxy_id => proxy_with_pulp.id, :repository_id => @repo.id, - :started_at => Time.now + :started_at => Time.now, } assert_raises(ActiveRecord::RecordNotUnique) do ::Katello::SmartProxySyncHistory.create sp_history_args diff --git a/test/models/subscription_test.rb b/test/models/subscription_test.rb index 4b949061be3..8325521add6 100644 --- a/test/models/subscription_test.rb +++ b/test/models/subscription_test.rb @@ -15,15 +15,15 @@ def test_import_all [ { 'id' => product.cp_id, - 'attributes' => {} - } + 'attributes' => {}, + }, ] ) product_data = [ { - 'id' => product.cp_id - } + 'id' => product.cp_id, + }, ] Katello::Resources::Candlepin::Product.expects(:all).returns(product_data) diff --git a/test/models/sync_plan_test.rb b/test/models/sync_plan_test.rb index 37bccccc5c0..1229e600a91 100644 --- a/test/models/sync_plan_test.rb +++ b/test/models/sync_plan_test.rb @@ -24,7 +24,7 @@ def valid_sync_dates to_day + 5.minutes, to_day + 5.days, to_day - 1.day, - to_day - 5.minutes + to_day - 5.minutes, ] end diff --git a/test/models/upstream_pool_test.rb b/test/models/upstream_pool_test.rb index 2449fba8194..321b6ebcfc3 100644 --- a/test/models/upstream_pool_test.rb +++ b/test/models/upstream_pool_test.rb @@ -14,7 +14,7 @@ def setup 'consumed' => :consumed, 'productName' => :product_name, 'productId' => :product_id, - 'subscriptionId' => :subscription_id + 'subscriptionId' => :subscription_id, }] @response = stub(to_str: @raw_pool.to_json, headers: {}) end diff --git a/test/presenters/host_subscriptions_presenter_test.rb b/test/presenters/host_subscriptions_presenter_test.rb index 280f9220101..b7812729357 100644 --- a/test/presenters/host_subscriptions_presenter_test.rb +++ b/test/presenters/host_subscriptions_presenter_test.rb @@ -18,16 +18,16 @@ def test_host_with_subscriptions entitlements = [ { 'pool' => { - 'id' => redhat_pool.cp_id + 'id' => redhat_pool.cp_id, }, - quantity: 15 + quantity: 15, }, { 'pool' => { - 'id' => custom_pool.cp_id + 'id' => custom_pool.cp_id, }, - quantity: 4 - } + quantity: 4, + }, ] ::Katello::Candlepin::Consumer.any_instance.expects(:entitlements).returns(entitlements) diff --git a/test/services/candlepin/message_handler_test.rb b/test/services/candlepin/message_handler_test.rb index 0ca42f515e7..1cb24316b09 100644 --- a/test/services/candlepin/message_handler_test.rb +++ b/test/services/candlepin/message_handler_test.rb @@ -123,8 +123,8 @@ def setup [ { 'displayName' => @org.name, - 'key' => @org.label - } + 'key' => @org.label, + }, ] ) super diff --git a/test/services/katello/candlepin/event_handler_test.rb b/test/services/katello/candlepin/event_handler_test.rb index 7cb105ca5a3..9f02c7f8e89 100644 --- a/test/services/katello/candlepin/event_handler_test.rb +++ b/test/services/katello/candlepin/event_handler_test.rb @@ -19,7 +19,7 @@ module Katello def message(subject, content = {}) result = { subject: subject, - content: JSON.generate(content) + content: JSON.generate(content), } OpenStruct.new(result) end diff --git a/test/services/katello/candlepin_event_listener_test.rb b/test/services/katello/candlepin_event_listener_test.rb index 711f78c12b7..f2886fa835d 100644 --- a/test/services/katello/candlepin_event_listener_test.rb +++ b/test/services/katello/candlepin_event_listener_test.rb @@ -15,7 +15,7 @@ def test_status status = { processed_count: 0, failed_count: 0, - running: false + running: false, } Katello::CandlepinEventListener.reset diff --git a/test/services/katello/event_monitor/poller_thread_test.rb b/test/services/katello/event_monitor/poller_thread_test.rb index 97275efbe44..ebf60ac4014 100644 --- a/test/services/katello/event_monitor/poller_thread_test.rb +++ b/test/services/katello/event_monitor/poller_thread_test.rb @@ -26,7 +26,7 @@ def test_status status = { processed_count: 0, failed_count: 0, - running: false + running: false, } Katello::EventMonitor::PollerThread.initialize diff --git a/test/services/katello/package_profile_uploader_test.rb b/test/services/katello/package_profile_uploader_test.rb index 3179250198e..9f899ea3f4e 100644 --- a/test/services/katello/package_profile_uploader_test.rb +++ b/test/services/katello/package_profile_uploader_test.rb @@ -23,7 +23,7 @@ class PackageProfileUploaderTest < ActiveSupport::TestCase [ {"content_type" => "rpm", "name" => "rpm", "profile" => rpm_profiles}, {"content_type" => "enabled_repos", "name" => "enabled_repos", "profile" => enabled_repos}, - {"content_type" => "modulemd", "name" => "modulemd", "profile" => modulemd_inventory} + {"content_type" => "modulemd", "name" => "modulemd", "profile" => modulemd_inventory}, ] end let(:profile_string) { profile.to_json } diff --git a/test/services/katello/product_content_importer_test.rb b/test/services/katello/product_content_importer_test.rb index 37ca06851e5..2e7f55e4708 100644 --- a/test/services/katello/product_content_importer_test.rb +++ b/test/services/katello/product_content_importer_test.rb @@ -10,9 +10,9 @@ def setup "id" => "4010", "type" => "file", "name" => "foo", - "contentUrl" => "/content/dist/rhel/server/6/$releasever/$basearch/satellite/5.7/iso" + "contentUrl" => "/content/dist/rhel/server/6/$releasever/$basearch/satellite/5.7/iso", }, - "enabled" => false + "enabled" => false, }] @service = ProductContentImporter.new end @@ -104,14 +104,14 @@ def test_find_product_for_content "id" => "11210", "type" => "yum", "label" => "codeready-builder-for-rhel-9-s390x-eus-rpms", - "name" => "Red Hat CodeReady Linux Builder for RHEL 9 IBM z Systems - Extended Update Support (RPMs)" + "name" => "Red Hat CodeReady Linux Builder for RHEL 9 IBM z Systems - Extended Update Support (RPMs)", }, "enabled" => false}, {"content" => {"id" => "9268", "type" => "yum", "label" => "codeready-builder-for-rhel-8-s390x-eus-debug-rpms", - "name" => "Red Hat CodeReady Linux Builder for RHEL 8 IBM z Systems - Extended Update Support (Debug RPMs)" + "name" => "Red Hat CodeReady Linux Builder for RHEL 8 IBM z Systems - Extended Update Support (Debug RPMs)", }, "enabled" => false}]}, {"id" => "350", "productContent" => []}, diff --git a/test/services/katello/profiles_uploader_test.rb b/test/services/katello/profiles_uploader_test.rb index 9e8beefe9a4..9f6f1f18ea4 100644 --- a/test/services/katello/profiles_uploader_test.rb +++ b/test/services/katello/profiles_uploader_test.rb @@ -23,7 +23,7 @@ class ProfilesUploaderTest < ActiveSupport::TestCase [ {"content_type" => "rpm", "profile" => rpm_profiles}, {"content_type" => "enabled_repos", "profile" => enabled_repos}, - {"content_type" => "modulemd", "profile" => modulemd_inventory} + {"content_type" => "modulemd", "profile" => modulemd_inventory}, ] end let(:profile_string) { profile.to_json } diff --git a/test/services/katello/pulp3/content_view_version/import_gpg_keys_test.rb b/test/services/katello/pulp3/content_view_version/import_gpg_keys_test.rb index aed303a7a76..2a936852627 100644 --- a/test/services/katello/pulp3/content_view_version/import_gpg_keys_test.rb +++ b/test/services/katello/pulp3/content_view_version/import_gpg_keys_test.rb @@ -15,7 +15,7 @@ def test_import metadata_gpg_keys = [ stub('existing gpg', name: existing_gpgkey.name, content: updated_content), - stub('new gpg', name: gpg_key, content: 'new content') + stub('new gpg', name: gpg_key, content: 'new content'), ] importer = Katello::Pulp3::ContentViewVersion::ImportGpgKeys.new( diff --git a/test/services/katello/pulp3/content_view_version/import_test.rb b/test/services/katello/pulp3/content_view_version/import_test.rb index 870d9a84fa4..cd3a08b7e43 100644 --- a/test/services/katello/pulp3/content_view_version/import_test.rb +++ b/test/services/katello/pulp3/content_view_version/import_test.rb @@ -42,7 +42,7 @@ class ImportTest < ActiveSupport::TestCase arch: repo.arch, major: repo.major, minor: repo.minor - ) + ), ] import.reset_content_view_repositories! @@ -59,7 +59,7 @@ class ImportTest < ActiveSupport::TestCase metadata_product = stub('metadata_product', label: repo.product.label, cp_id: nil) @metadata_repos = [ stub('library repo', label: repo.label, product: metadata_product, redhat: false), - stub('non-library repo', label: "unknown-007", product: metadata_product, redhat: false) + stub('non-library repo', label: "unknown-007", product: metadata_product, redhat: false), ] repos = import.intersecting_repos_library_and_metadata @@ -81,7 +81,7 @@ class ImportTest < ActiveSupport::TestCase major: repo.major, minor: repo.minor, redhat: true), - stub('non-library repo', content: nil, label: "unknown-007", product: metadata_product, redhat: true) + stub('non-library repo', content: nil, label: "unknown-007", product: metadata_product, redhat: true), ] repos = import.intersecting_repos_library_and_metadata.pluck(:id) diff --git a/test/services/katello/pulp3/content_view_version/import_validator_test.rb b/test/services/katello/pulp3/content_view_version/import_validator_test.rb index 6bc951b2415..5e1f5dfe584 100644 --- a/test/services/katello/pulp3/content_view_version/import_validator_test.rb +++ b/test/services/katello/pulp3/content_view_version/import_validator_test.rb @@ -93,7 +93,7 @@ class ImportValidatorTest < ActiveSupport::TestCase label: repo.label, product: metadata_product, content_type: 'bogus', - redhat: !repo.redhat?) + redhat: !repo.redhat?), ] @intersecting_repos = [repo] @@ -110,7 +110,7 @@ class ImportValidatorTest < ActiveSupport::TestCase @content_view = cvv.content_view @metadata_repos = [ - stub('metadata repo', redhat: true) + stub('metadata repo', redhat: true), ] exception = assert_raises(RuntimeError) do @@ -122,12 +122,12 @@ class ImportValidatorTest < ActiveSupport::TestCase it "fails on metadata if redhat products in the metadata are not in the library" do @metadata_products = [ stub('product', redhat: false, name: 'prod', label: 'prod', cp_id: nil), - stub('red hat product', redhat: true, name: 'Red Hat Linux', label: 'rhel_7', cp_id: nil) + stub('red hat product', redhat: true, name: 'Red Hat Linux', label: 'rhel_7', cp_id: nil), ] @metadata_repos = [ stub('metadata repo', name: "misc", label: "misc", redhat: true, product: @metadata_products.first), - stub('metadata repo', name: "rhel_7", label: "rhel_7", redhat: true, product: @metadata_products.second) + stub('metadata repo', name: "rhel_7", label: "rhel_7", redhat: true, product: @metadata_products.second), ] exception = assert_raises(RuntimeError) do @@ -142,13 +142,13 @@ class ImportValidatorTest < ActiveSupport::TestCase it "can validate Red Hat repositories based on their cp_id" do @metadata_products = [ stub('product', redhat: false, name: 'prod', label: 'prod', cp_id: '83'), - stub('red hat product', redhat: true, name: 'Red Hat Linux', label: 'rhel_7', cp_id: '69') + stub('red hat product', redhat: true, name: 'Red Hat Linux', label: 'rhel_7', cp_id: '69'), ] @content_view = cvv.content_view @metadata_repos = [ stub('metadata repo', name: "misc", label: "misc", redhat: true, product: @metadata_products.first), - stub('metadata repo', name: "rhel_7", label: "rhel_7", redhat: true, product: @metadata_products.second) + stub('metadata repo', name: "rhel_7", label: "rhel_7", redhat: true, product: @metadata_products.second), ] exception = assert_raises(RuntimeError) do diff --git a/test/services/katello/pulp3/content_view_version/importable_products_test.rb b/test/services/katello/pulp3/content_view_version/importable_products_test.rb index 75e8c4007e3..0bc00d58843 100644 --- a/test/services/katello/pulp3/content_view_version/importable_products_test.rb +++ b/test/services/katello/pulp3/content_view_version/importable_products_test.rb @@ -16,7 +16,7 @@ class ImportableProductsTest < ActiveSupport::TestCase metadata_products = [ stub(label: new_prod_1, name: new_prod_1, description: 'fake', redhat: false, gpg_key: metadata_gpg_key), stub(label: new_prod_2, name: new_prod_2, description: 'fake', redhat: false, gpg_key: nil), - stub(label: repo.product.label, name: repo.product.name, description: repo.product.description, redhat: false, gpg_key: metadata_gpg_key) + stub(label: repo.product.label, name: repo.product.name, description: repo.product.description, redhat: false, gpg_key: metadata_gpg_key), ] helper = Katello::Pulp3::ContentViewVersion::ImportableProducts.new( @@ -44,7 +44,7 @@ class ImportableProductsTest < ActiveSupport::TestCase label = "#{repo.product.label}-f000" metadata_products = [ - stub(label: label, name: repo.product.name, description: repo.product.description, redhat: false, gpg_key: metadata_gpg_key) + stub(label: label, name: repo.product.name, description: repo.product.description, redhat: false, gpg_key: metadata_gpg_key), ] helper = Katello::Pulp3::ContentViewVersion::ImportableProducts.new( diff --git a/test/services/katello/pulp3/content_view_version/importable_repositories_test.rb b/test/services/katello/pulp3/content_view_version/importable_repositories_test.rb index f8f10291192..fb924975f54 100644 --- a/test/services/katello/pulp3/content_view_version/importable_repositories_test.rb +++ b/test/services/katello/pulp3/content_view_version/importable_repositories_test.rb @@ -48,7 +48,7 @@ class ImportableRepositoriesTest < ActiveSupport::TestCase download_policy: 'immediate', mirroring_policy: nil, content: nil - ) + ), ] helper = Katello::Pulp3::ContentViewVersion::ImportableRepositories.new( @@ -111,7 +111,7 @@ class ImportableRepositoriesTest < ActiveSupport::TestCase download_policy: 'immediate', mirroring_policy: nil, content: stub(label: new_repo_1, id: nil, url: content_url) - ) + ), ] helper = Katello::Pulp3::ContentViewVersion::ImportableRepositories.new( @@ -141,7 +141,7 @@ class ImportableRepositoriesTest < ActiveSupport::TestCase arch: repo.arch, major: repo.major, minor: repo.minor - ) + ), ] helper = Katello::Pulp3::ContentViewVersion::ImportableRepositories.new( @@ -174,7 +174,7 @@ class ImportableRepositoriesTest < ActiveSupport::TestCase arch: repo.arch, major: repo.major, minor: repo.minor - ) + ), ] path = "/var/lib/pulp/exports/Default_Org/CV/2.0" helper = Katello::Pulp3::ContentViewVersion::ImportableRepositories.new( @@ -209,7 +209,7 @@ class ImportableRepositoriesTest < ActiveSupport::TestCase arch: repo.arch, major: repo.major, minor: repo.minor - ) + ), ] helper = Katello::Pulp3::ContentViewVersion::ImportableRepositories.new( @@ -250,7 +250,7 @@ class ImportableRepositoriesTest < ActiveSupport::TestCase download_policy: 'immediate', mirroring_policy: nil, content: nil - ) + ), ] helper = Katello::Pulp3::ContentViewVersion::ImportableRepositories.new( diff --git a/test/services/katello/pulp3/module_stream_test.rb b/test/services/katello/pulp3/module_stream_test.rb index 4839fa0cc24..55ac65bc217 100644 --- a/test/services/katello/pulp3/module_stream_test.rb +++ b/test/services/katello/pulp3/module_stream_test.rb @@ -40,12 +40,12 @@ def pulp_module_data "arch": "x86_64", "artifacts": [ "walrus-0:5.21-1.noarch", - "foobar-8.noarch" + "foobar-8.noarch", ], "dependencies": [ ], - "packages": ["pulp3/href1", "pulp3/href2"] + "packages": ["pulp3/href1", "pulp3/href2"], }.with_indifferent_access end diff --git a/test/services/katello/pulp3/repository/ansible_collection/ansible_collection_repository_mirror_test.rb b/test/services/katello/pulp3/repository/ansible_collection/ansible_collection_repository_mirror_test.rb index 74776a2185b..1012d547866 100644 --- a/test/services/katello/pulp3/repository/ansible_collection/ansible_collection_repository_mirror_test.rb +++ b/test/services/katello/pulp3/repository/ansible_collection/ansible_collection_repository_mirror_test.rb @@ -46,7 +46,7 @@ def test_refresh_distributions_create_dist :base_path => "mock relative_path", :name => "Default_Organization-Cabinet-pulp3_Ansible_collection_1", :content_guard => nil, - :repository_version => "repo_href" + :repository_version => "repo_href", }).returns(distribution_data) PulpAnsibleClient::DistributionsAnsibleApi.any_instance.expects(:create).with(distribution_data) diff --git a/test/services/katello/pulp3/repository/apt/copy_units_test.rb b/test/services/katello/pulp3/repository/apt/copy_units_test.rb index 3f5f604c3a6..18c0db4f896 100644 --- a/test/services/katello/pulp3/repository/apt/copy_units_test.rb +++ b/test/services/katello/pulp3/repository/apt/copy_units_test.rb @@ -25,7 +25,7 @@ def test_copy_api_data_dup_does_deep_copy { source_repo_version: "another source repo", dest_repo: "another dest repo", content: ["4", "5", "6"], - dest_base_version: 1 } + dest_base_version: 1 }, ] data.dependency_solving = false @@ -44,7 +44,7 @@ def test_copy_api_data_dup_clears_content { source_repo_version: "another source repo", dest_repo: "another dest repo", content: ["4", "5", "6"], - dest_base_version: 1 } + dest_base_version: 1 }, ] data.dependency_solving = false @@ -83,7 +83,7 @@ def test_copy_content_chunked_copies_correct_units data.config << { source_repo_version: "repo version", dest_repo: "dest repo", - content: [] + content: [], } end data.config[0][:content] = (0..9_999).to_a diff --git a/test/services/katello/pulp3/repository/docker/docker_repository_mirror_test.rb b/test/services/katello/pulp3/repository/docker/docker_repository_mirror_test.rb index cafcf049628..6a06b1dd47d 100644 --- a/test/services/katello/pulp3/repository/docker/docker_repository_mirror_test.rb +++ b/test/services/katello/pulp3/repository/docker/docker_repository_mirror_test.rb @@ -48,7 +48,7 @@ def test_refresh_distributions_create_dist { :base_path => "mock relative_path", :name => "Default_Organization-Cabinet-pulp3_Docker_1", - :repository_version => "repo_href" + :repository_version => "repo_href", }).returns(distribution_data) PulpContainerClient::DistributionsContainerApi.any_instance.expects(:create).with(distribution_data) @repo_mirror.refresh_distributions(name: "test name", base_path: "test base_path", content_guard: "test content_guard") diff --git a/test/services/katello/pulp3/repository/yum/copy_units_test.rb b/test/services/katello/pulp3/repository/yum/copy_units_test.rb index af0a5d40f88..0b71f14a6fd 100644 --- a/test/services/katello/pulp3/repository/yum/copy_units_test.rb +++ b/test/services/katello/pulp3/repository/yum/copy_units_test.rb @@ -24,7 +24,7 @@ def test_copy_api_data_dup_does_deep_copy { source_repo_version: "another source repo", dest_repo: "another dest repo", content: ["4", "5", "6"], - dest_base_version: 1 } + dest_base_version: 1 }, ] data.dependency_solving = false @@ -43,7 +43,7 @@ def test_copy_api_data_dup_clears_content { source_repo_version: "another source repo", dest_repo: "another dest repo", content: ["4", "5", "6"], - dest_base_version: 1 } + dest_base_version: 1 }, ] data.dependency_solving = false @@ -82,7 +82,7 @@ def test_copy_content_chunked_copies_correct_units data.config << { source_repo_version: "repo version", dest_repo: "dest repo", - content: [] + content: [], } end data.config[0][:content] = (0..9_999).to_a diff --git a/test/services/katello/pulp3/repository_mirror_test.rb b/test/services/katello/pulp3/repository_mirror_test.rb index e08b5127fea..76eefcc28a4 100644 --- a/test/services/katello/pulp3/repository_mirror_test.rb +++ b/test/services/katello/pulp3/repository_mirror_test.rb @@ -22,7 +22,7 @@ def test_remote_options_with_mirror_remote_options expected_options = { :name => "some_repo", :url => "/a/path/to/content", - :mirror_remote_option1 => "an option" + :mirror_remote_option1 => "an option", } assert_equal expected_options, @repo_mirror.remote_options end @@ -32,7 +32,7 @@ def test_remote_options_without_mirror_options @repo_mirror.stubs(:remote_feed_url).returns('/a/path/to/content') expected_options = { :name => "some_repo", - :url => "/a/path/to/content" + :url => "/a/path/to/content", } assert_equal expected_options, @repo_mirror.remote_options end diff --git a/test/services/katello/pulp3/smart_proxy_repository_test.rb b/test/services/katello/pulp3/smart_proxy_repository_test.rb index b43606fc717..c2613cf6ba7 100644 --- a/test/services/katello/pulp3/smart_proxy_repository_test.rb +++ b/test/services/katello/pulp3/smart_proxy_repository_test.rb @@ -19,7 +19,7 @@ def test_delete_orphan_remotes pulp_remotes = [ PulpRpmClient::RpmRpmRemoteResponse.new(name: rhel7.pulp_id, pulp_href: rhel7_href), PulpRpmClient::RpmRpmRemoteResponse.new(name: rhel6.pulp_id, pulp_href: 'rhel6'), - PulpRpmClient::RpmRpmRemoteResponse.new(name: fedora.pulp_id, pulp_href: 'fedora') + PulpRpmClient::RpmRpmRemoteResponse.new(name: fedora.pulp_id, pulp_href: 'fedora'), ] smart_proxy_mirror_repo.expects(:pulp3_enabled_repo_types).once.returns([::Katello::RepositoryTypeManager.find(:yum)]) diff --git a/test/services/katello/pulp3/task_group_test.rb b/test/services/katello/pulp3/task_group_test.rb index 2b9cd7649ae..07e06195bc2 100644 --- a/test/services/katello/pulp3/task_group_test.rb +++ b/test/services/katello/pulp3/task_group_test.rb @@ -20,7 +20,7 @@ def test_error_no_errors "running": 1, "completed": 0, "canceled": 0, - "failed": 0 + "failed": 0, } group = Katello::Pulp3::TaskGroup.new(@primary, group_data) refute group.error @@ -35,7 +35,7 @@ def test_error_with_errors "running": 0, "completed": 0, "canceled": 0, - "failed": 1 + "failed": 1, } group = Katello::Pulp3::TaskGroup.new(@primary, group_data) assert group.error @@ -54,7 +54,7 @@ def test_error_with_cancelled "running": 0, "completed": 0, "canceled": 1, - "failed": 0 + "failed": 0, } group = Katello::Pulp3::TaskGroup.new(@primary, group_data) assert group.error diff --git a/test/services/katello/pulp3/task_test.rb b/test/services/katello/pulp3/task_test.rb index 9fb1ce4e1db..5f50b1383c9 100644 --- a/test/services/katello/pulp3/task_test.rb +++ b/test/services/katello/pulp3/task_test.rb @@ -14,7 +14,7 @@ def setup /pulp/api/v3/publications/rpm/rpm/00740609-f339-4ba0-b45c-47c4b9a55080/ /pulp/api/v3/repositories/rpm/rpm/1be4e0c6-be29-4e38-986e-d71582f35617/versions/1/ /pulp/api/v3/publications/rpm/rpm/17e9690a-4f58-4fac-9cbe-ace9b1c15aae/ - ] + ], }.with_indifferent_access end diff --git a/test/services/katello/pxe_files_downloader_test.rb b/test/services/katello/pxe_files_downloader_test.rb index 33a936382d5..fd2c560db16 100644 --- a/test/services/katello/pxe_files_downloader_test.rb +++ b/test/services/katello/pxe_files_downloader_test.rb @@ -40,7 +40,7 @@ def generate_certificate ef.issuer_certificate = cert cert.extensions = [ ef.create_extension("basicConstraints", "CA:TRUE", true), - ef.create_extension("subjectKeyIdentifier", "hash") + ef.create_extension("subjectKeyIdentifier", "hash"), # ef.create_extension("keyUsage", "cRLSign,keyCertSign", true), ] cert.add_extension ef.create_extension("authorityKeyIdentifier", diff --git a/test/support/annotations/vcr_request.rb b/test/support/annotations/vcr_request.rb index 621a3a39411..6dac352ee3a 100644 --- a/test/support/annotations/vcr_request.rb +++ b/test/support/annotations/vcr_request.rb @@ -15,7 +15,7 @@ def generate_template 'method' => method, 'path' => path, 'title' => nil, - 'description' => nil + 'description' => nil, } end diff --git a/test/support/auth_support.rb b/test/support/auth_support.rb index f7774ddc140..3bf150ea8bf 100644 --- a/test/support/auth_support.rb +++ b/test/support/auth_support.rb @@ -31,7 +31,7 @@ def resource_type_from_name(name) "manifest" => "Katello::Subscription", "lifecycle_environment" => "Katello::KTEnvironment", "or_remove_content_views_to_environment" => "Katello::KTEnvironment", - "or_remove_content_view" => "Katello::ContentView" + "or_remove_content_view" => "Katello::ContentView", } mapping[resource_name] || verify_resource(resource_name.camelize) end diff --git a/test/support/export_support.rb b/test/support/export_support.rb index 02eb0cbc9a3..0930bc3e466 100644 --- a/test/support/export_support.rb +++ b/test/support/export_support.rb @@ -8,7 +8,7 @@ def fetch_exporter(smart_proxy:, content_view_version:, content_view_version: content_view_version, destination_server: destination_server, from_content_view_version: from_content_view_version, - format: format + format: format, } ) version_repositories = content_view_version.archived_repos.yum_type diff --git a/test/support/fixtures_support.rb b/test/support/fixtures_support.rb index 26ced7bb8b6..8fb2249b2da 100644 --- a/test/support/fixtures_support.rb +++ b/test/support/fixtures_support.rb @@ -70,7 +70,7 @@ module FixturesSupport :katello_generic_content_units => Katello::GenericContentUnit, :katello_flatpak_remotes => Katello::FlatpakRemote, :katello_flatpak_remote_repositories => Katello::FlatpakRemoteRepository, - :katello_flatpak_remote_repository_manifests => Katello::FlatpakRemoteRepositoryManifest + :katello_flatpak_remote_repository_manifests => Katello::FlatpakRemoteRepositoryManifest, }.freeze # rubocop:disable Naming/AccessorMethodName diff --git a/test/support/foreman_tasks/task.rb b/test/support/foreman_tasks/task.rb index 3fb8f8aaa9c..572e9dedb00 100644 --- a/test/support/foreman_tasks/task.rb +++ b/test/support/foreman_tasks/task.rb @@ -32,7 +32,7 @@ def assert_foreman_task(async, expected_action_class, *args_expected, &block) valid_args = lambda do |*args| msg = "ActionController::Parameters were sent to an action. Please convert to a Hash" - fail(msg) if args.any? { |a| a.class == ActionController::Parameters } + fail(msg) if args.any? { |a| a.instance_of?(ActionController::Parameters) } true end diff --git a/test/support/vcr.rb b/test/support/vcr.rb index 07316b3f87b..f54131cacee 100644 --- a/test/support/vcr.rb +++ b/test/support/vcr.rb @@ -86,7 +86,7 @@ def configure_vcr :decode_compressed_response => true, :match_requests_on => [:method, :path, :params, :body_json], :serialize_with => :psych, - :preserve_exact_body_bytes => true + :preserve_exact_body_bytes => true, } begin