Wait for LVM info to appear (#2778)
* Wait forever for LVM info * Update
This commit is contained in:
parent
de664dfa39
commit
28eaa8c0e4
|
|
@ -368,15 +368,11 @@ class DeviceHandler(object):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def _lvm_info_with_retry(self, cmd: str, info_type: Literal['lv', 'vg', 'pvseg']) -> Optional[Any]:
|
def _lvm_info_with_retry(self, cmd: str, info_type: Literal['lv', 'vg', 'pvseg']) -> Optional[Any]:
|
||||||
attempts = 3
|
while True:
|
||||||
|
|
||||||
for attempt_nr in range(attempts):
|
|
||||||
try:
|
try:
|
||||||
return self._lvm_info(cmd, info_type)
|
return self._lvm_info(cmd, info_type)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
time.sleep(attempt_nr + 1)
|
time.sleep(3)
|
||||||
|
|
||||||
raise ValueError(f'Failed to fetch {info_type} information')
|
|
||||||
|
|
||||||
def lvm_vol_info(self, lv_name: str) -> Optional[LvmVolumeInfo]:
|
def lvm_vol_info(self, lv_name: str) -> Optional[LvmVolumeInfo]:
|
||||||
cmd = (
|
cmd = (
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue