index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Anton Hvornum <anton@hvornum.se> | 2021-11-05 16:56:56 +0100 |
---|---|---|
committer | Anton Hvornum <anton@hvornum.se> | 2021-11-05 16:56:56 +0100 |
commit | 2f677e2e8672a242822ac7a9dc2970011317f223 (patch) | |
tree | 9c8b539f99a25c3dcf9096ad9f8ff15482a4f413 /archinstall/lib/disk/blockdevice.py | |
parent | aa1afdbeb05f4bc762befebfa49464cc5c56922e (diff) | |
parent | 31a7a85e04e05f46208b026881ced5d9db190fe5 (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 |