Skip to content

Commit 5457d34

Browse files
committed
Format messages for consistency
- no full stop at the end of a title - no word please (technical writers' rule) - unique message ids - fix typos - add missing context where messages are too short and vague
1 parent 3ab1a44 commit 5457d34

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+330
-337
lines changed

convert2rhel/actions/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ def run(self, successes=None, failures=None, skips=None):
559559
title="Skipped action",
560560
description="This action was skipped due to another action failing.",
561561
diagnosis=diagnosis,
562-
remediations="Please ensure that the {} check passes so that this Action can evaluate your system".format(
562+
remediations="Ensure that the {} check passes so that this Action can evaluate your system".format(
563563
utils.format_sequence_as_message(failed_deps)
564564
),
565565
)
@@ -586,7 +586,7 @@ def run(self, successes=None, failures=None, skips=None):
586586

587587
# Categorize the results
588588
if action.result.level <= STATUS_CODE["WARNING"]:
589-
logger.info("{} has succeeded".format(action.id))
589+
logger.info("The {} action has succeeded.".format(action.id))
590590
successes.append(action)
591591

592592
if action.result.level > STATUS_CODE["WARNING"]:

convert2rhel/actions/conversion/list_non_red_hat_pkgs_left.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def run(self):
3434
super(ListNonRedHatPkgsLeft, self).run()
3535
loggerinst.task("List remaining non-Red Hat packages")
3636

37-
loggerinst.info("Listing packages not signed by Red Hat")
37+
loggerinst.info("Listing packages not signed by Red Hat.")
3838
non_red_hat_pkgs = get_installed_pkgs_w_different_key_id(system_info.key_ids_rhel)
3939
if not non_red_hat_pkgs:
4040
loggerinst.info("All packages are now signed by Red Hat.")

convert2rhel/actions/conversion/preserve_only_rhel_kernel.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def run(self):
5151
id="FAILED_TO_INSTALL_RHEL_KERNEL",
5252
title="Failed to install RHEL kernel",
5353
description="There was an error while attempting to install the RHEL kernel from yum.",
54-
remediations="Please check that you can access the repositories that provide the RHEL kernel.",
54+
remediations="Check that you can access the repositories that provide the RHEL kernel.",
5555
)
5656
return
5757

@@ -131,7 +131,7 @@ def run(self):
131131
"""Verify that the RHEL kernel has been successfully installed and raise an ERROR if not"""
132132
super(VerifyRhelKernelInstalled, self).run()
133133

134-
loggerinst.info("Verifying that RHEL kernel has been installed")
134+
loggerinst.info("Verifying that RHEL kernel has been installed.")
135135
installed_rhel_kernels = pkghandler.get_installed_pkgs_by_key_id(system_info.key_ids_rhel, name="kernel")
136136
if len(installed_rhel_kernels) <= 0:
137137
self.set_result(
@@ -180,7 +180,7 @@ def run(self):
180180
for entry in boot_entries:
181181
# The boot loader entries in /boot/loader/entries/<machine-id>-<kernel-version>.conf
182182
if machine_id not in os.path.basename(entry):
183-
loggerinst.debug("Removing boot entry {}".format(entry))
183+
loggerinst.debug("Removing boot entry {}.".format(entry))
184184
os.remove(entry)
185185

186186
# Removing a boot entry that used to be the default makes grubby to choose a different entry as default,
@@ -224,7 +224,7 @@ def run(self):
224224
"""
225225
super(FixDefaultKernel, self).run()
226226

227-
loggerinst.info("Checking for incorrect boot kernel")
227+
loggerinst.info("Checking for incorrect boot kernel.")
228228
kernel_sys_cfg = utils.get_file_content("/etc/sysconfig/kernel")
229229

230230
possible_kernels = ["kernel-uek", "kernel-plus"]
@@ -246,7 +246,7 @@ def run(self):
246246

247247
kernel_sys_cfg = kernel_sys_cfg.replace("DEFAULTKERNEL=" + kernel_to_change, new_kernel_str)
248248
utils.store_content_to_file("/etc/sysconfig/kernel", kernel_sys_cfg)
249-
loggerinst.info("Boot kernel {} was changed to {}".format(kernel_to_change, new_kernel_str))
249+
loggerinst.info("Boot kernel {} was changed to {}.".format(kernel_to_change, new_kernel_str))
250250
else:
251251
loggerinst.debug("Boot kernel validated.")
252252

@@ -270,7 +270,7 @@ def remove_non_rhel_kernels(self):
270270
loggerinst.info("None found.")
271271
return None
272272

273-
loggerinst.info("Removing non-RHEL kernels\n")
273+
loggerinst.info("Removing non-RHEL kernels.\n")
274274
pkghandler.print_pkg_info(non_rhel_kernels)
275275
pkgs_to_remove = [pkghandler.get_pkg_nvra(pkg) for pkg in non_rhel_kernels]
276276
utils.remove_pkgs(pkgs_to_remove)
@@ -288,7 +288,7 @@ def install_additional_rhel_kernel_pkgs(self, additional_pkgs):
288288
pkg_names = [p.nevra.name.replace(ol_kernel_ext, "", 1) for p in additional_pkgs]
289289
for name in set(pkg_names):
290290
if name != "kernel":
291-
loggerinst.info("Installing RHEL {}".format(name))
291+
loggerinst.info("Installing RHEL {}.".format(name))
292292
pkgmanager.call_yum_cmd("install", args=[name])
293293

294294

convert2rhel/actions/conversion/set_efi_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def run(self):
169169
)
170170
continue
171171

172-
logger.info("Moving '{}' to '{}'".format(src_file, dst_file))
172+
logger.info("Moving '{}' to '{}'.".format(src_file, dst_file))
173173

174174
try:
175175
shutil.move(src_file, dst_file)

convert2rhel/actions/post_conversion/hostmetering.py

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ def run(self):
6060
logger.info("Did not perform host metering configuration. Only supported for RHEL 7.")
6161
self.add_message(
6262
level="INFO",
63-
id="CONFIGURE_HOST_METERING_SKIP",
64-
title="Did not perform host metering configuration.",
65-
description="Host metering is supportted only for RHEL 7.",
63+
id="CONFIGURE_HOST_METERING_SKIP_ONLY_RHEL_7",
64+
title="Did not perform host metering configuration",
65+
description="Host metering is supported only for RHEL 7.",
6666
)
6767
return False
6868

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

@@ -85,8 +85,8 @@ def run(self):
8585
self.add_message(
8686
level="WARNING",
8787
id="INSTALL_HOST_METERING_FAILURE",
88-
title="Failed to install host metering package.",
89-
description="When installing host metering package an error occurred meaning we can't"
88+
title="Failed to install the host-metering package",
89+
description="When installing the host-metering package an error occurred meaning we can't"
9090
" enable host metering on the system.",
9191
diagnosis="`yum install host-metering` command returned {ret_install} with message {output}".format(
9292
ret_install=ret_install, output=output
@@ -105,9 +105,9 @@ def run(self):
105105
self.add_message(
106106
level="WARNING",
107107
id="CONFIGURE_HOST_METERING_FAILURE",
108-
title="Failed to enable and start host metering service.",
108+
title="Failed to enable and start the host metering service",
109109
description="The host metering service failed to start"
110-
" successfully and won't be able to keep track.",
110+
" successfully and won't be able to report on the use of the system for the billing purposes.",
111111
diagnosis="Command {command} failed with {error_message}".format(
112112
command=command, error_message=error_message
113113
),
@@ -125,7 +125,7 @@ def run(self):
125125
self.set_result(
126126
level="ERROR",
127127
id="HOST_METERING_NOT_RUNNING",
128-
title="Host metering service is not running.",
128+
title="Host metering service is not running",
129129
description="host-metering.service is not running.",
130130
remediations="You can try to start the service manually"
131131
" by running following command:\n"
@@ -145,8 +145,8 @@ def _check_env_var(self):
145145
logger.debug("CONVERT2RHEL_CONFIGURE_HOST_METERING was not set. Skipping it.")
146146
self.add_message(
147147
level="INFO",
148-
id="CONFIGURE_HOST_METERING_SKIP",
149-
title="Did not perform host metering configuration.",
148+
id="CONFIGURE_HOST_METERING_SKIP_OPTION_NOT_DETECTED",
149+
title="Did not perform host metering configuration",
150150
description="CONVERT2RHEL_CONFIGURE_HOST_METERING was not set.",
151151
)
152152
return False
@@ -167,19 +167,22 @@ def _check_env_var(self):
167167
if tool_opts.configure_host_metering == "force":
168168
logger.warning(
169169
"The `force' option has been used for the CONVERT2RHEL_CONFIGURE_HOST_METERING environment variable."
170-
" Please note that this option is mainly used for testing and will configure host-metering unconditionally. "
171-
" For generic usage please use the 'auto' option."
170+
" Note that this option is mainly used for testing and will configure host-metering unconditionally. "
171+
" For generic usage use the 'auto' option."
172172
)
173173
self.add_message(
174174
level="WARNING",
175175
id="FORCED_CONFIGURE_HOST_METERING",
176176
title="The `force' option has been used for the CONVERT2RHEL_CONFIGURE_HOST_METERING environment variable.",
177-
description="Please note that this option is mainly used for testing and"
177+
description="Note that this option is mainly used for testing and"
178178
" will configure host-metering unconditionally."
179-
" For generic usage please use the 'auto' option.",
179+
" For generic usage use the 'auto' option.",
180180
)
181181
elif tool_opts.configure_host_metering == "auto":
182-
logger.debug("Automatic detection of host hyperscaler and configuration.")
182+
logger.debug(
183+
"Configuration of host metering set to 'auto' - host-metering will be enabled based on"
184+
" a detected hyperscaler."
185+
)
183186

184187
return True
185188

convert2rhel/actions/post_conversion/modified_rpm_files_diff.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def run(self):
4646
self.add_message(
4747
level="INFO",
4848
id="SKIPPED_MODIFIED_RPM_FILES_DIFF",
49-
title="Skipped comparison of 'rpm -Va' output from before and after the conversion.",
49+
title="Skipped comparison of 'rpm -Va' output from before and after the conversion",
5050
description="Comparison of 'rpm -Va' output was not performed due to missing output "
5151
"of the 'rpm -Va' run before the conversion.",
5252
diagnosis="This is caused mainly by using '--no-rpm-va' argument for convert2rhel.",
@@ -76,8 +76,8 @@ def run(self):
7676
self.add_message(
7777
level="INFO",
7878
id="FOUND_MODIFIED_RPM_FILES",
79-
title="Modified rpm files from before and after the conversion were found.",
80-
description="Comparison of modified rpm files from before and after " "the conversion: \n{}".format(
79+
title="Modified rpm files from before and after the conversion were found",
80+
description="Comparison of modified rpm files from before and after the conversion: \n{}".format(
8181
modified_rpm_files_diff
8282
),
8383
)

convert2rhel/actions/post_conversion/remove_tmp_dir.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def run(self):
4545

4646
try:
4747
shutil.rmtree(self.tmp_dir)
48-
loggerinst.info("Temporary folder {} removed".format(self.tmp_dir))
48+
loggerinst.info("Temporary folder {} removed.".format(self.tmp_dir))
4949
except OSError as exc:
5050
# We want run() to be idempotent, so do nothing silently if
5151
# the path doesn't exist.
@@ -61,6 +61,6 @@ def run(self):
6161
self.add_message(
6262
level="WARNING",
6363
id="UNSUCCESSFUL_REMOVE_TMP_DIR",
64-
title="Temporary folder {tmp_dir} wasn't removed.".format(tmp_dir=self.tmp_dir),
64+
title="Temporary folder {tmp_dir} wasn't removed".format(tmp_dir=self.tmp_dir),
6565
description=warning_message,
6666
)

convert2rhel/actions/post_conversion/update_grub.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def run(self):
7979
level="ERROR",
8080
id="FAILED_TO_IDENTIFY_GRUB2_BLOCK_DEVICE",
8181
title="Failed to identify GRUB2 block device",
82-
description="The block device could not be identified, please look at the diagnosis "
82+
description="The block device could not be identified. Look at the diagnosis "
8383
"for more information.",
8484
diagnosis=str(e),
8585
)

convert2rhel/actions/pre_ponr_changes/backup_system.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class BackupRedhatRelease(actions.Action):
5252

5353
def run(self):
5454
"""Backup redhat release file before starting conversion process"""
55-
logger.task("Backup Redhat Release Files")
55+
logger.task("Backup redhat-release files")
5656

5757
super(BackupRedhatRelease, self).run()
5858

@@ -178,7 +178,6 @@ def _get_changed_package_files(self):
178178
"""Get the output from rpm -Va command from during resolving system info
179179
to get changes made to package files.
180180
181-
182181
:return dict: Return them as a list of dict, for example:
183182
[{"status":"S5T", "file_type":"c", "path":"/etc/yum.repos.d/CentOS-Linux-AppStream.repo"}]
184183
"""
@@ -196,10 +195,9 @@ def _get_changed_package_files(self):
196195
# Return empty list results in no backup of the files
197196
return data
198197
else:
199-
# The file should be there
200-
# If missing conversion is in unknown state
198+
# The file should be there. If missing, the conversion is in an unknown state.
201199
logger.warning("Error({}): {}".format(err.errno, err.strerror))
202-
logger.critical("Missing file {rpm_va_output} in it's location".format(rpm_va_output=path))
200+
logger.critical("The file {rpm_va_output} is missing.".format(rpm_va_output=path))
203201

204202
lines = output.strip().split("\n")
205203
for line in lines:
@@ -217,7 +215,7 @@ def _parse_line(self, line):
217215
if not match: # line not matching the regex
218216
if line.strip() != "":
219217
# Line is not empty string
220-
logger.debug("Skipping invalid output {}".format(line))
218+
logger.debug("Skipping invalid output: {}".format(line))
221219
return {"status": None, "file_type": None, "path": None}
222220

223221
line = line.split()

convert2rhel/actions/pre_ponr_changes/handle_packages.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def run(self):
110110

111111
all_pkgs = excluded_pkgs + repofile_pkgs
112112
if not all_pkgs:
113-
logger.info("No packages to backup and remove.")
113+
logger.info("No packages to back up and remove.")
114114
return
115115

116116
# We're using the backed up yum repositories to prevent the following:
@@ -146,8 +146,8 @@ def run(self):
146146
self.set_result(
147147
level="ERROR",
148148
id="SPECIAL_PACKAGE_REMOVAL_FAILED",
149-
title="Failed to remove some packages necessary for the conversion.",
150-
description="The cause of this error is unknown, please look at the diagnosis for more information.",
149+
title="Failed to remove some packages necessary for the conversion",
150+
description="The cause of this error is unknown. Look at the diagnosis for more information.",
151151
diagnosis=str(e),
152152
)
153153
return
@@ -161,7 +161,7 @@ def run(self):
161161
level="WARNING",
162162
id="SPECIAL_PACKAGES_NOT_REMOVED",
163163
title="Special packages not removed",
164-
description="Special packages which could not be removed",
164+
description="Certain packages could not be removed.",
165165
diagnosis=message,
166166
)
167167

@@ -170,7 +170,7 @@ def run(self):
170170
logger.info(message)
171171
self.add_message(
172172
level="INFO",
173-
id="SPECIAL_PACKAGES_REMOVED",
173+
id="SPECIAL_PACKAGES_TO_REMOVE",
174174
title="Special packages to be removed",
175175
description=(
176176
"We have identified installed packages that match a pre-defined list of packages that are"
@@ -197,7 +197,7 @@ def _remove_packages_unless_from_redhat(pkgs_list, disable_repos=None):
197197
pkghandler.print_pkg_info(pkgs_list, disable_repos)
198198

199199
pkgs_removed = utils.remove_pkgs(pkghandler.get_pkg_nevras(pkgs_list))
200-
logger.debug("Successfully removed {} packages".format(len(pkgs_list)))
200+
logger.debug("Successfully removed {} packages.".format(len(pkgs_list)))
201201

202202
return pkgs_removed
203203

0 commit comments

Comments
 (0)