Wait for LVM info to appear (#2778)

* Wait forever for LVM info

* Update
This commit is contained in:
Daniel Girtler 2024-11-10 00:20:25 +11:00 committed by GitHub
parent de664dfa39
commit 28eaa8c0e4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 6 deletions

View File

@ -368,15 +368,11 @@ class DeviceHandler(object):
return None
def _lvm_info_with_retry(self, cmd: str, info_type: Literal['lv', 'vg', 'pvseg']) -> Optional[Any]:
attempts = 3
for attempt_nr in range(attempts):
while True:
try:
return self._lvm_info(cmd, info_type)
except ValueError:
time.sleep(attempt_nr + 1)
raise ValueError(f'Failed to fetch {info_type} information')
time.sleep(3)
def lvm_vol_info(self, lv_name: str) -> Optional[LvmVolumeInfo]:
cmd = (