Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/disk.py
diff options
context:
space:
mode:
authoradvaithm <advaith.madhukar@gmail.com>2021-05-12 15:45:45 +0530
committeradvaithm <advaith.madhukar@gmail.com>2021-05-12 15:45:45 +0530
commit69d079e63a00caf9268575a6ca4789962776761b (patch)
tree36f37872628fad6fe31711b23412f6e6e215f5e0 /archinstall/lib/disk.py
parentf45f036b6557859649c9b3d670d89b578c01067f (diff)
some type hint fixes and a bad catch fix
Diffstat (limited to 'archinstall/lib/disk.py')
-rw-r--r--archinstall/lib/disk.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/archinstall/lib/disk.py b/archinstall/lib/disk.py
index 44462a21..fd08ea63 100644
--- a/archinstall/lib/disk.py
+++ b/archinstall/lib/disk.py
@@ -1,3 +1,4 @@
+from typing import Optional
import glob, re, os, json, time, hashlib
import pathlib, traceback, logging
from collections import OrderedDict
@@ -205,7 +206,7 @@ class Partition():
return f'Partition(path={self.path}, size={self.size}, fs={self.filesystem}{mount_repr})'
@property
- def uuid(self) -> str:
+ def uuid(self) -> Optional[str]:
"""
Returns the PARTUUID as returned by lsblk.
This is more reliable than relying on /dev/disk/by-partuuid as
@@ -214,7 +215,7 @@ class Partition():
lsblk = b''.join(sys_command(f'lsblk -J -o+PARTUUID {self.path}'))
for partition in json.loads(lsblk.decode('UTF-8'))['blockdevices']:
return partition.get('partuuid', None)
-
+ return None
@property
def encrypted(self):
return self._encrypted