-
Notifications
You must be signed in to change notification settings - Fork 85
[RHELC-1761] Format messages for consistency #1438
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Dot removed here as well
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is intentional. It's one of the goals of the PR - to remove full stops from message titles for consistency. Most titles didn't have it, so I opted for removing them from all. The message titles are printed this way: In Insights they are displayed in this fashion: In both cases (CLI, Insights) it's more suitable to have the titles without full stops. |
||
| 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.", | ||
|
|
@@ -76,8 +76,8 @@ 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.", | ||
| description="Comparison of modified rpm files from before and after " "the conversion: \n{}".format( | ||
| 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 | ||
| ), | ||
| ) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -51,8 +51,8 @@ class BackupRedhatRelease(actions.Action): | |
| id = "BACKUP_REDHAT_RELEASE" | ||
|
|
||
| def run(self): | ||
| """Backup redhat release file before starting conversion process""" | ||
| logger.task("Backup Redhat Release Files") | ||
| """Back up redhat release file before starting conversion process""" | ||
| logger.task("Back up redhat-release files") | ||
|
|
||
|
Comment on lines
+54
to
56
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would say Backup instead of back up. What is the Red Hat preferred word?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Backup is a noun, back up is a verb. |
||
| super(BackupRedhatRelease, self).run() | ||
|
|
||
|
|
@@ -79,7 +79,7 @@ class BackupRepository(actions.Action): | |
|
|
||
| def run(self): | ||
| """Backup .repo files in /etc/yum.repos.d/ so the repositories can be restored on rollback.""" | ||
| logger.task("Backup Repository Files") | ||
| logger.task("Back up repository files") | ||
|
|
||
| super(BackupRepository, self).run() | ||
|
|
||
|
|
@@ -105,7 +105,7 @@ class BackupYumVariables(actions.Action): | |
|
|
||
| def run(self): | ||
| """Backup varsdir folder in /etc/{yum,dnf}/vars so the variables can be restored on rollback.""" | ||
| logger.task("Backup variables") | ||
| logger.task("Back up variables") | ||
|
|
||
| super(BackupYumVariables, self).run() | ||
|
|
||
|
|
@@ -146,7 +146,7 @@ def run(self): | |
| """Backup changed package files""" | ||
| super(BackupPackageFiles, self).run() | ||
|
|
||
| logger.task("Backup package files") | ||
| logger.task("Back up package files") | ||
|
|
||
| package_files_changes = self._get_changed_package_files() | ||
|
|
||
|
|
@@ -178,7 +178,6 @@ def _get_changed_package_files(self): | |
| """Get the output from rpm -Va command from during resolving system info | ||
| to get changes made to package files. | ||
|
|
||
|
|
||
| :return dict: Return them as a list of dict, for example: | ||
| [{"status":"S5T", "file_type":"c", "path":"/etc/yum.repos.d/CentOS-Linux-AppStream.repo"}] | ||
| """ | ||
|
|
@@ -199,10 +198,9 @@ def _get_changed_package_files(self): | |
| # Return empty list results in no backup of the files | ||
| return data | ||
| else: | ||
| # The file should be there | ||
| # If missing conversion is in unknown state | ||
| # The file should be there. If missing, the conversion is in an unknown state. | ||
| logger.warning("Error({}): {}".format(err.errno, err.strerror)) | ||
| logger.critical("Missing file {rpm_va_output} in it's location".format(rpm_va_output=path)) | ||
| logger.critical("The file {rpm_va_output} is missing.".format(rpm_va_output=path)) | ||
|
|
||
| lines = output.strip().split("\n") | ||
| for line in lines: | ||
|
|
@@ -220,7 +218,7 @@ def _parse_line(self, line): | |
| if not match: # line not matching the regex | ||
| if line.strip() != "": | ||
| # Line is not empty string | ||
| logger.debug("Skipping invalid output {}".format(line)) | ||
| logger.debug("Skipping invalid output: {}".format(line)) | ||
| return {"status": None, "file_type": None, "path": None} | ||
|
|
||
| line = line.split() | ||
|
|
||

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be unique as most don't have a dot in them, but definitely more valid with a dot than without. Just an FYI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most info messages had a full stop. For consistency I've added the full stop to all of them (and to other levels such as debug or critical as well).