Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 744654

Summary: [ALL LANG] [RHSM CLI]config module_ config Server port with blank or incorrect text produces traceback.
Product: Red Hat Enterprise Linux 6 Reporter: Lijun Li <lijli>
Component: python-rhsmAssignee: Bryan Kearney <bkearney>
Status: CLOSED ERRATA QA Contact: Entitlement Bugs <entitlement-bugs>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.2CC: aalam, alikins, bkearney, jsefler, lijli
Target Milestone: rcKeywords: i18n
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 789221 (view as bug list) Environment:
Last Closed: 2012-06-20 12:58:00 UTC Type: ---
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: 738066, 756082, 789221    
Attachments:
Description Flags
RHSM CLI_config module_ config Server port with balnk or incorrect text produces traceback
none
en_US_RHSM CLI_config module_ config Server port with balnk or incorrect text produces traceback none

Description Lijun Li 2011-10-10 02:29:24 UTC
Created attachment 527129 [details]
RHSM CLI_config module_ config Server port with balnk or incorrect text produces traceback

Description of problem:
config module_ config Server port with balnk or incorrect text produces traceback.

Version-Release number of selected component (if applicable):
subscription-manager-0.96.12-1.el6


How reproducible:
100%

Steps to Reproduce:
1.Run subscription-manager CLI in terminal
(Run the command when the system is NOT registered)

$ sudo subscription-manager config --$seciton.name = $value

Ex. sudo subscription-manager config --server.port = 

2. Run the command again
sudo subscription-manager config --server.port = 

Actual results:
config Server port with balnk or incorrect text produces traceback.


Expected results:
Should no traceback, it's better to have a warning message to say that the
Server port is incorrect than traceback.

Additional info:

Comment 2 A S Alam 2011-10-10 03:34:18 UTC
is this issue exist in English locale (en_US)?

Comment 3 Lijun Li 2011-10-10 06:04:56 UTC
(In reply to comment #2)
> is this issue exist in English locale (en_US)?

Yes, it exist in English locale (en_US) as well, please refer to screenshot.

Comment 4 Lijun Li 2011-10-10 06:07:54 UTC
Created attachment 527153 [details]
en_US_RHSM CLI_config module_ config Server port with balnk or incorrect text produces traceback

Comment 5 Adrian Likins 2011-10-10 16:20:02 UTC
I'd push this one back for 6.3, I don't think it's a blocker. 

Fix is probably to:

1) not allow server.port to be set to blank

and/or

2) use default server port if server.port is blank

Comment 9 Bryan Kearney 2012-03-01 17:55:46 UTC
Fixed in master at 130c21c2f072489885c1bbb005e58f5a8d4e8bd9

Comment 11 John Sefler 2012-03-09 21:07:36 UTC
The original problem demonstrated that sequential calls to set the server.port equal to nothing was throwing a traceback.

Verifying Version...
[root@jsefler-r63-server ~]# rpm -q subscription-manager
subscription-manager-0.99.9-1.git.3.1501812.el6.x86_64

The tests below show that sequential calls to set (including blank) the config port parameters no longer throw a traceback and the values are persisted...


[root@jsefler-r63-server ~]# subscription-manager config --list | grep port
   port = [8443]
   proxy_port = []
   port = [8443]
   proxy_port = []
   port = [8443]
   proxy_port = []
[root@jsefler-r63-server ~]# grep port /etc/rhsm/rhsm.conf
# Server port:
port=8443
# port for http proxy server
proxy_port=
[root@jsefler-r63-server ~]# subscription-manager config --server.port=
[root@jsefler-r63-server ~]# subscription-manager config --server.port=
[root@jsefler-r63-server ~]# subscription-manager config --rhsm.port=
[root@jsefler-r63-server ~]# subscription-manager config --rhsm.port=
[root@jsefler-r63-server ~]# subscription-manager config --rhsmcertd.port=
[root@jsefler-r63-server ~]# subscription-manager config --rhsmcertd.port=
[root@jsefler-r63-server ~]# subscription-manager config --list | grep port
   port = 
   proxy_port = []
   port = 
   proxy_port = []
   port = 
   proxy_port = []
