From d4726acd6550abb8eacbfb4762ff6135da83fd0c Mon Sep 17 00:00:00 2001 From: Claus Lohmar Date: Mon, 27 Jul 2026 09:18:08 +0000 Subject: [PATCH] fix: use full path /usr/sbin/pvesm, add debug logging, remove local-lvm fallback --- backend/app.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/backend/app.py b/backend/app.py index b06e7b8..1323a18 100644 --- a/backend/app.py +++ b/backend/app.py @@ -100,7 +100,10 @@ def storage_pools(): result = [] try: import subprocess - out = subprocess.run(["pvesm", "status"], capture_output=True, text=True, timeout=10) + out = subprocess.run(["/usr/sbin/pvesm", "status"], capture_output=True, text=True, timeout=10) + logger.info("pvesm status returned %d lines, rc=%d", len(out.stdout.split("\n")), out.returncode) + if out.stderr: + logger.warning("pvesm stderr: %s", out.stderr.strip()[:200]) for line in out.stdout.split("\n")[1:]: parts = line.split() if len(parts) < 3: @@ -110,10 +113,9 @@ def storage_pools(): continue if stype not in ("lvmthin", "zfspool", "rbd", "dir", "nfs"): continue - # Verify content includes images content = "" try: - cp = subprocess.run(["pvesm", "config", name], capture_output=True, text=True, timeout=5) + cp = subprocess.run(["/usr/sbin/pvesm", "config", name], capture_output=True, text=True, timeout=5) for cl in cp.stdout.split("\n"): if cl.strip().startswith("content"): content = cl.strip().split(None, 1)[1] if len(cl.strip().split(None, 1)) > 1 else "" @@ -122,12 +124,10 @@ def storage_pools(): if "images" not in content: continue result.append({"name": name, "type": stype}) - except Exception: - pass - - if not result: - result.append({"name": "local-lvm", "type": "lvmthin"}) + except Exception as exc: + logger.warning("Storage pool discovery failed: %s", exc) + logger.info("Storage pools found: %s", [p["name"] for p in result]) return {"pools": result}