mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 18:21:39 +01:00
xm: Add exception handling when launching vncviewer
Also replaces the call to 'puts' with 'print' as the former is undefined in python Signed-off-by: Goncalo Gomes <Goncalo.Gomes@eu.Citrix.com> xen-unstable changeset: 21296:460d156da874 xen-unstable date: Thu May 06 11:13:22 2010 +0100
This commit is contained in:
1 parent
d9c8338f78
commit
85bef2cc8d
1 file changed
+7
-2
@@ -74,10 +74,15 @@ def runVncViewer(domid, do_autopass, do_daemonize=False):
|
||||
if do_daemonize:
|
||||
pid = utils.daemonize('vncviewer', cmdl, vnc_password_tmpfile)
|
||||
if pid == 0:
|
||||
puts >>sys.stderr, 'failed to invoke vncviewer'
|
||||
print >>sys.stderr, 'failed to invoke vncviewer'
|
||||
os._exit(-1)
|
||||
else:
|
||||
print 'invoking ', ' '.join(cmdl)
|
||||
if vnc_password_tmpfile is not None:
|
||||
os.dup2(vnc_password_tmpfile.fileno(), 0)
|
||||
os.execvp('vncviewer', cmdl)
|
||||
try:
|
||||
os.execvp('vncviewer', cmdl)
|
||||
except OSError:
|
||||
print >>sys.stderr, 'Error: external vncviewer missing or not \
|
||||
in the path\nExiting'
|
||||
os._exit(-1)
|
||||