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:
parent
97cfc71664
commit
340349b763
@ -128,7 +128,12 @@ def umount(mnt, lazy=False, maxretry=3, retrysleep=1.0):
|
|||||||
while maxretry > 0:
|
while maxretry > 0:
|
||||||
try:
|
try:
|
||||||
rv = execWithRedirect(umount[0], umount[1:])
|
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
|
count += 1
|
||||||
if count == maxretry:
|
if count == maxretry:
|
||||||
raise
|
raise
|
||||||
|
Loading…
Reference in New Issue
Block a user