Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/disk/blockdevice.py
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2021-11-05 16:56:56 +0100
committerAnton Hvornum <anton@hvornum.se>2021-11-05 16:56:56 +0100
commit2f677e2e8672a242822ac7a9dc2970011317f223 (patch)
tree9c8b539f99a25c3dcf9096ad9f8ff15482a4f413 /archinstall/lib/disk/blockdevice.py
parentaa1afdbeb05f4bc762befebfa49464cc5c56922e (diff)
parent31a7a85e04e05f46208b026881ced5d9db190fe5 (diff)
Merge branch 'master' of github.com:archlinux/archinstall into torxed-fix-682
Diffstat (limited to 'archinstall/lib/disk/blockdevice.py')
-rw-r--r--archinstall/lib/disk/blockdevice.py14
1 files changed, 9 insertions, 5 deletions
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