Bug 976689

Summary: Got a traceback when run "subscription-manger-gui --help" in a terminal when X window can't be opened.
Product: Red Hat Enterprise Linux 5 Reporter: xingge <gxing>
Component: subscription-managerAssignee: Carter Kozak <ckozak>
Status: CLOSED ERRATA QA Contact: IDM QE LIST <seceng-idm-qe-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.10CC: bkearney, ckozak, jesusr, jsefler, ldai, liliu
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
No description necessary
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-30 23:11:01 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: 840995    

Description xingge 2013-06-21 07:58:05 UTC
Description of problem:
Got a traceback when run "subscription-manger-gui --help" in a terminal when X window can't be opened.

Version-Release number of selected component (if applicable):
subscription-manager-firstboot-1.8.10-1.el5
subscription-manager-gui-1.8.10-1.el5
subscripiton-manager-1.8.10.el5
python-rhsm-1.8.12-1.el5

How reproducible:
always

Steps to Reproduce:
1.Go into a terminal and make sure the X window can not be opened.
you can use "Ctrl" + "Alt" + "F2" to go into terminal for local system, or use ssh with out "-X" to connect a remote system.
2.Run subscription-manager-gui --help 
#subscription-manager-gui --help


Actual results:
[root@dhcp-66-103-30 ~]# subscription-manager-gui --help
Traceback (most recent call last):
  File "/usr/sbin/subscription-manager-gui", line 40, in ?
    import gtk
  File "/usr/lib64/python2.4/site-packages/gtk-2.0/gtk/__init__.py", line 76, in ?
    _init()
  File "/usr/lib64/python2.4/site-packages/gtk-2.0/gtk/__init__.py", line 64, in _init
    _gtk.init_check()
RuntimeError: could not open display

Expected results:
no traceback would show. The help doc should be shown like below:
Usage: subscription-manager-gui [OPTIONS]

Options:
  -h, --help  show this help message and exit
  --register  launches the registration dialog on startup

Additional info:
Other app like firefox, gedit won't get this traceback when using the same environment with the same step.
This bug also happend in the 6.3GA, so I think maybe it is in the 5.9GA 6.4GA too.

Comment 1 RHEL Program Management 2013-06-21 08:17:54 UTC
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux release.  Product Management has
requested further review of this request by Red Hat Engineering, for
potential inclusion in a Red Hat Enterprise Linux release for currently
deployed products.  This request is not yet committed for inclusion in
a release.

Comment 2 Carter Kozak 2013-06-28 21:06:28 UTC
When running any subscription-manager-gui command, if there is no display, we print the message "Unable to open a display"
subscription-manager-gui --help will print that and exit (no help message) if there is no display, we may fix that at another time, but it will require a bit of a refactor.

commit a3d31e03b4beda13ca036c9fd4553ce07feecc8f
Author: ckozak <ckozak>
Date:   Thu Jun 27 16:47:02 2013 -0400

    976689: Handle no xorg server, allow help

Comment 4 xingge 2013-07-12 07:29:26 UTC
[root@dhcp-66-102-178 ~]# subscription-manager-gui --help
Unable to open a display

Verified,but I think it should display the help doc of the rhsm gui, like gedit does.

Comment 7 errata-xmlrpc 2013-09-30 23:11:01 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-2013-1332.html