mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-13 20:08:55 +00:00
parent
1080147cf5
commit
048d2c12d0
@ -539,15 +539,18 @@ class Compute:
|
||||
res = yield from self.http_query("GET", "/{}/images".format(type), timeout=120)
|
||||
images = res.json
|
||||
|
||||
if type in ["qemu", "dynamips", "iou"]:
|
||||
for path in scan_for_images(type):
|
||||
image = os.path.basename(path)
|
||||
if image not in [i['filename'] for i in images]:
|
||||
images.append({"filename": image,
|
||||
"path": image,
|
||||
"md5sum": md5sum(path),
|
||||
"filesize": os.stat(path).st_size
|
||||
})
|
||||
try:
|
||||
if type in ["qemu", "dynamips", "iou"]:
|
||||
for path in scan_for_images(type):
|
||||
image = os.path.basename(path)
|
||||
if image not in [i['filename'] for i in images]:
|
||||
images.append({"filename": image,
|
||||
"path": image,
|
||||
"md5sum": md5sum(path),
|
||||
"filesize": os.stat(path).st_size
|
||||
})
|
||||
except OSError as e:
|
||||
raise aiohttp.web.HTTPConflict(text="Can't scan for images: {}".format(str(e)))
|
||||
return images
|
||||
|
||||
@asyncio.coroutine
|
||||
|
Loading…
Reference in New Issue
Block a user