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
Output the hostname of the system that was registered along with the UUID #1659
Conversation
Can one of the admins verify this patch? |
ok to test |
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.
@tonyjames thanks for the PR.
FYI, this will need some changes before we merge it; in addition to inline comments:
- commit message should contain the BZ# (I'll suggest commit subject: "1463325: Output consumer name on registration")
- some unit tests need to be updated; test.test_registration.CliRegistrationTests fails with KeyError: 'consumer_name'
If you'd like you can make these changes, or my team can pick it up. Thoughts?
@@ -1210,6 +1210,7 @@ def _do_command(self): | |||
restart_virt_who() | |||
|
|||
print((_("The system has been registered with ID: %s ")) % (consumer_info["uuid"])) | |||
print (_("The registered system name is: %s ")) % (consumer_info["consumer_name"]) |
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.
Please remove the trailing space after %s
.
Parentheses are a little out of order. Should be
print(_("The registered system name is: %s") % consumer_info["consumer_name"])
Please notice the parentheses are different - with what was there it was being interpreted as
(
print(_("The registered system name is: %s")) # statement result: None
%
consumer_info["consumer_name"] # statement result: hostname
) # unsupported operand type(s) for %: 'NoneType' and 'unicode'
(the print was happening before interpolation), rather than
print(
_("The registered system name is: %s")
%
consumer_info["consumer_name"]
)
where the print happens after interpolation, as intended.
@kahowell I just pushed another commit with your suggested changes. |
a5b65c6..e2daa7a: fix failing unit test, squash @tonyjames, ack. Looks good. I went ahead and made a small, necessary test fix, and squashed to a single commit. Once the Jenkins tests pass, I'll merge. |
This patch resolves BZ 1463325 which is a request for subscription-manager to output the hostname of the system that was registered along with the uuid.