Skip to content
This repository was archived by the owner on Jan 22, 2026. It is now read-only.

Commit daa624b

Browse files
committed
Throw clean warning if virt-viewer is not installed (Thanks Guido Guenther)
1 parent c61ecaf commit daa624b

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

virt-install

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
# MA 02110-1301 USA.
2323

2424
import os, sys, string
25+
import errno
2526
from optparse import OptionParser, OptionValueError
2627
import subprocess
2728
import logging
@@ -330,7 +331,15 @@ def vnc_console(dom, uri):
330331
args = args + [ "--wait", "%s" % dom.ID()]
331332
child = os.fork()
332333
if not child:
333-
os.execvp(args[0], args)
334+
try:
335+
os.execvp(args[0], args)
336+
except OSError, (err, msg):
337+
if err == errno.ENOENT:
338+
print _("Unable to connect to graphical console: virt-viewer not installed. Please install the 'virt-viewer' package.")
339+
else:
340+
raise OSError, (err, msg)
341+
except e:
342+
raise
334343
os._exit(1)
335344

336345
return child

0 commit comments

Comments
 (0)