Bug 205938

Summary: Stack trace in virt-manager if no DISPLAY variable set
Product: [Fedora] Fedora Reporter: Chris Lalancette <clalance>
Component: virt-managerAssignee: Daniel Berrangé <berrange>
Status: CLOSED WONTFIX QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhide   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-09-12 23:25:15 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:

Description Chris Lalancette 2006-09-10 15:52:05 UTC
Description of problem:
If there is no DISPLAY variable set, virt-manager will throw the following stack
trace:

Traceback (most recent call last):
  File "/usr/share/virt-manager/virt-manager.py", line 35, in ?
    import gtk
  File "/usr/lib/python2.4/site-packages/gtk-2.0/gtk/__init__.py", line 90, in ?
   _init()
  File "/usr/lib/python2.4/site-packages/gtk-2.0/gtk/__init__.py", line 78, in _init
    _gtk.init_check()
RuntimeError: could not open display

It should probably catch this error and display some sort of error messageg
instead of the stack trace.

Comment 1 Daniel Berrangé 2006-09-12 23:25:15 UTC
The Python GTK bindings don't provide any easy way to trap & handle the error of
missing display, since they try to connect the moment you import the gtk module.
We could trap any errors occuring during import, but that would be catching much
more than we want - so while we'd improve clarity of the the missing $DISPLAY
use case, we'd make other errors much harder to debug. Since the stack trace
does end with a fairly clear description of the problem I don't thing its worth
trying to get any cleverer handling this.