Bug 2022786
| Summary: | Change the dispalyed message when user tries to list available roles and usage for an invalid org | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 9 | Reporter: | Rehana <redakkan> |
| Component: | subscription-manager | Assignee: | candlepin-bugs |
| Status: | CLOSED ERRATA | QA Contact: | Red Hat subscription-manager QE Team <rhsm-qe> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 9.0 | CC: | jsefler, mhorky, redakkan, rhsm-qe, skallesh |
| Target Milestone: | rc | Keywords: | 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: | 1859157 | Environment: | |
| Last Closed: | 2022-05-17 15:58:12 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: | |||
| Bug Depends On: | 1859157 | ||
| Bug Blocks: | |||
| Deadline: | 2021-12-07 | ||
|
Comment 1
Pino Toscano
2021-11-22 13:43:25 UTC
Pre-Verifying with. :
# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 3.2.21-1
subscription management rules: 5.41
subscription-manager: 1.29.21-1.el9
1. When user belong to multiple org with valid credentials and invalid org is given
===================================================================================
Demonstrating with test data
User "testuser1" belongs to two org as shown below
# subscription-manager orgs
Username: testuser1
Password:
+-------------------------------------------+
testuser1 Organizations
+-------------------------------------------+
Name: Admin Owner
Key: admin
Name: Snow White
Key: snowwhite
# subscription-manager usage --list --username testuser1 --password=*** --org=donaldduck
Organization with id donaldduck could not be found. (HTTP error code 404: Not Found)
# echo $?
70
# subscription-manager role --list --username testuser1 --password=*** --org=donaldduck
Organization with id donaldduck could not be found. (HTTP error code 404: Not Found)
# echo $?
70
# subscription-manager addons --list --username testuser1 --password=*** --org=donaldduck
Organization with id donaldduck could not be found. (HTTP error code 404: Not Found)
# echo $?
70
# subscription-manager service-level --list --username testuser1 --password=*** --org=donaldduck
Organization with id donaldduck could not be found. (HTTP error code 404: Not Found)
# echo $?
65
Notice the error message and exit codes have been fixed
2 When user belong to multiple org with invalid credentials and invalid org is given
===================================================================================
# subscription-manager role --list --username testuser1 --password=*** --org=donaldduck
Invalid Credentials (HTTP error code 401: Unauthorized)
# echo $?
70
# subscription-manager usage --list --username testuser1 --password=***** --org=donaldduck
Invalid Credentials (HTTP error code 401: Unauthorized)
# echo $?
70
# subscription-manager addons --list --username testuser1 --password=**** --org=donaldduck
Invalid Credentials (HTTP error code 401: Unauthorized)
# echo $?
70
# subscription-manager service-level --list --username testuser1 --password=***** --org=donaldduck
Invalid Credentials (HTTP error code 401: Unauthorized)
# echo $?
70
Notice the error message and exit codes have been fixed
3. When the user belong to single org ; valid credentials with invalid org
=======================================================
# subscription-manager usage --list --username=rhsm_nonsca_1 --password=***** --org=foo
+-------------------------------------------+
Available usage
+-------------------------------------------+
- Production
# echo $?
0
# subscription-manager role --list --username=rhsm_nonsca_1 --password=***** --org=foo
+-------------------------------------------+
Available role
+-------------------------------------------+
- Red Hat Enterprise Linux Server
# echo $?
0
# subscription-manager service-level --list --username=rhsm_nonsca_1 --password=**** --org=foo
Organization with id foo could not be found. (HTTP error code 404: Not Found)
# echo $?
65
# subscription-manager addons --list --username=rhsm_nonsca_1 --password=***** --org=foo
There are no available values for the system purpose "addons" from the available subscriptions in this organization.
# echo $?
0
Notice that when valid credentials are issued , org data was not validated except for service-level, there is separate bug 2026286 fix this behaviour
4. When the user belong to single org ; invalid credentials with invalid org
=======================================================
# subscription-manager usage --list --username stage_auto_syspurpose --password ***** --org=adsad
Invalid username or password. To create a login, please visit https://www.redhat.com/wapps/ugc/register.html (HTTP error code 401: Unauthorized)
# echo $?
70
# subscription-manager role --list --username stage_auto_syspurpose --password ***** --org=adsad
Invalid username or password. To create a login, please visit https://www.redhat.com/wapps/ugc/register.html (HTTP error code 401: Unauthorized)
# echo $?
70
# subscription-manager service-level --list --username stage_auto_syspurpose --password ***** --org=adsad
Invalid username or password. To create a login, please visit https://www.redhat.com/wapps/ugc/register.html (HTTP error code 401: Unauthorized)
# echo $?
70
# subscription-manager addons --list --username stage_auto_syspurpose --password ***** --org=adsad
Invalid username or password. To create a login, please visit https://www.redhat.com/wapps/ugc/register.html (HTTP error code 401: Unauthorized)
# echo $?
70
Based on the above observations marking the bug as verified:tested
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
1. When user belong to multiple org with valid credentials and invalid org is given
===================================================================================
Demonstrating with test data
User "testuser1" belongs to two org as shown below
# subscription-manager orgs
Username: testuser1
Password:
+-------------------------------------------+
testuser1 Organizations
+-------------------------------------------+
Name: Admin Owner
Key: admin
Name: Snow White
Key: snowwhite
# subscription-manager usage --list --username testuser1 --password=*** --org=donaldduck
Organization with id donaldduck could not be found. (HTTP error code 404: Not Found)
# echo $?
70
# subscription-manager role --list --username testuser1 --password=*** --org=donaldduck
Organization with id donaldduck could not be found. (HTTP error code 404: Not Found)
# echo $?
70
# subscription-manager addons --list --username testuser1 --password=*** --org=donaldduck
Organization with id donaldduck could not be found. (HTTP error code 404: Not Found)
# echo $?
70
# subscription-manager service-level --list --username testuser1 --password=*** --org=donaldduck
Organization with id donaldduck could not be found. (HTTP error code 404: Not Found)
# echo $?
65
Notice the error message and exit codes have been fixed
2 When user belong to multiple org with invalid credentials and invalid org is given
===================================================================================
# subscription-manager role --list --username testuser1 --password=*** --org=donaldduck
Invalid Credentials (HTTP error code 401: Unauthorized)
# echo $?
70
# subscription-manager usage --list --username testuser1 --password=***** --org=donaldduck
Invalid Credentials (HTTP error code 401: Unauthorized)
# echo $?
70
# subscription-manager addons --list --username testuser1 --password=**** --org=donaldduck
Invalid Credentials (HTTP error code 401: Unauthorized)
# echo $?
70
# subscription-manager service-level --list --username testuser1 --password=***** --org=donaldduck
Invalid Credentials (HTTP error code 401: Unauthorized)
# echo $?
70
Notice the error message and exit codes have been fixed
3. When the user belong to single org ; valid credentials with invalid org
=======================================================
# subscription-manager usage --list --username=rhsm_nonsca_1 --password=***** --org=foo
+-------------------------------------------+
Available usage
+-------------------------------------------+
- Production
# echo $?
0
# subscription-manager role --list --username=rhsm_nonsca_1 --password=***** --org=foo
+-------------------------------------------+
Available role
+-------------------------------------------+
- Red Hat Enterprise Linux Server
# echo $?
0
# subscription-manager service-level --list --username=rhsm_nonsca_1 --password=**** --org=foo
Organization with id foo could not be found. (HTTP error code 404: Not Found)
# echo $?
65
# subscription-manager addons --list --username=rhsm_nonsca_1 --password=***** --org=foo
There are no available values for the system purpose "addons" from the available subscriptions in this organization.
# echo $?
0
Notice that when valid credentials are issued , org data was not validated except for service-level, there is separate bug 2026286 fix this behaviour
4. When the user belong to single org ; invalid credentials with invalid org
=======================================================
# subscription-manager usage --list --username stage_auto_syspurpose --password ***** --org=adsad
Invalid username or password. To create a login, please visit https://www.redhat.com/wapps/ugc/register.html (HTTP error code 401: Unauthorized)
# echo $?
70
# subscription-manager role --list --username stage_auto_syspurpose --password ***** --org=adsad
Invalid username or password. To create a login, please visit https://www.redhat.com/wapps/ugc/register.html (HTTP error code 401: Unauthorized)
# echo $?
70
# subscription-manager service-level --list --username stage_auto_syspurpose --password ***** --org=adsad
Invalid username or password. To create a login, please visit https://www.redhat.com/wapps/ugc/register.html (HTTP error code 401: Unauthorized)
# echo $?
70
# subscription-manager addons --list --username stage_auto_syspurpose --password ***** --org=adsad
Invalid username or password. To create a login, please visit https://www.redhat.com/wapps/ugc/register.html (HTTP error code 401: Unauthorized)
# echo $?
70
Based on the above observations ,Moving this bug to Verified!!
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 |