[root@jsefler-r63-server ~]# grep port /etc/rhsm/rhsm.conf
# Server port:
port=
# port for http proxy server
proxy_port=
port =
port =
[root@jsefler-r63-server ~]# subscription-manager config --server.port =
[root@jsefler-r63-server ~]# subscription-manager config --server.port =
[root@jsefler-r63-server ~]# subscription-manager config --rhsm.port =
[root@jsefler-r63-server ~]# subscription-manager config --rhsm.port =
[root@jsefler-r63-server ~]# subscription-manager config --rhsmcertd.port =
[root@jsefler-r63-server ~]# subscription-manager config --rhsmcertd.port =
[root@jsefler-r63-server ~]# subscription-manager config --list | grep port
   port = =
   proxy_port = []
   port = =
   proxy_port = []
   port = =
   proxy_port = []
[root@jsefler-r63-server ~]# grep port /etc/rhsm/rhsm.conf
# Server port:
port==
# port for http proxy server
proxy_port=
port ==
port ==
REALIZE IN ^^ THOSE CASES WE ACTUALLY SET THE VALUE TO AN EQUAL SIGN.  THIS MAY BE A RIDICULOUS VALUE, BUT THE TOOL DID WHAT WE TOLD IT TO DO WITHOUT THROWING A TRACEBACK.
[root@jsefler-r63-server ~]# subscription-manager config --server.port=""
[root@jsefler-r63-server ~]# subscription-manager config --server.port=""
[root@jsefler-r63-server ~]# subscription-manager config --rhsm.port=""
[root@jsefler-r63-server ~]# subscription-manager config --rhsm.port=""
[root@jsefler-r63-server ~]# subscription-manager config --rhsmcertd.port=""
[root@jsefler-r63-server ~]# subscription-manager config --rhsmcertd.port=""
[root@jsefler-r63-server ~]# subscription-manager config --list | grep port
   port = 
   proxy_port = []
   port = 
   proxy_port = []
   port = 
   proxy_port = []
[root@jsefler-r63-server ~]# grep port /etc/rhsm/rhsm.conf
# Server port:
port=
# port for http proxy server
proxy_port=
port =
port =
[root@jsefler-r63-server ~]# subscription-manager config --server.port ""
[root@jsefler-r63-server ~]# subscription-manager config --server.port ""
[root@jsefler-r63-server ~]# subscription-manager config --rhsm.port ""
[root@jsefler-r63-server ~]# subscription-manager config --rhsm.port ""
[root@jsefler-r63-server ~]# subscription-manager config --rhsmcertd.port ""
[root@jsefler-r63-server ~]# subscription-manager config --rhsmcertd.port ""
[root@jsefler-r63-server ~]# subscription-manager config --list | grep port
   port = 
   proxy_port = []
   port = 
   proxy_port = []
   port = 
   proxy_port = []
[root@jsefler-r63-server ~]# grep port /etc/rhsm/rhsm.conf
# Server port:
port=
# port for http proxy server
proxy_port=
port =
port =
[root@jsefler-r63-server ~]# subscription-manager config --server.port 8443
[root@jsefler-r63-server ~]# subscription-manager config --server.port 8443
[root@jsefler-r63-server ~]# subscription-manager config --rhsm.port 8443
[root@jsefler-r63-server ~]# subscription-manager config --rhsm.port 8443
[root@jsefler-r63-server ~]# subscription-manager config --rhsmcertd.port 8443
[root@jsefler-r63-server ~]# subscription-manager config --rhsmcertd.port 8443
[root@jsefler-r63-server ~]# subscription-manager config --list | grep port
   port = [8443]
   proxy_port = []
   port = [8443]
   proxy_port = []
   port = [8443]
   proxy_port = []
[root@jsefler-r63-server ~]# grep port /etc/rhsm/rhsm.conf
# Server port:
port=8443
# port for http proxy server
proxy_port=
port =8443
port =8443
[root@jsefler-r63-server ~]# 



IN EACH CASE ABOVE, THE VALUE WAS SET TWICE WITH NO TRACEBACK AND THE VALUE WAS WRITTEN TO rhsm.conf

Also note that the proposed fix in comment 5 is NOT what was demonstrated in the fix above.

Moving to VERIFIED

Comment 13 errata-xmlrpc 2012-06-20 12:58:00 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, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2012-0805.html