From b257ada9a84fa4db72eb5ef1157bbe1f32e5257d Mon Sep 17 00:00:00 2001 From: Claus Lohmar Date: Mon, 27 Jul 2026 12:35:16 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20remove=20pvesm=20config=20content=20chec?= =?UTF-8?q?k=20=E2=80=94=20show=20all=20compatible=20pools,=20user=20can?= =?UTF-8?q?=20pick?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app.py | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/backend/app.py b/backend/app.py index 572c0e5..1d04826 100644 --- a/backend/app.py +++ b/backend/app.py @@ -96,14 +96,11 @@ def health() -> HealthResponse: @app.get(f"{API_PREFIX}/storage/pools") def storage_pools(): - """Return available Proxmox storage pools that support VM disk images.""" + """Return available Proxmox storage pools that can host VM disks.""" result = [] try: import subprocess 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: @@ -113,22 +110,11 @@ def storage_pools(): continue if stype not in ("lvmthin", "zfspool", "rbd", "dir", "nfs"): continue - content = "" - try: - 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 "" - logger.info(" pool %s (%s) content=%r", name, stype, content) - except Exception as exc: - logger.warning(" pvesm config %s failed: %s", name, exc) - if "images" not in content: - continue result.append({"name": name, "type": stype}) except Exception as exc: logger.warning("Storage pool discovery failed: %s", exc) - logger.info("Storage pools found: %s", [p["name"] for p in result]) + logger.info("Storage pools: %s", [p["name"] for p in result]) return {"pools": result}