From 3280d6688852ba5f28c873e7a2716f6b9518b53d Mon Sep 17 00:00:00 2001 From: adam Date: Sat, 7 Mar 2026 04:20:42 +0000 Subject: [PATCH] Fix vdev parsing: use leading whitespace count instead of tab count --- services/zfs.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/services/zfs.py b/services/zfs.py index 3218371..8bca249 100644 --- a/services/zfs.py +++ b/services/zfs.py @@ -59,11 +59,11 @@ async def get_zfs_pool_map() -> dict[str, dict]: if not in_config or not current_pool: continue - # Count leading tab depth to distinguish pool/vdev/device lines. - # Pool name = 1 tab, vdev = 2 tabs, device = 3+ tabs - tab_count = len(line) - len(line.lstrip('\t')) + # Indentation: 1 tab = pool name, 1 tab + 2 spaces = vdev, + # 1 tab + 4 spaces = device. Count chars before content. + leading = len(line) - len(line.lstrip()) - if tab_count == 2 and "/dev/" not in stripped: + if "/dev/" not in stripped and leading == 3: # This is a vdev line (mirror-0, raidz2-0, etc.) current_vdev = stripped.split()[0] elif "/dev/" in stripped: