RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1904541 - subscription-manager should not prompt for "Organization" when user belongs to only one organization
Summary: subscription-manager should not prompt for "Organization" when user belongs t...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: subscription-manager
Version: 8.4
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: rc
: ---
Assignee: William Poteat
QA Contact: Red Hat subscription-manager QE Team
URL:
Whiteboard:
Depends On:
Blocks: 1903942
TreeView+ depends on / blocked
 
Reported: 2020-12-04 17:46 UTC by John Sefler
Modified: 2021-05-18 13:34 UTC (History)
4 users (show)

Fixed In Version: subscription-manager-1.28.9-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-05-18 13:33:55 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description John Sefler 2020-12-04 17:46:53 UTC
Description of problem:
I suspect that the fix for Bug 1875595 caused this low severity regression...

When calling subscription-manager service-level OR role OR usage OR addons to --list the available values from an unregistered system, the tool should only prompt the user for an Organization when the --username/--password belongs to more than one org.  The current version of subscription-manager, is always prompting for Organization as shown in the steps below...

This is definitely a regression for the service-level module; not sure about the role/usage/addons.

Version-Release number of selected component (if applicable):
[root@kvm-04-guest06 ~]# subscription-manager version
server type: This system is currently not registered.
subscription management server: 3.2.0-1
subscription management rules: 5.41
subscription-manager: 1.28.6-1.el8


How reproducible:


Steps to Reproduce:
[root@kvm-04-guest06 ~]# subscription-manager orgs --username=rhelentqe --password=REDACTED
+-------------------------------------------+
          rhelentqe Organizations
+-------------------------------------------+

Name: 12415135          <======= Evidence that user belongs to only one organization
Key:  12415135

[root@kvm-04-guest06 ~]# subscription-manager service-level --list --username=rhelentqe --password=REDACTED
Organization: 
User interrupted process.

[root@kvm-04-guest06 ~]# subscription-manager role --list --username=rhelentqe --password=REDACTED
Organization: 
User interrupted process.

[root@kvm-04-guest06 ~]# subscription-manager usage --list --username=rhelentqe --password=REDACTED
Organization: 
User interrupted process.

[root@kvm-04-guest06 ~]# subscription-manager addons --list --username=rhelentqe --password=REDACTED
Organization: 
User interrupted process.


Actual results:
 shown above with my <Ctrl>c interruptions to cancel each of the unexpected interactive prompts for "Organization".

Expected results:
 when the user belongs to only one org, the commands should have completed as shown below without any interactive prompting...


[root@kvm-04-guest06 ~]# subscription-manager service-level --list --username=rhelentqe --password=REDACTED
+-------------------------------------------+
           Available Service Levels
+-------------------------------------------+
Premium
Self-Support
Standard

[root@kvm-04-guest06 ~]# subscription-manager role --list --username=rhelentqe --password=REDACTED
+-------------------------------------------+
               Available role
+-------------------------------------------+
 - Red Hat Enterprise Linux Workstation
 - Red Hat Enterprise Linux Server
 - Red Hat Enterprise Linux Compute Node

[root@kvm-04-guest06 ~]# subscription-manager usage --list --username=rhelentqe --password=REDACTED
+-------------------------------------------+
               Available usage
+-------------------------------------------+
 - Production

[root@kvm-04-guest06 ~]# subscription-manager addons --list --username=rhelentqe --password=REDACTED
No valid values provided for "addons"





Additional info:

Comment 3 Shwetha Kallesh 2020-12-17 09:29:55 UTC
Reproducer:

[root@kvm-01-guest14 ~]# subscription-manager version
server type: This system is currently not registered.
subscription management server: 3.2.7-1
subscription management rules: 5.41
subscription-manager: 1.28.7-1.el8

[root@kvm-01-guest14 ~]# subscription-manager orgs --username=stage_auto_testuser --password REDACTED
+-------------------------------------------+
          stage_auto_testuser Organizations
+-------------------------------------------+

Name: 12809278
Key:  12809278

[root@kvm-01-guest14 ~]# subscription-manager service-level --list --username=stage_auto_testuser --password REDACTED
Organization: 
User interrupted process.
[root@kvm-01-guest14 ~]# subscription-manager role --list --username=stage_auto_testuser --password REDACTED
Organization: 
User interrupted process.
[root@kvm-01-guest14 ~]# subscription-manager usage --list --username=stage_auto_testuser --password REDACTED
Organization: 
User interrupted process.
[root@kvm-01-guest14 ~]# subscription-manager addons --list --username=stage_auto_testuser --password REDACTED
Organization: 
User interrupted process.

Comment 4 Shwetha Kallesh 2020-12-17 09:35:16 UTC
Pre-verification comments:

                         HOSTNAME=kvm-08-guest28.hv2.lab.eng.bos.redhat.com
                            JOBID=4898697
                         RECIPEID=9279517
                    RESULT_SERVER=
                           DISTRO=RHEL-8.4.0-20201216.d.1
                     ARCHITECTURE=x86_64

      Job Whiteboard: Reserve Workflow provision of distro RHEL-8.4.0-20201216.d.1 on any system for 356400 seconds

      Recipe Whiteboard: 
**  **  **  **  **  **  **  **  **  **  **  **  **  **  **  **  **  **



[root@kvm-08-guest28 ~]# subscription-manager orgs --username=stage_auto_testuser --password REDACTED
+-------------------------------------------+
          stage_auto_testuser Organizations
+-------------------------------------------+

Name: 12809278        <======= user belongs to only one organization
Key:  12809278

[root@kvm-08-guest28 ~]# subscription-manager service-level --list --username=stage_auto_testuser --password REDACTED
+-------------------------------------------+
           Available Service Levels
+-------------------------------------------+
AMC-Enhanced
Premium
Self-Support
Standard
[root@kvm-08-guest28 ~]# subscription-manager role --list --username=stage_auto_testuser --password REDACTED
+-------------------------------------------+
               Available role
+-------------------------------------------+
 - Red Hat Enterprise Linux Workstation
 - SP Server
 - Red Hat Enterprise Linux Server
 - Red Hat Enterprise Linux Compute Node
[root@kvm-08-guest28 ~]# subscription-manager usage --list --username=stage_auto_testuser --password REDACTED
+-------------------------------------------+
               Available usage
+-------------------------------------------+
 - Production
[root@kvm-08-guest28 ~]# subscription-manager addons --list --username=stage_auto_testuser --password REDACTED
No valid values provided for "addons"

^^ organization is not prompted when user belongs to only one org

Comment 7 Shwetha Kallesh 2020-12-22 08:36:53 UTC
Verification:

      Beaker Test information:
                         HOSTNAME=ibm-x3650m4-01-vm-06.ibm2.lab.eng.bos.redhat.com
                            JOBID=4919842
                         RECIPEID=9307136
                    RESULT_SERVER=
                           DISTRO=RHEL-8.4.0-20201222.n.0
                     ARCHITECTURE=x86_64

      Job Whiteboard: Reserve Workflow provision of distro RHEL-8.4.0-20201222.n.0 on any system for 86400 seconds

      Recipe Whiteboard: 
**  **  **  **  **  **  **  **  **  **  **  **  **  **  **  **  **  **
[root@ibm-x3650m4-01-vm-06 ~]# subscription-manager version
server type: This system is currently not registered.
subscription management server: 3.2.7-1
subscription management rules: 5.41
subscription-manager: 1.28.9-1.el8
[root@ibm-x3650m4-01-vm-06 ~]# 
[root@ibm-x3650m4-01-vm-06 ~]# rpm -qa --changelog subscription-manager | grep 1904541
- 1904541: Catch ProxyException when checking available orgs
- 1904541: subscription-manager should not prompt for "Organization" when only


[root@ibm-x3650m4-01-vm-06 ~]# subscription-manager version
server type: This system is currently not registered.
subscription management server: 3.2.7-1
subscription management rules: 5.41
subscription-manager: 1.28.9-1.el8

[root@ibm-x3650m4-01-vm-06 ~]# subscription-manager orgs --username=stage_auto_testuser --password REDACTED
+-------------------------------------------+
          stage_auto_testuser Organizations
+-------------------------------------------+

Name: 12809278                            --------------> user belongs to only one org
Key:  12809278

[root@ibm-x3650m4-01-vm-06 ~]# vi /etc/rhsm/rhsm.conf 
[root@ibm-x3650m4-01-vm-06 ~]# subscription-manager service-level --list --username=stage_auto_testuser --password REDACTED
+-------------------------------------------+
           Available Service Levels
+-------------------------------------------+
AMC-Enhanced
Premium
Self-Support
Standard
[root@ibm-x3650m4-01-vm-06 ~]# subscription-manager role --list --username=stage_auto_testuser --password REDACTED
+-------------------------------------------+
               Available role
+-------------------------------------------+
 - Red Hat Enterprise Linux Workstation
 - SP Server
 - Red Hat Enterprise Linux Server
 - Red Hat Enterprise Linux Compute Node
[root@ibm-x3650m4-01-vm-06 ~]# subscription-manager usage --list --username=stage_auto_testuser --password REDACTED
+-------------------------------------------+
               Available usage
+-------------------------------------------+
 - Production
[root@ibm-x3650m4-01-vm-06 ~]# subscription-manager addons --list --username=stage_auto_testuser --password REDACTED
No valid values provided for "addons"
[root@ibm-x3650m4-01-vm-06 ~]# 

^^ user belonging to only one org is not prompted for organization

Comment 9 errata-xmlrpc 2021-05-18 13:33:55 UTC
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 (subscription-manager bug fix and enhancement update), 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-2021:1575


Note You need to log in before you can comment on or make changes to this bug.