Bug 1977452
| Summary: | typo in string format change | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 9 | Reporter: | John Sefler <jsefler> |
| Component: | subscription-manager | Assignee: | candlepin-bugs |
| Status: | CLOSED ERRATA | QA Contact: | Red Hat subscription-manager QE Team <rhsm-qe> |
| Severity: | low | Docs Contact: | |
| Priority: | medium | ||
| Version: | 9.0 | CC: | csnyder, ptoscano, redakkan, zpetrace |
| Target Milestone: | beta | Keywords: | EasyFix, Triaged |
| Target Release: | 9.0 | Flags: | pm-rhel:
mirror+
|
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | subscription-manager-1.29.21-1.el9 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2022-05-17 15:58:13 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
John Sefler
2021-06-29 19:06:20 UTC
To be fair: the situation of quoting for paths and directories in messages is a mess. Sometimes there are, sometimes there are not, sometimes a path is quoted while a nearby/close/related message is not. Rather than fixing the two reported issues, I'd settle for a uniform style first, and apply it on all the messages at once. Pre-verification:
Commit 1: @jsefler has an automated test for this case, which passed + we reviewed the following code change:
from print(_('File "%s" exists. Use -f to force overwriting the file.') % e.filename)
to print(_('File {filename} exists. Use -f to force overwriting the file.').format(filename=e.filename))
--> PASSED
Commit 2: After discussion we just reviewed the following code change with @jsefler
from msgs.append(_("Please visit https://access.redhat.com/management/consumers/%s to view the profile details.") % identity.uuid)
to msgs.append(_("Please visit https://access.redhat.com/management/consumers/{identity_uuid} to view the "
" profile details.").format(identity_uuid=identity.uuid))
--> PASSED
(In reply to Zdenek Petracek from comment #3) > Pre-verification: using CI build: [root@kvm-08-guest04 ~]# rpm -q subscription-manager subscription-manager-1.29.21-1.git.15.4ce9da7.el9.x86_64 > > Commit 1: @jsefler has an automated test for this case, which passed + we reviewed the following code change: > > from print(_('File "%s" exists. Use -f to force overwriting the file.') % e.filename) > to print(_('File {filename} exists. Use -f to force overwriting the file.').format(filename=e.filename)) Correction: to [root@kvm-08-guest04 ~]# grep "Use -f to force overwriting" /usr/lib64/python3.9/site-packages/rct/manifest_commands.py print(_('File "{filename}" exists. Use -f to force overwriting the file.').format(filename=e.filename)) > > --> PASSED > > Commit 2: After discussion we just reviewed the following code change with @jsefler > > from msgs.append(_("Please visit https://access.redhat.com/management/consumers/%s to view the profile details.") % identity.uuid) > to msgs.append(_("Please visit https://access.redhat.com/management/consumers/{identity_uuid} to view the " > " profile details.").format(identity_uuid=identity.uuid)) Correction: These lines of code are no longer applicable in RHEL9 because they belonged to migrate.py provided by package subscription-manager-migration which has been dropped and were removed with main pull request https://github.com/candlepin/subscription-manager/pull/2742... [root@kvm-08-guest04 ~]# rpm -q subscription-manager --changelog | grep "Drop RHN" - Drop RHN migration (ptoscano) > > --> PASSED Here is an example demonstrating the double quoting fix using a sample manifest zip file...
[root@kvm-08-guest04 test-manifests]# rpm -q subscription-manager --changelog | grep 1977452
- 1977452: typo in string format change Add quotes to a {filename} and remove
[root@kvm-08-guest04 test-manifests]#
[root@kvm-08-guest04 test-manifests]# rct dump-manifest manifest_MCT0370.zip --destination /tmp
The manifest has been dumped to the /tmp directory
[root@kvm-08-guest04 test-manifests]# rct dump-manifest manifest_MCT0370.zip --destination /tmp
File "/tmp/signature" exists. Use -f to force overwriting the file.
^^^^^^^^^^^^^^^^
Verified:Tested - double quotes are now being used to surround the filename in the messaging.
Verifying on :
# subscription-manager version
server type: This system is currently not registered.
subscription management server: 3.2.21-1
subscription management rules: 5.41
subscription-manager: 1.29.21-1.el9
# rpm -q subscription-manager --changelog | grep 1977452
- 1977452: typo in string format change Add quotes to a {filename} and remove
# rct dump-manifest 51da16bd-1300-475d-922f-379e06c3231f_certificates.zip --destination /tmp
The manifest has been dumped to the /tmp directory
# rct dump-manifest 51da16bd-1300-475d-922f-379e06c3231f_certificates.zip --destination /tmp
File "/tmp/signature" exists. Use -f to force overwriting the file.
^^ notice the file name is now in quotes.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (new packages: subscription-manager), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2022:3984 |