mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-20 05:05:14 +02:00
fix: send the docker force query parameter as a string
The aiohttp URL builder only accepts strings, ints and floats as query values and raises a TypeError on a Python bool, so deleting an image answered a 500. Send true/false like the controller does.
This commit is contained in:
2 files changed
+4
-2
No files matched your search
@@ -341,7 +341,9 @@ async def test_delete_image():
|
||||
|
||||
with asyncio_patch("gns3server.compute.docker.Docker.query") as mock:
|
||||
await docker.delete_image("ubuntu:latest", force=True)
|
||||
mock.assert_called_with("DELETE", "images/ubuntu:latest", params={"force": True})
|
||||
# the daemon query string only accepts strings, ints and floats: a
|
||||
# Python bool would make the aiohttp URL builder raise a TypeError
|
||||
mock.assert_called_with("DELETE", "images/ubuntu:latest", params={"force": "true"})
|
||||
# deleting the image drops the id translation recorded for a previous sync
|
||||
assert docker.image_id_translation("ubuntu:latest") is None
|
||||
|
||||
|
||||
Reference in new issue
Block a user