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

Improve logging of the rhsm registration #499

Merged
merged 1 commit into from
Jun 8, 2022

Conversation

bocekm
Copy link
Member

@bocekm bocekm commented May 18, 2022

In a case where the system registration using --org and --activationkey failed, the logging message "Trying again - provide username and password." didn't make sense because we're not asking in that case for a username and a password.

Also I moved printing the "Gathering subscription-manager registration info" to be under the "Attempt 2 of 3: Registering" because the info gathering is actually already part of the next attempt.

Original output:

[05/18/2022 18:27:13] TASK - [Convert: Subscription Manager - Subscribe system] *****************
Gathering subscription-manager registration info ... 
    ... organization detected
    ... activation key detected
Registering the system using subscription-manager ...
The system has been registered with ID: 8159c801-909d-4b96-9331-3c61e1dc31a5
The registered system name is: c2r-20220518200001
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux for x86_64
Status:       Not Subscribed

Unable to find available subscriptions for all your installed products.
System registration failed with return code = 1
Trying again - provide username and password.
Gathering subscription-manager registration info ... 
    ... organization detected
    ... activation key detected
Attempt 2 of 3: Registering the system using subscription-manager ...
Unregistering from: domain.redhat.com:443/rhsm
The system with UUID 8159c801-909d-4b96-9331-3c61e1dc31a5 has been unregistered
All local data removed
The system has been registered with ID: 20ff0178-5e26-4769-8a10-3c1c1042bd05

New output:

[05/18/2022 18:27:13] TASK - [Convert: Subscription Manager - Subscribe system] *****************
Registering the system using subscription-manager ...
Gathering subscription-manager registration info ... 
    ... organization detected
    ... activation key detected
The system has been registered with ID: 8159c801-909d-4b96-9331-3c61e1dc31a5
The registered system name is: c2r-20220518200001
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux for x86_64
Status:       Not Subscribed

Unable to find available subscriptions for all your installed products.
System registration failed with return code = 1
Attempt 2 of 3: Registering the system using subscription-manager ...
Gathering subscription-manager registration info ... 
    ... organization detected
    ... activation key detected
Unregistering from: domain.redhat.com:443/rhsm
The system with UUID 8159c801-909d-4b96-9331-3c61e1dc31a5 has been unregistered
All local data removed
The system has been registered with ID: 20ff0178-5e26-4769-8a10-3c1c1042bd05

@codecov
Copy link

codecov bot commented May 18, 2022

Codecov Report

Merging #499 (41ff9ce) into main (41ff9ce) will not change coverage.
The diff coverage is n/a.

❗ Current head 41ff9ce differs from pull request most recent head 7f66e38. Consider uploading reports for the commit 7f66e38 to get more accurate results

@@           Coverage Diff           @@
##             main     #499   +/-   ##
=======================================
  Coverage   87.50%   87.50%           
=======================================
  Files          17       17           
  Lines        2400     2400           
  Branches      416      416           
=======================================
  Hits         2100     2100           
  Misses        239      239           
  Partials       61       61           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 41ff9ce...7f66e38. Read the comment docs.

@bocekm bocekm requested review from abadger and r0x0d May 18, 2022 19:01
@bocekm bocekm changed the title Improve logging of rhsm registration Improve logging of the rhsm registration May 18, 2022
@bocekm bocekm force-pushed the improve-rhsm-registration-logging branch from 29aed4b to 1c516ba Compare May 27, 2022 07:06
r0x0d
r0x0d previously approved these changes May 27, 2022
@r0x0d
Copy link
Member

r0x0d commented May 27, 2022

Just FYI, the slight decrease of codecov coverage is because this PR is removing some piece of code, that before, used to be covered.

@r0x0d
Copy link
Member

r0x0d commented May 27, 2022

/packit test

In a case where the system registration using --org and --activationkey
failed, the logging message "Trying again - provide username and
password." didn't make sense because we're not asking in that case for a
username and a password.
@bocekm bocekm force-pushed the improve-rhsm-registration-logging branch from 1c516ba to 7f66e38 Compare June 3, 2022 13:21
@r0x0d
Copy link
Member

r0x0d commented Jun 7, 2022

/packit test

1 similar comment
@r0x0d
Copy link
Member

r0x0d commented Jun 7, 2022

/packit test

@r0x0d r0x0d merged commit cb15f1a into oamg:main Jun 8, 2022
r0x0d pushed a commit to r0x0d/convert2rhel that referenced this pull request Jun 14, 2022
In a case where the system registration using --org and --activationkey
failed, the logging message "Trying again - provide username and
password." didn't make sense because we're not asking in that case for a
username and a password.
Andrew-ang9 pushed a commit to Andrew-ang9/convert2rhel that referenced this pull request Jun 17, 2022
In a case where the system registration using --org and --activationkey
failed, the logging message "Trying again - provide username and
password." didn't make sense because we're not asking in that case for a
username and a password.
abadger pushed a commit to hosekadam/convert2rhel that referenced this pull request Jun 28, 2022
In a case where the system registration using --org and --activationkey
failed, the logging message "Trying again - provide username and
password." didn't make sense because we're not asking in that case for a
username and a password.
@bocekm bocekm mentioned this pull request Aug 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants