Improve error message if netcat can't forward Unix domain sockets

Otherwise the information:

  End of file while reading data: nc: invalid option -- 'U'
  nc -h for help: Input/output error

is hidden in the error detail. See Debian bug:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=614291
This commit is contained in:
Guido Günther 2012-01-14 22:19:12 +01:00 committed by Cole Robinson
parent e06b277362
commit 2140539c64

View File

@ -18,6 +18,7 @@
# MA 02110-1301 USA. # MA 02110-1301 USA.
# #
import re
import gtk import gtk
import virtManager.uihelpers as uihelpers import virtManager.uihelpers as uihelpers
@ -653,12 +654,15 @@ class vmmManager(vmmGObjectUI):
details=details, details=details,
title=_("Virtual Machine Manager Connection Failure")) title=_("Virtual Machine Manager Connection Failure"))
else: else:
hint = ''
if re.search(r"nc: .* -- 'U'", details):
hint = _("\n - The remote netcat understands the '-U' option")
self.err.show_err( self.err.show_err(
_("Unable to open a connection to the libvirt " _("Unable to open a connection to the libvirt "
"management daemon.\n\n" + "management daemon.\n\n" +
"Libvirt URI is: %s\n\n" % conn.get_uri() + "Libvirt URI is: %s\n\n" % conn.get_uri() +
"Verify that:\n" + "Verify that:\n" +
" - The 'libvirtd' daemon has been started\n"), " - The 'libvirtd' daemon has been started") + hint,
details=details, details=details,
title=_("Virtual Machine Manager Connection Failure")) title=_("Virtual Machine Manager Connection Failure"))