Skip to contentSkip to conversation

xm: catch TypeError if xenconsole is nonexistent

PATCH Yu Zhiguo 1 participant 1 message Apr 28, 2010

lore
Share & tools
lore

Yu Zhiguo

author
#0 lore raw

If command xenconsole is nonexistent:

# xm console pv1
Unexpected error: exceptions.TypeError

Please report to [email protected]
Traceback (most recent call last):
File "/usr/sbin/xm", line 7, in ?
main.main(sys.argv)
File "usr/lib64/python2.4/site-packages/xen/xm/main.py", line 3939, in main
...

Catch this error.
------------

catch TypeError if xenconsole is nonexistent

tools/python/xen/util/auxbin.py +1 -1
diff -r c87ec146229a -r b696c19ee132 tools/python/xen/util/auxbin.py
@@ -28,7 +28,7 @@
         a.extend(args)
     try:
         os.execv(exepath, a)
-    except OSError, exn:
+    except (OSError, TypeError), exn:
         print exepath, ": ", exn
         sys.exit(1)