index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Anton Hvornum <anton@hvornum.se> | 2021-11-05 15:48:03 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-05 15:48:03 +0000 |
commit | 0071a069080732047e11309134869f3ab40c642c (patch) | |
tree | 9ae4cde24f02046ccdc93a988c09273619cd545c /archinstall/lib/disk/blockdevice.py | |
parent | 3993917462219de75cd00aefdd4fe318402a22af (diff) | |
parent | b6ab6786316c5e4d8101007c4e96e64585aa7234 (diff) |
-rw-r--r-- | archinstall/lib/disk/blockdevice.py | 14 |
diff --git a/archinstall/lib/disk/blockdevice.py b/archinstall/lib/disk/blockdevice.py index 0b0bb37c..fad04c7b 100644 --- a/archinstall/lib/disk/blockdevice.py +++ b/archinstall/lib/disk/blockdevice.py @@ -1,6 +1,10 @@ +# flake8: noqa +# The above ignore, see issue: https://github.com/archlinux/archinstall/pull/650#issuecomment-961995949 import os import json import logging +from .exceptions import DiskError +from .helpers import all_disks from ..output import log from ..general import SysCommand @@ -58,7 +62,7 @@ class BlockDevice: @property def partition_type(self): output = json.loads(SysCommand(f"lsblk --json -o+PTTYPE {self.path}").decode('UTF-8')) - + for device in output['blockdevices']: return device['pttype'] @@ -165,21 +169,21 @@ class BlockDevice: @property def size(self): output = json.loads(SysCommand(f"lsblk --json -o+SIZE {self.path}").decode('UTF-8')) - + for device in output['blockdevices']: return self.convert_size_to_gb(device['size']) @property def bus_type(self): output = json.loads(SysCommand(f"lsblk --json -o+ROTA,TRAN {self.path}").decode('UTF-8')) - + for device in output['blockdevices']: return device['tran'] - + @property def spinning(self): output = json.loads(SysCommand(f"lsblk --json -o+ROTA,TRAN {self.path}").decode('UTF-8')) - + for device in output['blockdevices']: return device['rota'] is True |