mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Optionally allow Qemu raw images
This commit is contained in:
1 parent
d08a052f94
commit
725942157e
4 files changed
+20
-11
No files matched your search
@@ -123,7 +123,7 @@ class ApplianceManager:
|
||||
async with HTTPClient.get(image_url) as response:
|
||||
if response.status != 200:
|
||||
raise ControllerError(f"Could not download '{image_name}' due to HTTP error code {response.status}")
|
||||
await write_image(image_name, image_path, response.content.iter_any(), images_repo)
|
||||
await write_image(image_name, image_path, response.content.iter_any(), images_repo, allow_raw_image=True)
|
||||
except (OSError, InvalidImageError) as e:
|
||||
raise ControllerError(f"Could not save {image_type} image '{image_path}': {e}")
|
||||
except ClientError as e:
|
||||
@@ -162,7 +162,7 @@ class ApplianceManager:
|
||||
cache_to_md5file=False
|
||||
) == image_checksum:
|
||||
async with aiofiles.open(image_path, "rb") as f:
|
||||
await write_image(appliance_file, image_path, f, images_repo)
|
||||
await write_image(appliance_file, image_path, f, images_repo, allow_raw_image=True)
|
||||
else:
|
||||
# download the image if there is a direct download URL
|
||||
direct_download_url = image.get("direct_download_url")
|
||||
|
||||
Reference in new issue
Block a user