Fix logic error in `encrypt()` loop (#2207)

This commit is contained in:
codefiles 2023-11-09 06:47:30 -05:00 committed by GitHub
parent c9755b35e7
commit 940468117a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -90,14 +90,14 @@ class Luks2:
# Retry formatting the volume because archinstall can some times be too quick # 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 # which generates a "Device /dev/sdX does not exist or access denied." between
# setting up partitions and us trying to encrypt it. # 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: try:
SysCommand(cryptsetup_args) SysCommand(cryptsetup_args)
break break
except SysCallError as err: except SysCallError as err:
time.sleep(storage['DISK_TIMEOUTS']) time.sleep(storage['DISK_TIMEOUTS'])
if retry_attempt != storage['DISK_RETRY_ATTEMPTS'] - 1: if retry_attempt != storage['DISK_RETRY_ATTEMPTS']:
continue continue
if err.exit_code == 1: if err.exit_code == 1: