fix: storage pool list now filters by content type — only pools with 'images' support are shown

This commit is contained in:
Claus Lohmar 2026-07-27 07:08:02 +00:00
parent 7eb2d6bb45
commit e3bc7929c6

View file

@ -96,7 +96,7 @@ def health() -> HealthResponse:
@app.get(f"{API_PREFIX}/storage/pools")
def storage_pools():
"""Return available Proxmox storage pools that support disk images."""
"""Return available Proxmox storage pools that support VM disk images."""
pools = []
try:
cfg = Path("/etc/pve/storage.cfg")
@ -126,10 +126,12 @@ def storage_pools():
result = []
for p in pools:
if p.get("type") in ("lvmthin", "zfspool", "rbd", "dir"):
result.append({
"name": p["name"],
"type": p["type"],
})
content = p.get("content", "")
if "images" in content:
result.append({
"name": p["name"],
"type": p["type"],
})
if not result:
result.append({"name": "local-lvm", "type": "lvmthin"})