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 15:48:03 +0000
committerGitHub <noreply@github.com>2021-11-05 15:48:03 +0000
commit0071a069080732047e11309134869f3ab40c642c (patch)
tree9ae4cde24f02046ccdc93a988c09273619cd545c /archinstall/lib/disk/blockdevice.py
parent3993917462219de75cd00aefdd4fe318402a22af (diff)
parentb6ab6786316c5e4d8101007c4e96e64585aa7234 (diff)
Merged PR #650 - flake8 fixes and tightening
Tighten up flake8 tests used by GitHub Action lint_python
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