Optionally allow Qemu raw images

This commit is contained in:
grossmj committed 2022-07-22 12:39:52 +02:00
1 parent d08a052f94
commit 725942157e
4 files changed
+20 -11

No files matched your search

+2 -2
View File
@@ -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")