Bug 744654 - [ALL LANG] [RHSM CLI]config module_ config Server port with blank or incorrect text produces traceback.
Summary: [ALL LANG] [RHSM CLI]config module_ config Server port with blank or incorrec...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: python-rhsm
Version: 6.2
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Bryan Kearney
QA Contact: Entitlement Bugs
URL:
Whiteboard:
Depends On:
Blocks: 738066 756082 789221
TreeView+ depends on / blocked
 
Reported: 2011-10-10 02:29 UTC by Lijun Li
Modified: 2012-06-20 12:58 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 789221 (view as bug list)
Environment:
Last Closed: 2012-06-20 12:58:00 UTC
Target Upstream Version:


Attachments (Terms of Use)
RHSM CLI_config module_ config Server port with balnk or incorrect text produces traceback (82.76 KB, image/png)
2011-10-10 02:29 UTC, Lijun Li
no flags Details
en_US_RHSM CLI_config module_ config Server port with balnk or incorrect text produces traceback (76.21 KB, image/png)
2011-10-10 06:07 UTC, Lijun Li
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:0805 0 normal SHIPPED_LIVE python-rhsm bug fix and enhancement update 2012-06-19 20:34:30 UTC

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


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