index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Anton Hvornum <anton.feeds@gmail.com> | 2021-11-18 15:29:59 +0000 |
---|---|---|
committer | Anton Hvornum <anton.feeds@gmail.com> | 2021-11-18 15:29:59 +0000 |
commit | 61bc59f5bfe1eb848bcb5ba891921544fd70c2e2 (patch) | |
tree | 53eed970bea31ce975b112ded8f4df2eebbbe46d | |
parent | c90fe0705599fe95cd5ac5a6460d2337dab55959 (diff) |
-rw-r--r-- | archinstall/lib/disk/partition.py | 21 |
diff --git a/archinstall/lib/disk/partition.py b/archinstall/lib/disk/partition.py index 39d67873..cfb46015 100644 --- a/archinstall/lib/disk/partition.py +++ b/archinstall/lib/disk/partition.py @@ -64,19 +64,15 @@ class Partition: elif self.target_mountpoint: mount_repr = f", rel_mountpoint={self.target_mountpoint}" - 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})' + if self._encrypted: + return f'Partition(path={self.path}, size={self.size}, PARTUUID={self._safe_uuid}, parent={self.real_device}, fs={self.filesystem}{mount_repr})' + else: + return f'Partition(path={self.path}, size={self.size}, PARTUUID={self._safe_uuid}, fs={self.filesystem}{mount_repr})' def __dump__(self): return { 'type' : 'primary', - 'PARTUUID' : self.uuid, + 'PARTUUID' : self._safe_uuid, 'wipe' : self.allow_formatting, 'boot' : self.boot, 'ESP' : self.boot, @@ -165,6 +161,13 @@ class Partition: raise DiskError(f"Could not get PARTUUID for {self.path} using 'lsblk -J -o+PARTUUID {self.path}'") @property + def _safe_uuid(self): + try: + return self.uuid + except DiskError: + return None + + @property def encrypted(self): return self._encrypted |