Don't add WK or loopback devices
This commit is contained in:
parent
70a742e69c
commit
6014a8fb70
1 changed files with 16 additions and 1 deletions
|
|
@ -171,7 +171,22 @@ class State():
|
||||||
result = run_program(cmd, check=False)
|
result = run_program(cmd, check=False)
|
||||||
json_data = json.loads(result.stdout.decode())
|
json_data = json.loads(result.stdout.decode())
|
||||||
for dev in json_data['blockdevices']:
|
for dev in json_data['blockdevices']:
|
||||||
self.devs.append(DevObj(dev['name']))
|
skip_dev = False
|
||||||
|
dev_obj = DevObj(dev['name'])
|
||||||
|
|
||||||
|
# Skip loopback devices
|
||||||
|
if dev_obj.lsblk['tran'] == 'NONE':
|
||||||
|
skip_dev = True
|
||||||
|
|
||||||
|
# Skip WK devices
|
||||||
|
wk_label_regex = r'{}_(LINUX|UFD)'.format(KIT_NAME_SHORT)
|
||||||
|
for label in dev_obj.labels:
|
||||||
|
if re.search(wk_label_regex, label, re.IGNORECASE):
|
||||||
|
skip_dev = True
|
||||||
|
|
||||||
|
# Add device
|
||||||
|
if not skip_dev:
|
||||||
|
self.devs.append(DevObj(dev['name']))
|
||||||
|
|
||||||
# Functions
|
# Functions
|
||||||
def generate_horizontal_graph(rates, oneline=False):
|
def generate_horizontal_graph(rates, oneline=False):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue