From 776823adfb2d9ea140b9d849ee9a1dd07991a94c Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Thu, 18 Nov 2021 13:07:28 +0000 Subject: Increased disk delays by 100% (for unsuccessful operations), successful should still be quick. (#730) Co-authored-by: Anton Hvornum --- archinstall/lib/disk/filesystem.py | 4 ++-- archinstall/lib/disk/partition.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'archinstall/lib/disk') diff --git a/archinstall/lib/disk/filesystem.py b/archinstall/lib/disk/filesystem.py index fe7be498..93b0f375 100644 --- a/archinstall/lib/disk/filesystem.py +++ b/archinstall/lib/disk/filesystem.py @@ -33,7 +33,7 @@ class Filesystem: return True def partuuid_to_index(self, uuid): - for i in range(10): + for i in range(storage['DISK_RETRY_ATTEMPTS']): self.partprobe() output = json.loads(SysCommand(f"lsblk --json -o+PARTUUID {self.blockdevice.device}").decode('UTF-8')) @@ -42,7 +42,7 @@ class Filesystem: if (partuuid := partition.get('partuuid', None)) and partuuid.lower() == uuid: return index - time.sleep(1) + time.sleep(storage['DISK_TIMEOUTS']) raise DiskError(f"Failed to convert PARTUUID {uuid} to a partition index number on blockdevice {self.blockdevice.device}") diff --git a/archinstall/lib/disk/partition.py b/archinstall/lib/disk/partition.py index faa0838f..90e1aeea 100644 --- a/archinstall/lib/disk/partition.py +++ b/archinstall/lib/disk/partition.py @@ -147,7 +147,7 @@ class Partition: This is more reliable than relying on /dev/disk/by-partuuid as it doesn't seam to be able to detect md raid partitions. """ - for i in range(10): + for i in range(storage['DISK_RETRY_ATTEMPTS']): self.partprobe() partuuid_struct = SysCommand(f'lsblk -J -o+PARTUUID {self.path}') @@ -155,7 +155,7 @@ class Partition: if partition_information := next(iter(json.loads(partuuid_struct.decode('UTF-8'))['blockdevices']), None): return partition_information.get('partuuid', None) - time.sleep(1) + time.sleep(storage['DISK_TIMEOUTS']) raise DiskError(f"Could not get PARTUUID for {self.path} using 'lsblk -J -o+PARTUUID {self.path}'") -- cgit v1.2.3-70-g09d2