From b4058918158f8996453c03c2fd47b4691e6e5935 Mon Sep 17 00:00:00 2001 From: codefiles <11915375+codefiles@users.noreply.github.com> Date: Wed, 8 Nov 2023 21:26:01 -0500 Subject: [PATCH] Fix logic error in `encrypt()` loop --- archinstall/lib/luks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/archinstall/lib/luks.py b/archinstall/lib/luks.py index ea09ae7cc5..4b3b3bc7b6 100644 --- a/archinstall/lib/luks.py +++ b/archinstall/lib/luks.py @@ -90,14 +90,14 @@ def encrypt( # Retry formatting the volume because archinstall can some times be too quick # which generates a "Device /dev/sdX does not exist or access denied." between # setting up partitions and us trying to encrypt it. - for retry_attempt in range(storage['DISK_RETRY_ATTEMPTS']): + for retry_attempt in range(storage['DISK_RETRY_ATTEMPTS'] + 1): try: SysCommand(cryptsetup_args) break except SysCallError as err: time.sleep(storage['DISK_TIMEOUTS']) - if retry_attempt != storage['DISK_RETRY_ATTEMPTS'] - 1: + if retry_attempt != storage['DISK_RETRY_ATTEMPTS']: continue if err.exit_code == 1: