Skip to content

Commit e5b5f5c

Browse files
committed
Format messages for consistency
- no full stop at the end of a report message title - no word please (technical writers' rule) - unique report message ids - fix typos - add missing context where messages are too short and vague - make TASK tense consistent
1 parent cce2401 commit e5b5f5c

File tree

68 files changed

+335
-336
lines changed

Some content is hidden

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

68 files changed

+335
-336
lines changed

convert2rhel/actions/__init__.py

Lines changed: 3 additions & 3 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"]:
@@ -742,7 +742,7 @@ def run_pre_actions():
742742
# When we call check_dependencies() or run() on the first Stage
743743
# (system_checks), it will operate on the first Stage and then recursively
744744
# call check_dependencies() or run() on the next_stage.
745-
pre_ponr_changes = Stage("pre_ponr_changes", "Making recoverable changes")
745+
pre_ponr_changes = Stage("pre_ponr_changes", "Make recoverable changes")
746746
system_checks = Stage("system_checks", "Check whether system is ready for conversion", next_stage=pre_ponr_changes)
747747

748748
try:

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: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def run(self):
9696
for entry in boot_entries:
9797
# The boot loader entries in /boot/loader/entries/<machine-id>-<kernel-version>.conf
9898
if machine_id not in os.path.basename(entry):
99-
loggerinst.debug("Removing boot entry {}".format(entry))
99+
loggerinst.debug("Removing boot entry {}.".format(entry))
100100
os.remove(entry)
101101

102102
# Removing a boot entry that used to be the default makes grubby to choose a different entry as default,
@@ -140,7 +140,7 @@ def run(self):
140140
"""
141141
super(FixDefaultKernel, self).run()
142142

143-
loggerinst.info("Checking for incorrect boot kernel")
143+
loggerinst.info("Checking for incorrect boot kernel.")
144144
kernel_sys_cfg = utils.get_file_content("/etc/sysconfig/kernel")
145145

146146
possible_kernels = ["kernel-uek", "kernel-plus"]
@@ -162,7 +162,7 @@ def run(self):
162162

163163
kernel_sys_cfg = kernel_sys_cfg.replace("DEFAULTKERNEL=" + kernel_to_change, new_kernel_str)
164164
utils.store_content_to_file("/etc/sysconfig/kernel", kernel_sys_cfg)
165-
loggerinst.info("Boot kernel {} was changed to {}".format(kernel_to_change, new_kernel_str))
165+
loggerinst.info("Boot kernel {} was changed to {}.".format(kernel_to_change, new_kernel_str))
166166
else:
167167
loggerinst.debug("Boot kernel validated.")
168168

@@ -186,7 +186,7 @@ def remove_non_rhel_kernels(self):
186186
loggerinst.info("None found.")
187187
return None
188188

189-
loggerinst.info("Removing non-RHEL kernels\n")
189+
loggerinst.info("Removing non-RHEL kernels.\n")
190190
pkghandler.print_pkg_info(non_rhel_kernels)
191191
pkgs_to_remove = [pkghandler.get_pkg_nvra(pkg) for pkg in non_rhel_kernels]
192192
utils.remove_pkgs(pkgs_to_remove)
@@ -204,7 +204,7 @@ def install_additional_rhel_kernel_pkgs(self, additional_pkgs):
204204
pkg_names = [p.nevra.name.replace(ol_kernel_ext, "", 1) for p in additional_pkgs]
205205
for name in set(pkg_names):
206206
if name != "kernel":
207-
loggerinst.info("Installing RHEL {}".format(name))
207+
loggerinst.info("Installing RHEL {}.".format(name))
208208
pkgmanager.call_yum_cmd("install", args=[name])
209209

210210

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
@@ -56,9 +56,9 @@ def run(self):
5656
logger.info("Did not perform host metering configuration. Only supported for RHEL 7.")
5757
self.add_message(
5858
level="INFO",
59-
id="CONFIGURE_HOST_METERING_SKIP",
60-
title="Did not perform host metering configuration.",
61-
description="Host metering is supportted only for RHEL 7.",
59+
id="CONFIGURE_HOST_METERING_SKIP_ONLY_RHEL_7",
60+
title="Did not perform host metering configuration",
61+
description="Host metering is supported only for RHEL 7.",
6262
)
6363
return False
6464

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

@@ -81,8 +81,8 @@ def run(self):
8181
self.add_message(
8282
level="WARNING",
8383
id="INSTALL_HOST_METERING_FAILURE",
84-
title="Failed to install host metering package.",
85-
description="When installing host metering package an error occurred meaning we can't"
84+
title="Failed to install the host-metering package",
85+
description="When installing the host-metering package an error occurred meaning we can't"
8686
" enable host metering on the system.",
8787
diagnosis="`yum install host-metering` command returned {ret_install} with message {output}".format(
8888
ret_install=ret_install, output=output
@@ -101,9 +101,9 @@ def run(self):
101101
self.add_message(
102102
level="WARNING",
103103
id="CONFIGURE_HOST_METERING_FAILURE",
104-
title="Failed to enable and start host metering service.",
104+
title="Failed to enable and start the host metering service",
105105
description="The host metering service failed to start"
106-
" successfully and won't be able to keep track.",
106+
" successfully and won't be able to report on the use of the system for the billing purposes.",
107107
diagnosis="Command {command} failed with {error_message}".format(
108108
command=command, error_message=error_message
109109
),
@@ -121,7 +121,7 @@ def run(self):
121121
self.set_result(
122122
level="ERROR",
123123
id="HOST_METERING_NOT_RUNNING",
124-
title="Host metering service is not running.",
124+
title="Host metering service is not running",
125125
description="host-metering.service is not running.",
126126
remediations="You can try to start the service manually"
127127
" by running following command:\n"
@@ -141,8 +141,8 @@ def _check_host_metering_configuration(self):
141141
logger.debug("Configuration of host metering has not been enabled. Skipping it.")
142142
self.add_message(
143143
level="INFO",
144-
id="CONFIGURE_HOST_METERING_SKIP",
145-
title="Did not perform host metering configuration.",
144+
id="CONFIGURE_HOST_METERING_SKIP_OPTION_NOT_DETECTED",
145+
title="Did not perform host metering configuration",
146146
description="Configuration of host metering has been skipped.",
147147
diagnosis="We haven't detected 'configure_host_metering' in the convert2rhel.ini config file nor"
148148
" the CONVERT2RHEL_CONFIGURE_HOST_METERING environment variable.",
@@ -172,19 +172,22 @@ def _check_host_metering_configuration(self):
172172
if tool_opts.configure_host_metering == "force":
173173
logger.warning(
174174
"You've set the host metering setting to 'force'."
175-
" Please note that this option is mainly used for testing and will configure host-metering unconditionally. "
176-
" For generic usage please use the 'auto' option."
175+
" Note that this option is mainly used for testing and will configure host-metering unconditionally. "
176+
" For generic usage use the 'auto' option."
177177
)
178178
self.add_message(
179179
level="WARNING",
180180
id="FORCED_CONFIGURE_HOST_METERING",
181181
title="Configuration of host metering set to 'force'",
182-
description="Please note that this option is mainly used for testing and"
182+
description="Note that this option is mainly used for testing and"
183183
" will configure host-metering unconditionally."
184-
" For generic usage please use the 'auto' option.",
184+
" For generic usage use the 'auto' option.",
185185
)
186186
elif tool_opts.configure_host_metering == "auto":
187-
logger.debug("Automatic detection of host hyperscaler and configuration.")
187+
logger.debug(
188+
"Configuration of host metering set to 'auto' - host-metering will be enabled based on"
189+
" a detected hyperscaler."
190+
)
188191

189192
return True
190193

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
@@ -77,7 +77,7 @@ def run(self):
7777
level="ERROR",
7878
id="FAILED_TO_IDENTIFY_GRUB2_BLOCK_DEVICE",
7979
title="Failed to identify GRUB2 block device",
80-
description="The block device could not be identified, please look at the diagnosis "
80+
description="The block device could not be identified. Look at the diagnosis "
8181
"for more information.",
8282
diagnosis=str(e),
8383
)

convert2rhel/actions/pre_ponr_changes/backup_system.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ class BackupRedhatRelease(actions.Action):
5151
id = "BACKUP_REDHAT_RELEASE"
5252

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

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

@@ -79,7 +79,7 @@ class BackupRepository(actions.Action):
7979

8080
def run(self):
8181
"""Backup .repo files in /etc/yum.repos.d/ so the repositories can be restored on rollback."""
82-
logger.task("Backup Repository Files")
82+
logger.task("Back up repository Files")
8383

8484
super(BackupRepository, self).run()
8585

@@ -105,7 +105,7 @@ class BackupYumVariables(actions.Action):
105105

106106
def run(self):
107107
"""Backup varsdir folder in /etc/{yum,dnf}/vars so the variables can be restored on rollback."""
108-
logger.task("Backup variables")
108+
logger.task("Back up variables")
109109

110110
super(BackupYumVariables, self).run()
111111

@@ -146,7 +146,7 @@ def run(self):
146146
"""Backup changed package files"""
147147
super(BackupPackageFiles, self).run()
148148

149-
logger.task("Backup package files")
149+
logger.task("Back up package files")
150150

151151
package_files_changes = self._get_changed_package_files()
152152

@@ -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
"""
@@ -199,10 +198,9 @@ def _get_changed_package_files(self):
199198
# Return empty list results in no backup of the files
200199
return data
201200
else:
202-
# The file should be there
203-
# If missing conversion is in unknown state
201+
# The file should be there. If missing, the conversion is in an unknown state.
204202
logger.warning("Error({}): {}".format(err.errno, err.strerror))
205-
logger.critical("Missing file {rpm_va_output} in it's location".format(rpm_va_output=path))
203+
logger.critical("The file {rpm_va_output} is missing.".format(rpm_va_output=path))
206204

207205
lines = output.strip().split("\n")
208206
for line in lines:
@@ -220,7 +218,7 @@ def _parse_line(self, line):
220218
if not match: # line not matching the regex
221219
if line.strip() != "":
222220
# Line is not empty string
223-
logger.debug("Skipping invalid output {}".format(line))
221+
logger.debug("Skipping invalid output: {}".format(line))
224222
return {"status": None, "file_type": None, "path": None}
225223

226224
line = line.split()

convert2rhel/actions/pre_ponr_changes/custom_repos_are_valid.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ def run(self):
3939
logger.task("Check if --enablerepo repositories are accessible")
4040

4141
if not tool_opts.enablerepo:
42-
logger.info("Did not perform the check of repositories due to the use of RHSM for the conversion.")
42+
logger.info(
43+
"No repositories passed through --enablerepo. Skipping the check verifying the"
44+
" accessibility of the repositories."
45+
)
4346
return
4447

4548
output, ret_code = call_yum_cmd(
@@ -53,7 +56,7 @@ def run(self):
5356
id="UNABLE_TO_ACCESS_REPOSITORIES",
5457
title="Unable to access repositories",
5558
description="Access could not be made to the custom repositories.",
56-
diagnosis="Unable to access the repositories passed through the --enablerepo option.",
59+
diagnosis="Unable to access repositories passed through the --enablerepo option.",
5760
remediations="For more details, see YUM/DNF output:\n{0}".format(output),
5861
)
5962
return

0 commit comments

Comments
 (0)