]> git.siccegge.de Git - forks/vmdebootstrap.git/commitdiff
Apply patch from Neil Williams to fix kpartx timing problem
authorLars Wirzenius <liw@liw.fi>
Tue, 18 Mar 2014 21:40:32 +0000 (21:40 +0000)
committerLars Wirzenius <liw@liw.fi>
Tue, 18 Mar 2014 21:40:32 +0000 (21:40 +0000)
vmdebootstrap

index a6d43acf1bf21fb3286684ba65c6f25d11b81573..a8126fd99f881bc0a833eaa9542a0e91af886649 100755 (executable)
@@ -23,6 +23,7 @@ import re
 import shutil
 import subprocess
 import tempfile
+import time
 
 
 __version__ = '0.2'
@@ -469,10 +470,15 @@ append initrd=%(initrd)s root=UUID=%(uuid)s ro %(kserial)s
         if self.settings['image']:
             for i in xrange(len(self.mount_points) - 1, -1, -1):
                 mount_point = self.mount_points[i]
-                self.runcmd(['umount', mount_point], ignore_fail=True)
+                try:
+                    self.runcmd(['umount', mount_point], ignore_fail=False)
+                except cliapp.AppException:
+                    logging.debug("umount failed, sleeping and trying again")
+                    time.sleep(5)
+                    self.runcmd(['umount', mount_point], ignore_fail=False)
 
             self.runcmd(['kpartx', '-d', self.settings['image']], ignore_fail=True)
-        
+
         for dirname in self.remove_dirs:
             shutil.rmtree(dirname)