Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2021-11-18 15:26:06 +0000
committerGitHub <noreply@github.com>2021-11-18 15:26:06 +0000
commit37c84e1781a6813804f5bb8c65709e91b331b334 (patch)
tree1a2108d295d64dc91333ec2704a61b860c4d07d5 /archinstall
parentb7e7909512bc53a4978c6e7084c70c610abdf45d (diff)
parentc90fe0705599fe95cd5ac5a6460d2337dab55959 (diff)
Merge pull request #734 from archlinux/torxed-fix-luks
Error handling when PARTUUID is missing during __repr__
Diffstat (limited to 'archinstall')
-rw-r--r--archinstall/lib/disk/partition.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/archinstall/lib/disk/partition.py b/archinstall/lib/disk/partition.py
index 2469a390..39d67873 100644
--- a/archinstall/lib/disk/partition.py
+++ b/archinstall/lib/disk/partition.py
@@ -64,10 +64,14 @@ class Partition:
elif self.target_mountpoint:
mount_repr = f", rel_mountpoint={self.target_mountpoint}"
- if self._encrypted:
- return f'Partition(path={self.path}, size={self.size}, PARTUUID={self.uuid}, parent={self.real_device}, fs={self.filesystem}{mount_repr})'
- else:
- return f'Partition(path={self.path}, size={self.size}, PARTUUID={self.uuid}, fs={self.filesystem}{mount_repr})'
+ try:
+ if self._encrypted:
+ return f'Partition(path={self.path}, size={self.size}, PARTUUID={self.uuid}, parent={self.real_device}, fs={self.filesystem}{mount_repr})'
+ else:
+ return f'Partition(path={self.path}, size={self.size}, PARTUUID={self.uuid}, fs={self.filesystem}{mount_repr})'
+ except DiskError:
+ # DiskErrors occur when we cannot retrieve the UUID of the partition, usually due to encryption or a slow disk.
+ return f'Partition(path={self.path}, size={self.size}, PARTUUID=None, fs={self.filesystem}{mount_repr})'
def __dump__(self):
return {