From 5b6cab27f10bffa343eeff573b2bf90262da634b Mon Sep 17 00:00:00 2001 From: codefiles <11915375+codefiles@users.noreply.github.com> Date: Tue, 31 Oct 2023 12:57:59 -0400 Subject: Fix logic error in `_fetch_lsblk_info()` loop (#2196) --- archinstall/lib/disk/device_model.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'archinstall/lib') diff --git a/archinstall/lib/disk/device_model.py b/archinstall/lib/disk/device_model.py index cd955851..15e68116 100644 --- a/archinstall/lib/disk/device_model.py +++ b/archinstall/lib/disk/device_model.py @@ -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 @@ -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) -- cgit v1.2.3-70-g09d2