Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RHELC-1761] Format messages for consistency #1438

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion convert2rhel/actions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ def run(self, successes=None, failures=None, skips=None):
title="Skipped action",
description="This action was skipped due to another action failing.",
diagnosis=diagnosis,
remediations="Please ensure that the {} check passes so that this Action can evaluate your system".format(
remediations="Ensure that the {} check passes so that this Action can evaluate your system".format(
utils.format_sequence_as_message(failed_deps)
),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def run(self):
id="FAILED_TO_INSTALL_RHEL_KERNEL",
title="Failed to install RHEL kernel",
description="There was an error while attempting to install the RHEL kernel from yum.",
remediations="Please check that you can access the repositories that provide the RHEL kernel.",
remediations="Check that you can access the repositories that provide the RHEL kernel.",
)
return

Expand Down
39 changes: 21 additions & 18 deletions convert2rhel/actions/post_conversion/hostmetering.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ def run(self):
logger.info("Did not perform host metering configuration. Only supported for RHEL 7.")
self.add_message(
level="INFO",
id="CONFIGURE_HOST_METERING_SKIP",
title="Did not perform host metering configuration.",
description="Host metering is supportted only for RHEL 7.",
id="CONFIGURE_HOST_METERING_SKIP_ONLY_RHEL_7",
title="Did not perform host metering configuration",
description="Host metering is supported only for RHEL 7.",
)
return False

Expand All @@ -72,9 +72,9 @@ def run(self):
logger.info("Did not perform host-metering configuration.")
self.add_message(
level="INFO",
id="CONFIGURE_HOST_METERING_SKIP",
title="Did not perform host metering configuration as not needed.",
description="Host metering is not needed on the system.",
id="CONFIGURE_HOST_METERING_SKIP_NOT_HYPERSCALER",
title="Did not perform host metering configuration",
description="Host metering is not needed on the system as it is not running on a hyperscaler.",
)
return False

Expand All @@ -85,8 +85,8 @@ def run(self):
self.add_message(
level="WARNING",
id="INSTALL_HOST_METERING_FAILURE",
title="Failed to install host metering package.",
description="When installing host metering package an error occurred meaning we can't"
title="Failed to install the host-metering package",
description="When installing the host-metering package an error occurred meaning we can't"
" enable host metering on the system.",
diagnosis="`yum install host-metering` command returned {ret_install} with message {output}".format(
ret_install=ret_install, output=output
Expand All @@ -105,9 +105,9 @@ def run(self):
self.add_message(
level="WARNING",
id="CONFIGURE_HOST_METERING_FAILURE",
title="Failed to enable and start host metering service.",
title="Failed to enable and start the host metering service",
description="The host metering service failed to start"
" successfully and won't be able to keep track.",
" successfully and won't be able to report on the use of the system for the billing purposes.",
diagnosis="Command {command} failed with {error_message}".format(
command=command, error_message=error_message
),
Expand All @@ -125,7 +125,7 @@ def run(self):
self.set_result(
level="ERROR",
id="HOST_METERING_NOT_RUNNING",
title="Host metering service is not running.",
title="Host metering service is not running",
description="host-metering.service is not running.",
remediations="You can try to start the service manually"
" by running following command:\n"
Expand All @@ -145,8 +145,8 @@ def _check_env_var(self):
logger.debug("CONVERT2RHEL_CONFIGURE_HOST_METERING was not set. Skipping it.")
self.add_message(
level="INFO",
id="CONFIGURE_HOST_METERING_SKIP",
title="Did not perform host metering configuration.",
id="CONFIGURE_HOST_METERING_SKIP_OPTION_NOT_DETECTED",
title="Did not perform host metering configuration",
description="CONVERT2RHEL_CONFIGURE_HOST_METERING was not set.",
)
return False
Expand All @@ -167,19 +167,22 @@ def _check_env_var(self):
if tool_opts.configure_host_metering == "force":
logger.warning(
"The `force' option has been used for the CONVERT2RHEL_CONFIGURE_HOST_METERING environment variable."
" Please note that this option is mainly used for testing and will configure host-metering unconditionally. "
" For generic usage please use the 'auto' option."
" Note that this option is mainly used for testing and will configure host-metering unconditionally. "
" For generic usage use the 'auto' option."
)
self.add_message(
level="WARNING",
id="FORCED_CONFIGURE_HOST_METERING",
title="The `force' option has been used for the CONVERT2RHEL_CONFIGURE_HOST_METERING environment variable.",
description="Please note that this option is mainly used for testing and"
description="Note that this option is mainly used for testing and"
" will configure host-metering unconditionally."
" For generic usage please use the 'auto' option.",
" For generic usage use the 'auto' option.",
)
elif tool_opts.configure_host_metering == "auto":
logger.debug("Automatic detection of host hyperscaler and configuration.")
logger.debug(
"Configuration of host metering set to 'auto' - host-metering will be enabled based on"
" a detected hyperscaler."
)

return True

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def run(self):
self.add_message(
level="INFO",
id="SKIPPED_MODIFIED_RPM_FILES_DIFF",
title="Skipped comparison of 'rpm -Va' output from before and after the conversion.",
title="Skipped comparison of 'rpm -Va' output from before and after the conversion",
description="Comparison of 'rpm -Va' output was not performed due to missing output "
"of the 'rpm -Va' run before the conversion.",
diagnosis="This is caused mainly by using '--no-rpm-va' argument for convert2rhel.",
Expand Down Expand Up @@ -76,7 +76,7 @@ def run(self):
self.add_message(
level="INFO",
id="FOUND_MODIFIED_RPM_FILES",
title="Modified rpm files from before and after the conversion were found.",
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(
modified_rpm_files_diff
),
Expand Down
2 changes: 1 addition & 1 deletion convert2rhel/actions/post_conversion/remove_tmp_dir.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@ def run(self):
self.add_message(
level="WARNING",
id="UNSUCCESSFUL_REMOVE_TMP_DIR",
title="Temporary folder {tmp_dir} wasn't removed.".format(tmp_dir=self.tmp_dir),
title="Temporary folder {tmp_dir} wasn't removed".format(tmp_dir=self.tmp_dir),
description=warning_message,
)
2 changes: 1 addition & 1 deletion convert2rhel/actions/post_conversion/update_grub.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def run(self):
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 "
description="The block device could not be identified. Look at the diagnosis "
"for more information.",
diagnosis=str(e),
)
Expand Down
8 changes: 4 additions & 4 deletions convert2rhel/actions/pre_ponr_changes/handle_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ def run(self):
self.set_result(
level="ERROR",
id="SPECIAL_PACKAGE_REMOVAL_FAILED",
title="Failed to remove some packages necessary for the conversion.",
description="The cause of this error is unknown, please look at the diagnosis for more information.",
title="Failed to remove some packages necessary for the conversion",
description="The cause of this error is unknown. Look at the diagnosis for more information.",
diagnosis=str(e),
)
return
Expand All @@ -161,7 +161,7 @@ def run(self):
level="WARNING",
id="SPECIAL_PACKAGES_NOT_REMOVED",
title="Special packages not removed",
description="Special packages which could not be removed",
description="Certain packages could not be removed.",
diagnosis=message,
)

Expand All @@ -170,7 +170,7 @@ def run(self):
logger.info(message)
self.add_message(
level="INFO",
id="SPECIAL_PACKAGES_REMOVED",
id="SPECIAL_PACKAGES_TO_REMOVE",
title="Special packages to be removed",
description=(
"We have identified installed packages that match a pre-defined list of packages that are"
Expand Down
4 changes: 2 additions & 2 deletions convert2rhel/actions/pre_ponr_changes/kernel_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def run(self):
self.add_message(
level="WARNING",
id="ALLOW_UNAVAILABLE_KERNEL_MODULES",
title="Did not perform the ensure kernel modules compatibility check",
title="Ignoring the check ensuring kernel module availability in RHEL",
description="Detected 'CONVERT2RHEL_ALLOW_UNAVAILABLE_KMODS' environment variable.",
diagnosis="We will continue the conversion with the following kernel modules unavailable in RHEL:\n"
"{kmods}\n".format(kmods="\n".join(unsupported_kmods)),
Expand All @@ -272,7 +272,7 @@ def run(self):
level="OVERRIDABLE",
id="UNSUPPORTED_KERNEL_MODULES",
title="Unsupported kernel modules",
description="Unsupported kernel modules were found",
description="Unsupported kernel modules were found.",
diagnosis="The following loaded kernel modules are not available in RHEL:\n{0}\n".format(
"\n".join(unsupported_kmods)
),
Expand Down
10 changes: 5 additions & 5 deletions convert2rhel/actions/pre_ponr_changes/subscription.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def run(self):
level="ERROR",
id="UNKNOWN_ERROR",
title="Unknown error",
description="The cause of this error is unknown, please look at the diagnosis for more information.",
description="The cause of this error is unknown. Look at the diagnosis for more information.",
diagnosis=str(e),
)
except exceptions.CriticalError as e:
Expand Down Expand Up @@ -177,7 +177,7 @@ def run(self):
level="ERROR",
id="SYSTEM_NOT_REGISTERED",
title="Not registered with RHSM",
description="This system must be registered with rhsm in order to get access to the RHEL rpms. In this case, the system was not already registered and no credentials were given to convert2rhel to register it.",
description="This system must be registered with RHSM in order to get access to RHEL rpms. In this case, the system has not been registered and no credentials were given to convert2rhel to register it.",
remediations="You may either register this system via subscription-manager before running convert2rhel or give convert2rhel credentials to do that for you. The credentials convert2rhel would need are either activation_key and organization or username and password. You can set these in a config file and then pass the file to convert2rhel with the --config-file option.",
)
return
Expand Down Expand Up @@ -226,7 +226,7 @@ def run(self):
level="ERROR",
id="MISSING_SUBSCRIPTION_MANAGER_BINARY",
title="Missing subscription-manager binary",
description="There is a missing subscription-manager binary",
description="There is a missing subscription-manager binary.",
diagnosis="Failed to execute command: {}".format(e),
)
except exceptions.CriticalError as e:
Expand All @@ -246,15 +246,15 @@ def run(self):
level="ERROR",
id="UNKNOWN_ERROR",
title="Unknown error",
description="The cause of this error is unknown, please look at the diagnosis for more information.",
description="The cause of this error is unknown. Look at the diagnosis for more information.",
diagnosis=str(e),
)
except ValueError as e:
self.set_result(
level="ERROR",
id="MISSING_REGISTRATION_COMBINATION",
title="Missing registration combination",
description="There are missing registration combinations",
description="There are missing registration combinations.",
diagnosis="One or more combinations were missing for subscription-manager parameters: {}".format(
str(e)
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def run(self):
self.set_result(
level="ERROR",
id="FIREWALLD_MODULES_CLEANUP_ON_EXIT_CONFIG",
title="Firewalld is set to cleanup modules after exit.",
title="Firewalld is set to cleanup modules after exit",
description="Firewalld running on Oracle Linux 8 can lead to a conversion failure.",
diagnosis=(
"We've detected that firewalld unit is running and that causes iptables and nftables "
Expand Down
12 changes: 6 additions & 6 deletions convert2rhel/actions/system_checks/convert2rhel_latest.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def run(self):
level="WARNING",
id="CONVERT2RHEL_LATEST_CHECK_SKIP",
title="convert2rhel latest version check skip",
description="Did not perform the convert2hel latest version check",
description="Did not perform the convert2hel latest version check.",
diagnosis=diagnosis,
)
return
Expand Down Expand Up @@ -188,7 +188,7 @@ def run(self):
level="WARNING",
id="ALLOW_OLDER_VERSION_ENVIRONMENT_VARIABLE",
title="Outdated convert2rhel version detected",
description="An outdated convert2rhel version has been detected",
description="An outdated convert2rhel version has been detected.",
diagnosis=diagnosis,
)
else:
Expand All @@ -201,9 +201,9 @@ def run(self):
)
self.add_message(
level="WARNING",
id="OUTDATED_CONVERT2RHEL_VERSION",
id="OUTDATED_CONVERT2RHEL_VERSION_RHEL_6",
title="Outdated convert2rhel version detected",
description="An outdated convert2rhel version has been detected",
description="An outdated convert2rhel version has been detected.",
diagnosis=(
"You are currently running {} and the latest version of convert2rhel is {}.\n"
"We encourage you to update to the latest version.".format(
Expand All @@ -215,9 +215,9 @@ def run(self):
else:
self.set_result(
level="OVERRIDABLE",
id="OUT_OF_DATE",
id="OUTDATED_CONVERT2RHEL_VERSION",
title="Outdated convert2rhel version detected",
description="An outdated convert2rhel version has been detected",
description="An outdated convert2rhel version has been detected.",
diagnosis=(
"You are currently running {} and the latest version of convert2rhel is {}.\n"
"Only the latest version is supported for conversion.".format(
Expand Down
4 changes: 2 additions & 2 deletions convert2rhel/actions/system_checks/dbus.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def run(self):
level="ERROR",
id="DBUS_DAEMON_NOT_RUNNING",
title="Dbus daemon not running",
description="The Dbus daemon is not running",
description="The Dbus daemon is not running.",
diagnosis="Could not find a running DBus Daemon which is needed to register with subscription manager.",
remediations="Please start dbus using `systemctl start dbus`",
remediations="Start dbus using `systemctl start dbus`",
)
2 changes: 1 addition & 1 deletion convert2rhel/actions/system_checks/efi.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def run(self):
level="ERROR",
id="BOOTLOADER_ERROR",
title="Bootloader error detected",
description="An unknown bootloader error occurred, please look at the diagnosis for more information.",
description="An unknown bootloader error occurred. Look at the diagnosis for more information.",
diagnosis=str(e),
)
return
Expand Down
Loading
Loading