mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-08-27 12:30:13 +03:00
fix: Remove .json() calls on 204 responses for prune/install images
This commit is contained in:
parent
9d7c482288
commit
828a770489
@ -65,11 +65,13 @@ def delete_image_handler(params: dict[str, Any], gns3_ctx: dict[str, Any]) -> di
|
||||
|
||||
def prune_images_handler(params: dict[str, Any], gns3_ctx: dict[str, Any]) -> dict[str, Any]:
|
||||
conn = _get_connector(gns3_ctx)
|
||||
result = conn.http_call("delete", f"{conn.base_url}/images/prune").json()
|
||||
return {"message": "Unused images pruned", "result": result}
|
||||
# Returns 204 No Content on success (empty body, no .json())
|
||||
conn.http_call("delete", f"{conn.base_url}/images/prune")
|
||||
return {"message": "Unused images pruned"}
|
||||
|
||||
|
||||
def install_images_handler(params: dict[str, Any], gns3_ctx: dict[str, Any]) -> dict[str, Any]:
|
||||
conn = _get_connector(gns3_ctx)
|
||||
result = conn.http_call("post", f"{conn.base_url}/images/install").json()
|
||||
return {"message": "Image installation requested", "result": result}
|
||||
# Returns 204 No Content on success (empty body, no .json())
|
||||
conn.http_call("post", f"{conn.base_url}/images/install")
|
||||
return {"message": "Image installation completed"}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user