From c6350a3aaa9209693c3aa1880eb91e70e3cc46b5 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2025 16:57:16 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- convert2rhel/actions/conversion/set_efi_config.py | 3 +-- convert2rhel/actions/post_conversion/hostmetering.py | 3 +-- .../actions/post_conversion/modified_rpm_files_diff.py | 2 +- convert2rhel/cli.py | 3 +-- convert2rhel/repo.py | 2 +- .../unit_tests/actions/post_conversion/update_grub_test.py | 2 +- .../actions/pre_ponr_changes/kernel_modules_test.py | 2 +- convert2rhel/unit_tests/cli_test.py | 3 +-- convert2rhel/unit_tests/subscription_test.py | 4 +--- tests/integration/test_helpers/satellite.py | 6 +++--- 10 files changed, 12 insertions(+), 18 deletions(-) diff --git a/convert2rhel/actions/conversion/set_efi_config.py b/convert2rhel/actions/conversion/set_efi_config.py index 280644be53..31d24db311 100644 --- a/convert2rhel/actions/conversion/set_efi_config.py +++ b/convert2rhel/actions/conversion/set_efi_config.py @@ -252,8 +252,7 @@ def run(self): if not grub.is_efi(): logger.info( - "Unable to collect data about UEFI on a BIOS system, did not perform UEFI bootloader " - "entry replacement." + "Unable to collect data about UEFI on a BIOS system, did not perform UEFI bootloader entry replacement." ) return diff --git a/convert2rhel/actions/post_conversion/hostmetering.py b/convert2rhel/actions/post_conversion/hostmetering.py index 5fad03c582..0959ec5b35 100644 --- a/convert2rhel/actions/post_conversion/hostmetering.py +++ b/convert2rhel/actions/post_conversion/hostmetering.py @@ -90,8 +90,7 @@ def run(self): level="WARNING", id="CONFIGURE_HOST_METERING_FAILURE", title="Failed to enable and start host metering service.", - description="The host metering service failed to start" - " successfully and won't be able to keep track.", + description="The host metering service failed to start successfully and won't be able to keep track.", diagnosis="Command {command} failed with {error_message}".format( command=command, error_message=error_message ), diff --git a/convert2rhel/actions/post_conversion/modified_rpm_files_diff.py b/convert2rhel/actions/post_conversion/modified_rpm_files_diff.py index a458817f57..2b4b114479 100644 --- a/convert2rhel/actions/post_conversion/modified_rpm_files_diff.py +++ b/convert2rhel/actions/post_conversion/modified_rpm_files_diff.py @@ -77,7 +77,7 @@ def run(self): level="INFO", id="FOUND_MODIFIED_RPM_FILES", title="Modified rpm files from before and after the conversion were found.", - description="Comparison of modified rpm files from before and after " "the conversion: \n{}".format( + description="Comparison of modified rpm files from before and after the conversion: \n{}".format( modified_rpm_files_diff ), ) diff --git a/convert2rhel/cli.py b/convert2rhel/cli.py index 3ae5251b86..8b98bee642 100644 --- a/convert2rhel/cli.py +++ b/convert2rhel/cli.py @@ -145,8 +145,7 @@ def _register_options(self): self._shared_options_parser.add_argument( "--els", action="store_true", - help="Explicitly recognize the system as els, utilizing els repos." - " This option is meant for el7 systems.", + help="Explicitly recognize the system as els, utilizing els repos. This option is meant for el7 systems.", ) self._shared_options_parser.add_argument( "--enablerepo", diff --git a/convert2rhel/repo.py b/convert2rhel/repo.py index ddfa5690c7..3109269dac 100644 --- a/convert2rhel/repo.py +++ b/convert2rhel/repo.py @@ -239,5 +239,5 @@ def write_temporary_repofile(contents): raise exceptions.CriticalError( id_="STORE_REPOFILE_FAILED", title="Failed to store a repository file", - description="Failed to write a repository file contents to {}.\n" "Reason: {}".format(f.name, str(err)), + description="Failed to write a repository file contents to {}.\nReason: {}".format(f.name, str(err)), ) diff --git a/convert2rhel/unit_tests/actions/post_conversion/update_grub_test.py b/convert2rhel/unit_tests/actions/post_conversion/update_grub_test.py index 4d94eaedfe..42f7c2b4dc 100644 --- a/convert2rhel/unit_tests/actions/post_conversion/update_grub_test.py +++ b/convert2rhel/unit_tests/actions/post_conversion/update_grub_test.py @@ -244,6 +244,6 @@ def test_update_grub_error(update_grub_instance, monkeypatch, get_partition_erro level="ERROR", id="FAILED_TO_IDENTIFY_GRUB2_BLOCK_DEVICE", title="Failed to identify GRUB2 block device", - description="The block device could not be identified, please look at the diagnosis " "for more information.", + description="The block device could not be identified, please look at the diagnosis for more information.", diagnosis=diagnosis, ) diff --git a/convert2rhel/unit_tests/actions/pre_ponr_changes/kernel_modules_test.py b/convert2rhel/unit_tests/actions/pre_ponr_changes/kernel_modules_test.py index 9e3ee44e7b..ce20369942 100644 --- a/convert2rhel/unit_tests/actions/pre_ponr_changes/kernel_modules_test.py +++ b/convert2rhel/unit_tests/actions/pre_ponr_changes/kernel_modules_test.py @@ -162,7 +162,7 @@ def test_ensure_compatibility_of_kmods( ), ( HOST_MODULES_STUB_BAD, - "kernel-core-0:4.18.0-240.10.1.el8_3.x86_64\n" "kernel-core-0:4.19.0-240.10.1.el8_3.i486\n", + "kernel-core-0:4.18.0-240.10.1.el8_3.x86_64\nkernel-core-0:4.19.0-240.10.1.el8_3.i486\n", ("", 0), "CANNOT_COMPARE_PACKAGE_VERSIONS", "ERROR", diff --git a/convert2rhel/unit_tests/cli_test.py b/convert2rhel/unit_tests/cli_test.py index 8f15676cad..ea37ac91f4 100644 --- a/convert2rhel/unit_tests/cli_test.py +++ b/convert2rhel/unit_tests/cli_test.py @@ -143,8 +143,7 @@ def test_serverurl_with_no_rhsm_credentials(self, caplog, monkeypatch): cli.CLI() message = ( - "Ignoring the --serverurl option. It has no effect when no credentials to" - " subscribe the system were given." + "Ignoring the --serverurl option. It has no effect when no credentials to subscribe the system were given." ) assert message in caplog.text diff --git a/convert2rhel/unit_tests/subscription_test.py b/convert2rhel/unit_tests/subscription_test.py index 56bbaa6225..ebe352c5f2 100644 --- a/convert2rhel/unit_tests/subscription_test.py +++ b/convert2rhel/unit_tests/subscription_test.py @@ -802,9 +802,7 @@ def test_registration_succeeds_but_dbus_returns_noreply(self, monkeypatch, mocke utils, "run_subprocess", RunSubprocessMocked( - return_string=( - "system identity: 1234-56-78-9abc\n" "name: abc-123\n" "org name: Test\n" "org ID: 12345678910\n" - ) + return_string=("system identity: 1234-56-78-9abc\nname: abc-123\norg name: Test\norg ID: 12345678910\n") ), ) diff --git a/tests/integration/test_helpers/satellite.py b/tests/integration/test_helpers/satellite.py index c1c0160d98..9f8c6e4269 100644 --- a/tests/integration/test_helpers/satellite.py +++ b/tests/integration/test_helpers/satellite.py @@ -30,9 +30,9 @@ def get_satellite_curl_command(self): return self._sat_reg_commands.get(self.key) def _curl_the_satellite_script(self, curl_command): - assert ( - self.shell(f"{curl_command} -o {self._sat_script_location}", silent=True).returncode == 0 - ), "Failed to curl the satellite script to the machine." + assert self.shell(f"{curl_command} -o {self._sat_script_location}", silent=True).returncode == 0, ( + "Failed to curl the satellite script to the machine." + ) # [danmyway] This is just a mitigation of rhn-client-tools pkg obsoleting subscription-manager during upgrade # TODO remove when https://github.com/theforeman/foreman/pull/10280 gets merged and or foreman 3.12 is out