Revision 234b4f82
b/lib/backend.py | ||
---|---|---|
1834 | 1834 |
rdev = None |
1835 | 1835 |
if rdev is not None: |
1836 | 1836 |
r_path = rdev.dev_path |
1837 |
try: |
|
1838 |
rdev.Remove() |
|
1839 |
except errors.BlockDeviceError, err: |
|
1840 |
msgs.append(str(err)) |
|
1837 |
def insistremove(): |
|
1838 |
try: |
|
1839 |
rdev.Remove() |
|
1840 |
return [] |
|
1841 |
except errors.BlockDeviceError, err: |
|
1842 |
return msgs.append(str(err)) |
|
1843 |
|
|
1844 |
utils.SimpleRetry([], insistremove, |
|
1845 |
constants.DISK_REMOVE_RETRY_INTERVAL, |
|
1846 |
constants.DISK_REMOVE_RETRY_TIMEOUT) |
|
1841 | 1847 |
if not msgs: |
1842 | 1848 |
DevCacheManager.RemoveCache(r_path) |
1843 | 1849 |
|
b/lib/constants.py | ||
---|---|---|
2495 | 2495 |
OPCODE_REASON_SRC_USER, |
2496 | 2496 |
]) |
2497 | 2497 |
|
2498 |
# Timeouts for disk removal |
|
2499 |
DISK_REMOVE_RETRY_INTERVAL = 3 |
|
2500 |
DISK_REMOVE_RETRY_TIMEOUT = 30 |
|
2501 |
|
|
2498 | 2502 |
# Do not re-export imported modules |
2499 | 2503 |
del re, _vcsversion, _autoconf, socket, pathutils, compat |
Also available in: Unified diff