Skip to content
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

Merged
merged 1 commit into from Jun 28, 2017

Conversation

tonyjames
Copy link

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.

@candlepin-bot
Copy link

Can one of the admins verify this patch?

@jirihnidek
Copy link
Contributor

@kahowell
Copy link
Contributor

ok to test

Copy link
Contributor

@kahowell kahowell left a 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"])
Copy link
Contributor

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 kahowell self-assigned this Jun 23, 2017
@tonyjames
Copy link
Author

@kahowell I just pushed another commit with your suggested changes.

@kahowell
Copy link
Contributor

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.

@kahowell kahowell merged commit 6c6eed4 into candlepin:master Jun 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants