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:
Keir Fraser committed 2010-05-10 09:49:33 +01:00
1 parent d9c8338f78
commit 85bef2cc8d
1 file changed
+7 -2
+7 -2
View File
@@ -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)
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.