fix: storage pool list now filters by content type — only pools with 'images' support are shown
This commit is contained in:
parent
7eb2d6bb45
commit
e3bc7929c6
1 changed files with 7 additions and 5 deletions
|
|
@ -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"})
|
||||
|
|
|
|||
Loading…
Reference in a new issue