Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/disk
diff options
context:
space:
mode:
authorSteven Lee <stevenlee123@protonmail.com>2021-11-19 14:09:47 +1100
committerSteven Lee <stevenlee123@protonmail.com>2021-11-19 14:09:47 +1100
commit91d030a09c26f56ece0de72e3536ad31d48595ec (patch)
tree7cb45b216096ff972658216de96d9927469fa80a /archinstall/lib/disk
parent5ec690da939ff5b2efb3ba2ffe177cb035c25ee6 (diff)
source code improvement
Diffstat (limited to 'archinstall/lib/disk')
-rw-r--r--archinstall/lib/disk/partition.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/archinstall/lib/disk/partition.py b/archinstall/lib/disk/partition.py
index f8378d47..e2083649 100644
--- a/archinstall/lib/disk/partition.py
+++ b/archinstall/lib/disk/partition.py
@@ -136,7 +136,7 @@ class Partition:
@property
def partition_type(self):
lsblk = json.loads(SysCommand(f"lsblk --json -o+PTTYPE {self.path}").decode('UTF-8'))
-
+
for device in lsblk['blockdevices']:
return device['pttype']
@@ -153,7 +153,7 @@ class Partition:
partuuid_struct = SysCommand(f'lsblk -J -o+PARTUUID {self.path}')
if partuuid_struct.exit_code == 0:
if partition_information := next(iter(json.loads(partuuid_struct.decode('UTF-8'))['blockdevices']), None):
- if (partuuid := partition_information.get('partuuid', None)):
+ if partuuid := partition_information.get('partuuid', None):
return partuuid
time.sleep(storage['DISK_TIMEOUTS'])
@@ -172,7 +172,7 @@ class Partition:
partuuid_struct = SysCommand(f'lsblk -J -o+PARTUUID {self.path}')
if partuuid_struct.exit_code == 0:
if partition_information := next(iter(json.loads(partuuid_struct.decode('UTF-8'))['blockdevices']), None):
- if (partuuid := partition_information.get('partuuid', None)):
+ if partuuid := partition_information.get('partuuid', None):
return partuuid
@property
@@ -296,7 +296,7 @@ class Partition:
elif filesystem == 'f2fs':
options = ['-f'] + options
-
+
if (handle := SysCommand(f"/usr/bin/mkfs.f2fs {' '.join(options)} {path}")).exit_code != 0:
raise DiskError(f"Could not format {path} with {filesystem} because: {handle.decode('UTF-8')}")
self.filesystem = filesystem
@@ -378,7 +378,7 @@ class Partition:
try:
self.format(self.filesystem, '/dev/null', log_formatting=False, allow_formatting=True)
except (SysCallError, DiskError):
- pass # We supported it, but /dev/null is not formatable as expected so the mkfs call exited with an error code
+ pass # We supported it, but /dev/null is not formattable as expected so the mkfs call exited with an error code
except UnknownFilesystemFormat as err:
raise err
return True