Bug 1857100

Summary: subscription-manager role --list shows empty string in list of valid values for role
Product: Red Hat Enterprise Linux 8 Reporter: Archana Pandey <arpandey>
Component: subscription-managerAssignee: Jiri Hnidek <jhnidek>
Status: CLOSED ERRATA QA Contact: Red Hat subscription-manager QE Team <rhsm-qe>
Severity: medium Docs Contact:
Priority: high    
Version: 8.3CC: jhnidek, jsefler, redakkan, wpoteat
Target Milestone: rcKeywords: Triaged
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-04 01:39:41 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:    
Bug Blocks: 1634023    

Description Archana Pandey 2020-07-15 06:44:43 UTC
Description of problem:
Empty string is getting listed as valid value in output of subscription-manager role --list


Version-Release number of selected component (if applicable):
[root@ibm-x3650m4-01-vm-08 ~]# 
[root@ibm-x3650m4-01-vm-08 ~]# subscription-manager version
server type: This system is currently not registered.
subscription management server: 3.1.15-1
subscription management rules: 5.40
subscription-manager: 1.27.9-1.git.1.5ce543e.el8

How reproducible:


Steps to Reproduce:

[root@ibm-x3650m4-01-vm-08 ~]# subscription-manager register --username=stage-ethel
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
Password: 
The system has been registered with ID: ***********************
The registered system name is: ibm-x3650m4-01-vm-08.ibm2.lab.eng.bos.redhat.com
[root@ibm-x3650m4-01-vm-08 ~]# 

[root@ibm-x3650m4-01-vm-08 ~]# subscription-manager role --list
+-------------------------------------------+
               Available role
+-------------------------------------------+
 -                                           <<<<<--- here is the empty string
 - Red Hat Enterprise Linux Server
 - Red Hat Enterprise Linux Compute Node


Actual results:
Empty string getting listed as part of list of valid values for role

Expected results:
Empty string should be removed 

Additional info:

Comment 4 Archana Pandey 2020-08-07 08:00:23 UTC
Verifying Issue on latest build subscription-manager-1.27.13-1.el8.x86_64


Version-Release number of selected component (if applicable):
[root@ibm-x3650m4-01-vm-14 ~]# subscription-manager version 
server type: This system is currently not registered.
subscription management server: 3.1.16-1
subscription management rules: 5.40
subscription-manager: 1.27.13-1.el8

[root@ibm-x3650m4-01-vm-14 ~]# rpm -qa subscription-manager --changelog | grep 1857100
- 1857100: Do not print empty string as valid value (jhnidek)



Verifying on unregistered system:

[root@ibm-x3650m4-01-vm-14 ~]# subscription-manager role --list --username **** --password **** --org ****
+-------------------------------------------
               Available role
+-------------------------------------------+
 - Red Hat Enterprise Linux Server                          <<<<<<<<<<<<<< empty string removed
 - Red Hat Enterprise Linux Compute Node
[root@ibm-x3650m4-01-vm-14 ~]# 


Verifying on registered system:

[root@ibm-x3650m4-01-vm-14 ~]# subscription-manager role --list
+-------------------------------------------+
               Available role
+-------------------------------------------+
 - Red Hat Enterprise Linux Server                          <<<<<<<<<<<<<< empty string removed
 - Red Hat Enterprise Linux Compute Node
[root@ibm-x3650m4-01-vm-14 ~]# 


[root@ibm-x3650m4-01-vm-14 ~]# cat /var/lib/rhsm/cache/valid_fields.json
{"539e9ef8-9312-41bf-92f9-4badf077b89b": {"owner": {"id": "8a99f9a1730c204f01730f4a61131aa6", "key": "12997644", "displayName": "******", "href": "/owners/12997644"}, "systemPurposeAttributes": {"addons": [], "usage": ["Development/Test", "Production", "Disaster Recovery"], "role": ["", "Red Hat Enterprise Linux Server", "Red Hat Enterprise Linux Compute Node"], "service_level_agreement": ["Layered", "Premium", "Standard", "Self-Support"]}}}[root@ibm-x3650m4-01-vm-14 ~]# 




Actual results:
Empty string removed from list of valid values for role

Expected results:
Empty string should be removed 

Additional info:

Comment 7 errata-xmlrpc 2020-11-04 01:39:41 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-2020:4460