Skip to content

Commit

Permalink
Analysis message formating
Browse files Browse the repository at this point in the history
Descriptions to end with a full stop.
Do not use the word please - technical writers' rule.
  • Loading branch information
bocekm committed Nov 22, 2024
1 parent 2f57d51 commit 3619535
Show file tree
Hide file tree
Showing 33 changed files with 91 additions and 91 deletions.
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
8 changes: 4 additions & 4 deletions convert2rhel/actions/post_conversion/hostmetering.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,16 +172,16 @@ def _check_host_metering_configuration(self):
if tool_opts.configure_host_metering == "force":
logger.warning(
"You've set the host metering setting to 'force'."
" 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="Configuration of host metering set to 'force'",
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(
Expand Down
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
6 changes: 3 additions & 3 deletions convert2rhel/actions/pre_ponr_changes/handle_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def run(self):
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.",
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
2 changes: 1 addition & 1 deletion convert2rhel/actions/pre_ponr_changes/kernel_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 7 additions & 7 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 @@ -186,9 +186,9 @@ def run(self):
logger.warning(diagnosis)
self.add_message(
level="WARNING",
id="ALLOW_OLDER_VERSION_ENVIRONMENT_VARIABLE",
id="ALLOW_OLDER_VERSION_OPTION",
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
8 changes: 4 additions & 4 deletions convert2rhel/actions/system_checks/is_loaded_kernel_latest.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,14 @@ def run(self):
level="OVERRIDABLE",
id="KERNEL_CURRENCY_CHECK_FAIL",
title="Kernel currency check failed",
description="Please refer to the diagnosis for further information",
description="Refer to the diagnosis for further information.",
diagnosis=(
"Could not find any {} from repositories to compare against the loaded kernel.".format(
package_to_check
)
),
remediations=(
"Please, check if you have any vendor repositories enabled to proceed with the conversion.\n"
"Check if you have any vendor repositories enabled to proceed with the conversion.\n"
"If you wish to disregard this message, set the skip_kernel_currency_check inhibitor override in"
" the /etc/convert2rhel.ini config file to true."
),
Expand All @@ -161,7 +161,7 @@ def run(self):
level="WARNING",
id="INVALID_KERNEL_PACKAGE",
title="Invalid kernel package found",
description="Please refer to the diagnosis for further information",
description="Refer to the diagnosis for further information.",
diagnosis=str(exc),
)
return
Expand All @@ -171,7 +171,7 @@ def run(self):
level="OVERRIDABLE",
id="INVALID_KERNEL_VERSION",
title="Invalid kernel version detected",
description="The loaded kernel version mismatch the latest one available in system repositories",
description="The loaded kernel version mismatch the latest one available in system repositories.",
diagnosis=(
"The version of the loaded kernel is different from the latest version in system repositories. \n"
" Latest kernel version available in {}: {}\n"
Expand Down
6 changes: 3 additions & 3 deletions convert2rhel/actions/system_checks/package_updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def run(self):
level="INFO",
id="PACKAGE_UPDATES_CHECK_SKIP_NO_PUBLIC_REPOSITORIES",
title="Did not perform the package updates check",
description="Please refer to the diagnosis for further information",
description="Refer to the diagnosis for further information.",
diagnosis=(
"Did not perform the check because there were no publicly available %s %d.%d repositories available."
% (system_info.name, system_info.version.major, system_info.version.minor)
Expand Down Expand Up @@ -71,7 +71,7 @@ def run(self):
level="WARNING",
id="PACKAGE_UP_TO_DATE_CHECK_MESSAGE",
title="Package up to date check fail",
description="Please refer to the diagnosis for further information",
description="Refer to the diagnosis for further information.",
diagnosis=package_up_to_date_error_message,
)
return
Expand All @@ -90,7 +90,7 @@ def run(self):
level="WARNING",
id="OUT_OF_DATE_PACKAGES",
title="Outdated packages detected",
description="Please refer to the diagnosis for further information",
description="Refer to the diagnosis for further information.",
diagnosis=package_not_up_to_date_error_message,
remediations="Run yum update to update all the packages on the system.",
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def run(self):
level="ERROR",
id=e.error_id,
title="Incompatible booted kernel version",
description="Please refer to the diagnosis for further information",
description="Refer to the diagnosis for further information.",
diagnosis=(
"The booted kernel version is incompatible with the standard RHEL kernel. {}".format(
bad_kernel_message
Expand Down
8 changes: 4 additions & 4 deletions convert2rhel/actions/system_checks/tainted_kmods.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def run(self):
level="OVERRIDABLE",
id="TAINTED_KMODS_DETECTED",
title="Tainted kernel modules detected",
description="Please refer to the diagnosis for further information",
description="Refer to the diagnosis for further information.",
diagnosis=diagnosis,
remediations=(
"Prevent the modules from loading by following {0}"
Expand All @@ -66,7 +66,7 @@ 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(
" For information on what a tainted kernel module is, refer to this documentation {1}".format(
LINK_PREVENT_KMODS_FROM_LOADING, LINK_TAINTED_KMOD_DOCS
)
),
Expand All @@ -87,12 +87,12 @@ def run(self):
level="WARNING",
id="TAINTED_KMODS_DETECTED_MESSAGE",
title="Tainted kernel modules detected",
description="Please refer to the diagnosis for further information",
description="Refer to the diagnosis for further information.",
diagnosis=diagnosis,
remediations=(
"Prevent the modules from loading by following {0}"
" and run convert2rhel again to continue with the conversion."
" For information on what a tainted kernel module is, please refer to this documentation {1}".format(
" For information on what a tainted kernel module is, refer to this documentation {1}".format(
LINK_PREVENT_KMODS_FROM_LOADING, LINK_TAINTED_KMOD_DOCS
)
),
Expand Down
2 changes: 1 addition & 1 deletion convert2rhel/subscription.py
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ def attach_subscription():
# Unsuccessful attachment, e.g. the pool ID is incorrect or the
# number of purchased attachments has been depleted.
logger.critical_no_exit(
"Unsuccessful attachment of a subscription. Please refer to https://access.redhat.com/management/"
"Unsuccessful attachment of a subscription. Refer to https://access.redhat.com/management/"
" where you can either enable the SCA, create an activation key, or find a Pool ID of the subscription"
" you wish to use and pass it to convert2rhel through the `--pool` CLI option."
)
Expand Down
4 changes: 2 additions & 2 deletions convert2rhel/toolopts/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ def _handle_config_conflict(self, config_sources):

if (cli_config.password or file_config.password) and not (cli_config.username or file_config.username):
loggerinst.warning(
"You have passed the RHSM password without an associated username. Please provide a username together"
"You have passed the RHSM password without an associated username. Provide a username together"
" with the password."
)

if (cli_config.username or file_config.username) and not (cli_config.password or file_config.password):
loggerinst.warning(
"You have passed the RHSM username without an associated password. Please provide a password together"
"You have passed the RHSM username without an associated password. Provide a password together"
" with the username."
)

Expand Down
4 changes: 2 additions & 2 deletions convert2rhel/toolopts/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,13 +292,13 @@ def _validate(self, opts):

if opts["username"] and not opts["password"]:
loggerinst.warning(
"You have passed the RHSM username without an associated password. Please provide a password together"
"You have passed the RHSM username without an associated password. Provide a password together"
" with the username."
)

if opts["password"] and not opts["username"]:
loggerinst.warning(
"You have passed the RHSM password without an associated username. Please provide a username together"
"You have passed the RHSM password without an associated username. Provide a username together"
" with the password."
)

Expand Down
Loading

0 comments on commit 3619535

Please sign in to comment.