Bug 725609

Summary: running subscription-manager CLI over ssh is throwing a traceback
Product: Red Hat Enterprise Linux 6 Reporter: John Sefler <jsefler>
Component: subscription-managerAssignee: Michael Stead <mstead>
Status: CLOSED ERRATA QA Contact: John Sefler <jsefler>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.2CC: mstead, spandey
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-06 17:22:47 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 682238    

Description John Sefler 2011-07-26 02:09:07 UTC
Description of problem:

Something bad was committed in the following build 913:
http://hudson.rhq.lab.eng.bos.redhat.com:8080/hudson/view/Entitlement/job/subscription-manager_master/913/

It is causing a traceback when attempting to call the CLI subscription-manager over ssh....

[jsefler@jseflerT510 ~]$ ssh root.redhat.com subscription-manager -help
root.redhat.com's password: 
Traceback (most recent call last):
  File "/usr/sbin/subscription-manager", line 54, in <module>
    from subscription_manager import managercli
  File "/usr/share/rhsm/subscription_manager/managercli.py", line 46, in <module>
    from subscription_manager.quantity import valid_quantity
  File "/usr/share/rhsm/subscription_manager/quantity.py", line 17, in <module>
    from subscription_manager.gui.utils import flatten_attributes, allows_multi_entitlement
  File "/usr/share/rhsm/subscription_manager/gui/utils.py", line 23, in <module>
    import gtk
  File "/usr/lib64/python2.6/site-packages/gtk-2.0/gtk/__init__.py", line 64, in <module>
    _init()
  File "/usr/lib64/python2.6/site-packages/gtk-2.0/gtk/__init__.py", line 52, in _init
    _gtk.init_check()
RuntimeError: could not open display


The probable offence is in one of these commits:
Commit 8239ce2dbfafeb5abb00dfef0951ec03c5c53c8f by Michael Stead
Commit 32614970381e53f323503a82e35683f1031a11eb by Michael Stead

Version-Release number of selected component (if applicable):
subscription-manager-0.96.4-1.git.62.75efb0a.el6.x86_64
python-rhsm-0.96.7-1.git.4.ae2c338.el6.noarch

Comment 1 Michael Stead 2011-07-26 12:28:00 UTC
Fixed by 7bb47656d90786d37ab75c9be4158d6d80b5a7f3

CLI was using code that loaded GTK. Refactored this out to fix the problem.

Comment 3 John Sefler 2011-07-26 13:21:50 UTC
Verifying Version...
[root@jsefler-onprem-62server ~]# rpm -q subscription-manager
subscription-manager-0.96.4-1.git.63.7bb4765.el6.x86_64



[jsefler@jsefler ~]$ ssh root.redhat.com subscription-manager --help
root.redhat.com's password: 

Usage: subscription-manager [options] MODULENAME --help

Primary Modules:

	list           List subscription and product information for this machine
	refresh        Pull the latest subscription data from the server
	register       Register the machine to the server
	subscribe      Subscribe the registered machine to a specified product
	unregister     Unregister the machine from the server
	unsubscribe    Unsubscribe the machine from all or specific subscriptions

Other Modules (Please consult documentation):

	clean          Remove all local consumer and subscription data without effecting the server
	environments   Display the environments available for a user
	facts          Work with the current facts for this machine
	identity       Display the identity certificate for this machine or request a new one
	orgs           Display the orgs available for a user
	redeem         Attempt to redeem a subscription for a preconfigured machine
	repos          List the repos which this machine is entitled to use

[jsefler@jsefler ~]$ 


Fixed.  Moving to VERIFIED

Comment 4 errata-xmlrpc 2011-12-06 17:22:47 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-2011-1695.html