mirror of
https://github.com/GNS3/gns3-server
synced 2025-06-01 13:48:51 +00:00
Fix add existing IOS not working
Fix https://github.com/GNS3/gns3-gui/issues/775
This commit is contained in:
parent
7e7c8a5450
commit
7ee12edb5c
@ -733,5 +733,5 @@ class Dynamips(BaseManager):
|
|||||||
continue
|
continue
|
||||||
# valid IOS images must start with the ELF magic number, be 32-bit, big endian and have an ELF version of 1
|
# valid IOS images must start with the ELF magic number, be 32-bit, big endian and have an ELF version of 1
|
||||||
if elf_header_start == b'\x7fELF\x01\x02\x01':
|
if elf_header_start == b'\x7fELF\x01\x02\x01':
|
||||||
images.append({"filename": filename})
|
images.append({"filename": filename, "path": path})
|
||||||
return images
|
return images
|
||||||
|
@ -26,13 +26,16 @@ VM_LIST_IMAGES_SCHEMA = {
|
|||||||
"properties": {
|
"properties": {
|
||||||
"filename": {
|
"filename": {
|
||||||
"description": "Image filename",
|
"description": "Image filename",
|
||||||
"type": "string"
|
"type": "string",
|
||||||
|
"minLength": 1
|
||||||
},
|
},
|
||||||
"path": {
|
"path": {
|
||||||
"description": "Image path",
|
"description": "Image path",
|
||||||
"type": "string"
|
"type": "string",
|
||||||
|
"minLength": 1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"required": ["filename", "path"],
|
||||||
"additionalProperties": False
|
"additionalProperties": False
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -156,7 +156,7 @@ def test_vms(server, tmpdir, fake_dynamips, fake_file):
|
|||||||
with patch("gns3server.modules.Dynamips.get_images_directory", return_value=str(tmpdir), example=True):
|
with patch("gns3server.modules.Dynamips.get_images_directory", return_value=str(tmpdir), example=True):
|
||||||
response = server.get("/dynamips/vms")
|
response = server.get("/dynamips/vms")
|
||||||
assert response.status == 200
|
assert response.status == 200
|
||||||
assert response.json == [{"filename": "7200.bin"}]
|
assert response.json == [{"filename": "7200.bin", "path": str(tmpdir / "7200.bin")}]
|
||||||
|
|
||||||
|
|
||||||
def test_upload_vm(server, tmpdir):
|
def test_upload_vm(server, tmpdir):
|
||||||
|
Loading…
Reference in New Issue
Block a user