imgutils: fix umount retry handling

When umount fails it doesn't throw an error, so retry when the rv is
non-zero instead.
This commit is contained in:
Brian C. Lane 2012-08-20 16:47:14 -07:00
parent 97cfc71664
commit 340349b763

View File

@ -128,7 +128,12 @@ def umount(mnt, lazy=False, maxretry=3, retrysleep=1.0):
while maxretry > 0:
try:
rv = execWithRedirect(umount[0], umount[1:])
except CalledProcessError:
except Exception:
# execWithRedirect will log what the errors was, so we can just
# ignore it and retry.
pass
if rv != 0:
count += 1
if count == maxretry:
raise