virt-manager/534be092-early-detect-ftp-connection-errors.patch
Charles Arnold 4648861824 - Upstream bug fix
535584ed-fix-target-validation-when-editing-device.patch 

- bnc#874408 - virt-manager and libvirt issues persist - unable to
  create or launch
  virtman-vminstall.patch

- Upstream bug fix
  5350d9cc-display-error-on-empty-installation-URL.patch

- Dropped unused and unnecessary patches
  virtinst-cdrom.patch
  virtman-update-backend.patch
  virtman-slow-mouse.patch
  virtman-reverse-serialcon.patch
- Reordered some patches

- Upstream bug fixes
  534bcfa0-use-uniformed-expression-of-Default.patch
  534be092-early-detect-ftp-connection-errors.patch
  534d45db-hiding-removebutton-for-USB-controller.patch
  534d6406-display-the-domain-for-PCI-devices.patch
  534eafe4-avoid-useless-errors-when-connection-closes.patch

- bnc#872789 - XEN domain fails to start when xen disk is atttached
  virtinst-xenbus-disk-index-fix.patch
- bnc#872777 - virt-manager - Error shutting down domain: internal
  error: Failed to shutdown domain '3' with libxenlight
  virtman-shutdown-with-acpi-button.patch

OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=166
2014-04-22 20:09:58 +00:00

56 lines
2.0 KiB
Diff

Subject: virtinst: early detect ftp connection errors
From: Giuseppe Scrivano gscrivan@redhat.com Mon Apr 14 14:49:21 2014 +0200
Date: Mon Apr 14 15:20:18 2014 +0200:
Git: 1d312a520e92e89da1b4d958b9de0270eecc6b4b
It fixes two problems:
i) "ftp://" was accepted as valid URL but then it causes this
exception:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib64/python2.7/ftplib.py", line 387, in login
resp = self.sendcmd('USER ' + user)
File "/usr/lib64/python2.7/ftplib.py", line 243, in sendcmd
self.putcmd(cmd)
File "/usr/lib64/python2.7/ftplib.py", line 178, in putcmd
self.putline(line)
File "/usr/lib64/python2.7/ftplib.py", line 173, in putline
self.sock.sendall(line)
AttributeError: 'NoneType' object has no attribute 'sendall'
ii) only a cryptic error message "Unable to complete install: '[Errno
-2] Name or service not known'" was showed to users when the DNS
lookup failed. The exception is now intercepted and decorated with
more information.
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1086554
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
diff --git a/virtinst/urlfetcher.py b/virtinst/urlfetcher.py
index 7075929..3f2744b 100644
--- a/virtinst/urlfetcher.py
+++ b/virtinst/urlfetcher.py
@@ -151,9 +151,16 @@ class _FTPImageFetcher(_URIImageFetcher):
self.ftp = None
def prepareLocation(self):
- url = urlparse.urlparse(self._make_path(""))
- self.ftp = ftplib.FTP(url[1])
- self.ftp.login()
+ try:
+ url = urlparse.urlparse(self._make_path(""))
+ if not url[1]:
+ raise ValueError(_("Invalid install location"))
+ self.ftp = ftplib.FTP(url[1])
+ self.ftp.login()
+ except Exception, e:
+ raise ValueError(_("Opening URL %s failed: %s.") %
+ (self.location, str(e)))
+
def hasFile(self, filename):
path = self._make_path(filename)