[virt-tools-list] [PATCH] fix: do cleanupLocation only at last time for cached fetcher

Chunyan Liu cyliu at suse.com
Wed Sep 9 05:56:16 UTC 2015

Regression introduced after commit d8d6af5. Failed to install guests
through ftp network source, see below:

/usr/bin/virt-install   --name sled-12-fcs-64-pv-nnm-nete5250fdfecc94f922b5a21a
 -p --location ftp://xen100.virt.lab.novell.com/install/sled12/x86_64
 --extra-args "autoyast=
sled-12-fcs-64-pv-nnm-nete5250fdfecc94f922b5a21a"   --disk path=/var/lib/
format=qcow2   --network=bridge=br0   --ram=1024   --vcpu=2   --vnc
 --serial pty   --noautoconsole   --video cirrus

ERROR    'NoneType' object has no attribute 'sendall'
Domain installation does not appear to have been successful.
If it was, you can restart your domain by running:
  virsh --connect xen:/// start sled-12-fcs-64-pv-nnm-nete5250fdfecc94f922b5a21a
otherwise, please restart your installation.

Root cause is: now we use cached fetcher, but still do cleanupLocation
each time, it will cause problem when using the fetcher next time.
We should only do cleanupLocation at last time.

Signed-off-by: Chunyan Liu <cyliu at suse.com>
 virtinst/distroinstaller.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/virtinst/distroinstaller.py b/virtinst/distroinstaller.py
index 1b792d4..c347ba6 100644
--- a/virtinst/distroinstaller.py
+++ b/virtinst/distroinstaller.py
@@ -488,7 +488,9 @@ class DistroInstaller(Installer):
             # This will throw an error for us
             ignore = self._get_store(guest, fetcher)
-            fetcher.cleanupLocation()
+            # skip fetcher.cleanupLocation(), now that we use cached
+            # fetcher, only need to cleanup at last time
+            pass
         return True
     def detect_distro(self, guest):
@@ -502,7 +504,8 @@ class DistroInstaller(Installer):
                     store = self._get_store(guest, fetcher)
                     distro = store.get_osdict_info()
-                    fetcher.cleanupLocation()
+                    # skip fetcher.cleanupLocation()
+                    pass
             elif self.conn.is_remote():
                 logging.debug("Can't detect distro for media on "
                     "remote connection.")

More information about the virt-tools-list mailing list