Retry cleanup commands if they fail
authorNikos Skalkotos <skalkoto@grnet.gr>
Sun, 30 Dec 2012 22:37:07 +0000 (00:37 +0200)
committerNikos Skalkotos <skalkoto@grnet.gr>
Sun, 30 Dec 2012 23:22:24 +0000 (01:22 +0200)
commitf3845095c7f8802c4dd40d7679e14831d7f70b59
tree3daeb178a0c104d64b9ad226f53602e2403a0f57
parent567891a691b1e753ea5dbee6c9c43ee05da40f66
Retry cleanup commands if they fail

Add a new try_fail_repeat function that wraps cleanup system commands
and retries them if they fail. There are cases where commands like
dmsetup, umount and losetup -d may fail with device is busy. In most
of the cases, sleeping for halve a second and retrying does the job.
image_creator/bundle_volume.py
image_creator/disk.py
image_creator/util.py