summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2009-09-03 10:30:22 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2009-09-03 10:30:22 -0300
commit52fb608a5cfe89e0158d3c62a72cae523cd9e275 (patch)
tree7280fc1d2585246b06528cb3a78e96c05cfd9c5f
parent50f1a4234d03a7766d406f3ec53bf1fff2f0a644 (diff)
downloadtuna-52fb608a5cfe89e0158d3c62a72cae523cd9e275.tar.gz
tuna: Present more graceful failure mode when machine can't start gui
Before: [acme@emilia tuna]$ tuna Traceback (most recent call last): File "./tuna-cmd.py", line 501, in ? main() File "./tuna-cmd.py", line 488, in main from tuna import tuna_gui File "/home/acme/git/tuna/tuna/tuna_gui.py", line 7, in ? import gtk, gobject, os, procfs, sys 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 After: [acme@emilia tuna]$ tuna tuna: machine needs to be authorized via xhost or ssh -X? Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rwxr-xr-xtuna-cmd.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tuna-cmd.py b/tuna-cmd.py
index bfb6cc0..78e6c71 100755
--- a/tuna-cmd.py
+++ b/tuna-cmd.py
@@ -490,6 +490,10 @@ def main():
# gui packages not installed
usage()
return
+ except RuntimeError:
+ print "tuna: machine needs to be authorized via xhost or ssh -X?"
+ return
+
try:
cpus_filtered = filter and cpu_list or []
app = tuna_gui.main_gui(kthreads, uthreads, cpus_filtered)