Skip to content

Commit

Permalink
Fix logic error in _fetch_lsblk_info() loop (#2196)
Browse files Browse the repository at this point in the history
  • Loading branch information
codefiles committed Oct 31, 2023
1 parent 2831c97 commit 5b6cab2
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions archinstall/lib/disk/device_model.py
Original file line number Diff line number Diff line change
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 retry_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 retry_attempt == retry:
raise err

time.sleep(1)
Expand Down

0 comments on commit 5b6cab2

Please sign in to comment.