From 4465caa9fd83d9599423b301e542e05da01efaf5 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Sat, 8 Oct 2022 18:45:31 -0700 Subject: [PATCH] Skip empty devices --- scripts/wk/hw/disk.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/wk/hw/disk.py b/scripts/wk/hw/disk.py index af454005..c84fa69d 100644 --- a/scripts/wk/hw/disk.py +++ b/scripts/wk/hw/disk.py @@ -373,6 +373,10 @@ def get_disks_linux() -> list[Disk]: if disk_obj.raw_details.get('type', '???') != 'disk': continue + # Skip empty devices (usually card readers) + if disk_obj.size <= 0: + continue + # Add disk disks.append(disk_obj)