Skip to content

Commit

Permalink
Fix logic error in _fetch_lsblk_info() loop
Browse files Browse the repository at this point in the history
  • Loading branch information
codefiles committed Oct 29, 2023
1 parent 2831c97 commit 2077ff5
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions archinstall/lib/disk/device_model.py
Expand Up @@ -1106,10 +1106,7 @@ def _fetch_lsblk_info(dev_path: Optional[Union[Path, str]] = None, retry: int =
if not dev_path:
dev_path = ''

if retry == 0:
retry = 1

for retry_attempt in range(retry):
for attempt in range(retry + 1):
try:
result = SysCommand(f'lsblk --json -b -o+{lsblk_fields} {dev_path}').decode()
break
Expand All @@ -1121,7 +1118,7 @@ def _fetch_lsblk_info(dev_path: Optional[Union[Path, str]] = None, retry: int =
else:
raise err

if retry_attempt == retry - 1:
if attempt == retry:
raise err

time.sleep(1)
Expand Down

0 comments on commit 2077ff5

Please sign in to comment.