Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/disk/blockdevice.py
diff options
context:
space:
mode:
Diffstat (limited to 'archinstall/lib/disk/blockdevice.py')
-rw-r--r--archinstall/lib/disk/blockdevice.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/archinstall/lib/disk/blockdevice.py b/archinstall/lib/disk/blockdevice.py
index 4e207bf4..736bacbc 100644
--- a/archinstall/lib/disk/blockdevice.py
+++ b/archinstall/lib/disk/blockdevice.py
@@ -88,9 +88,6 @@ class BlockDevice:
raise KeyError(f'{self.info} does not contain information: "{key}"')
- def __len__(self) -> int:
- return len(self.partitions)
-
def __lt__(self, left_comparitor :'BlockDevice') -> bool:
return self._path < left_comparitor.path
@@ -121,6 +118,8 @@ class BlockDevice:
def _load_partitions(self):
from .partition import Partition
+ self._partitions.clear()
+
lsblk_info = self._call_lsblk(self._path)
device = lsblk_info['blockdevices'][0]
self._partitions.clear()
@@ -233,8 +232,6 @@ class BlockDevice:
@property
def partitions(self) -> Dict[str, 'Partition']:
- self._partprobe()
- self._load_partitions()
return OrderedDict(sorted(self._partitions.items()))
@property
@@ -282,7 +279,7 @@ class BlockDevice:
try:
if uuid and partition.uuid and partition.uuid.lower() == uuid.lower():
return partition
- elif partuuid and partition.part_uuid.lower() == partuuid.lower():
+ elif partuuid and partition.part_uuid and partition.part_uuid.lower() == partuuid.lower():
return partition
except DiskError as error:
# Most likely a blockdevice that doesn't support or use UUID's
@@ -291,6 +288,7 @@ class BlockDevice:
pass
log(f"uuid {uuid} or {partuuid} not found. Waiting {storage.get('DISK_TIMEOUTS', 1) * count}s for next attempt",level=logging.DEBUG)
+ self.flush_cache()
time.sleep(storage.get('DISK_TIMEOUTS', 1) * count)
log(f"Could not find {uuid}/{partuuid} in disk after 5 retries", level=logging.INFO)