Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Nov 20, 2024
1 parent 20c620c commit 9a90f0d
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 17 deletions.
22 changes: 14 additions & 8 deletions convert2rhel/actions/post_conversion/hostmetering.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,21 +145,25 @@ def _check_host_metering_configuration(self):
title="Did not perform host metering configuration.",
description="Configuration of host metering has been skipped.",
diagnosis="We haven't detected 'configure_host_metering' in the convert2rhel.ini config file nor"
" the CONVERT2RHEL_CONFIGURE_HOST_METERING environment variable.",
" the CONVERT2RHEL_CONFIGURE_HOST_METERING environment variable.",
)
return False

if tool_opts.configure_host_metering not in ("force", "auto"):
logger.debug("Unexpected value of 'configure_host_metering' in convert2rhel.ini or the"
" CONVERT2RHEL_CONFIGURE_HOST_METERING environment variable: {}"
.format(tool_opts.configure_host_metering))
logger.debug(
"Unexpected value of 'configure_host_metering' in convert2rhel.ini or the"
" CONVERT2RHEL_CONFIGURE_HOST_METERING environment variable: {}".format(
tool_opts.configure_host_metering
)
)
self.add_message(
level="WARNING",
id="UNRECOGNIZED_OPTION_CONFIGURE_HOST_METERING",
title="Unexpected value of the host metering setting.",
diagnosis="Unexpected value of 'configure_host_metering' in convert2rhel.ini or the"
" CONVERT2RHEL_CONFIGURE_HOST_METERING environment variable: {}"
.format(tool_opts.configure_host_metering),
" CONVERT2RHEL_CONFIGURE_HOST_METERING environment variable: {}".format(
tool_opts.configure_host_metering
),
description="Host metering will not be configured.",
remediations="Set the option to 'auto' or 'force' if you want to configure host metering.",
)
Expand All @@ -180,8 +184,10 @@ def _check_host_metering_configuration(self):
" For generic usage please use the 'auto' option.",
)
elif tool_opts.configure_host_metering == "auto":
logger.debug("Configuration of host metering set to 'auto' - host-metering will be enabled based on"
" a detected hyperscaler.")
logger.debug(
"Configuration of host metering set to 'auto' - host-metering will be enabled based on"
" a detected hyperscaler."
)

return True

Expand Down
5 changes: 3 additions & 2 deletions convert2rhel/actions/pre_ponr_changes/backup_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,9 @@ def _get_changed_package_files(self):
except IOError as err:
warn_deprecated_env("CONVERT2RHEL_INCOMPLETE_ROLLBACK")
if tool_opts.incomplete_rollback:
logger.debug("You have set the incomplete rollback inhibitor override - skipping backup of"
" the package files.")
logger.debug(
"You have set the incomplete rollback inhibitor override - skipping backup of" " the package files."
)
# Return empty list results in no backup of the files
return data
else:
Expand Down
2 changes: 1 addition & 1 deletion convert2rhel/actions/system_checks/convert2rhel_latest.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def run(self):
)
),
remediations="If you want to disregard this check, set the allow_older_version inhibitor"
" override in the /etc/convert2rhel.ini config file to true.",
" override in the /etc/convert2rhel.ini config file to true.",
)
return

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def run(self):
id="UNSUPPORTED_SKIP_KERNEL_CURRENCY_CHECK_DETECTED",
title="Did not perform the kernel currency check",
description="Not checking if the loaded kernel is of the latest available version could leave your"
" system in a broken state",
" system in a broken state",
diagnosis=(
"You have set the option to skip the kernel currency check - we will skip "
"the {} comparison.\n"
Expand Down
5 changes: 3 additions & 2 deletions convert2rhel/actions/system_checks/tainted_kmods.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@ def run(self):
" tainted_kernel_module_check_skip inhibitor override in the /etc/convert2rhel.ini"
" config file to true. Overriding this check can be dangerous"
" so it is recommended that you do a system backup beforehand."
" For information on what a tainted kernel module is, please refer to this documentation {1}"
.format(LINK_PREVENT_KMODS_FROM_LOADING, LINK_TAINTED_KMOD_DOCS)
" For information on what a tainted kernel module is, please refer to this documentation {1}".format(
LINK_PREVENT_KMODS_FROM_LOADING, LINK_TAINTED_KMOD_DOCS
)
),
)
return
Expand Down
4 changes: 1 addition & 3 deletions convert2rhel/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,7 @@ def _register_options(self):
" to show you what rpm files have been affected by the conversion."
" Cannot be used with analyze subcommand."
" The incomplete_rollback option needs to be set to true in the /etc/convert2rhel.ini config file to"
" use this argument.".format(
utils.rpm.PRE_RPM_VA_LOG_FILENAME, utils.rpm.POST_RPM_VA_LOG_FILENAME
),
" use this argument.".format(utils.rpm.PRE_RPM_VA_LOG_FILENAME, utils.rpm.POST_RPM_VA_LOG_FILENAME),
)
self._shared_options_parser.add_argument(
"--eus",
Expand Down

0 comments on commit 9a90f0d

Please sign in to comment.