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 b6adb2a commit 2b03ee6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 13 deletions.
26 changes: 16 additions & 10 deletions convert2rhel/actions/post_conversion/hostmetering.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,22 +144,26 @@ def _check_host_metering_configuration(self):
id="CONFIGURE_HOST_METERING_SKIP",
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.",
diagnosis="We haven't detected 'configure_host_metering' in the convert2rhel.ini config file nor"
" 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),
diagnosis="Unexpected value of 'configure_host_metering' in convert2rhel.ini or the"
" 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
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

0 comments on commit 2b03ee6

Please sign in to comment.