From 0e87bf55a0f4e1a10720d9cadec43344f37e4514 Mon Sep 17 00:00:00 2001 From: 2Shirt <1923621+2Shirt@users.noreply.github.com> Date: Mon, 15 Jan 2018 13:45:58 -0700 Subject: [PATCH] Enable HW-Diags for more devices * Skip all removable WizardKit devices * Fixes issue #8 --- .bin/Scripts/functions/hw_diags.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.bin/Scripts/functions/hw_diags.py b/.bin/Scripts/functions/hw_diags.py index 8b2c164e..99a6a3ed 100644 --- a/.bin/Scripts/functions/hw_diags.py +++ b/.bin/Scripts/functions/hw_diags.py @@ -410,10 +410,18 @@ def scan_disks(): json_data = json.loads(result.stdout.decode()) devs = {} for d in json_data.get('blockdevices', []): - if d['type'] == 'disk' and d['hotplug'] == '0': - devs[d['name']] = {'lsblk': d} - TESTS['NVMe/SMART']['Status'][d['name']] = 'Pending' - TESTS['badblocks']['Status'][d['name']] = 'Pending' + if d['type'] == 'disk': + if d['hotplug'] == '0': + devs[d['name']] = {'lsblk': d} + TESTS['NVMe/SMART']['Status'][d['name']] = 'Pending' + TESTS['badblocks']['Status'][d['name']] = 'Pending' + else: + # Skip WizardKit devices + wk_label = '{}_LINUX'.format(KIT_NAME_SHORT) + if wk_label not in [c.get('label', '') for c in d['children']]: + devs[d['name']] = {'lsblk': d} + TESTS['NVMe/SMART']['Status'][d['name']] = 'Pending' + TESTS['badblocks']['Status'][d['name']] = 'Pending' for dev, data in devs.items(): # Get SMART attributes