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")
|
@app.get(f"{API_PREFIX}/storage/pools")
|
||||||
def 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 = []
|
pools = []
|
||||||
try:
|
try:
|
||||||
cfg = Path("/etc/pve/storage.cfg")
|
cfg = Path("/etc/pve/storage.cfg")
|
||||||
|
|
@ -126,10 +126,12 @@ def storage_pools():
|
||||||
result = []
|
result = []
|
||||||
for p in pools:
|
for p in pools:
|
||||||
if p.get("type") in ("lvmthin", "zfspool", "rbd", "dir"):
|
if p.get("type") in ("lvmthin", "zfspool", "rbd", "dir"):
|
||||||
result.append({
|
content = p.get("content", "")
|
||||||
"name": p["name"],
|
if "images" in content:
|
||||||
"type": p["type"],
|
result.append({
|
||||||
})
|
"name": p["name"],
|
||||||
|
"type": p["type"],
|
||||||
|
})
|
||||||
|
|
||||||
if not result:
|
if not result:
|
||||||
result.append({"name": "local-lvm", "type": "lvmthin"})
|
result.append({"name": "local-lvm", "type": "lvmthin"})
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue