lib: Handle explicit `skip_compression` option in VARIANTS
Add a `skip_compression` property on `QemuVariantImage`  based on
the Set `skip_compression` value of the variant in `VARIANTS` dict.
When `skip_compression` is set to True (default is False), the
`mutate_image` method adds `skip-compression:True` to the `meta_patch`.
This commit also sets `skip_compression` value to True for Nutanix variant.
@@ -102,6 +102,7 @@ VARIANTS = {
"nutanix": {
"image_format": "qcow2",
"platform": "nutanix",
+ "skip_compression": True,
"convert_options": {
'-c': None
}
@@ -178,6 +179,7 @@ class QemuVariantImage(_Build):
self.gzip = kwargs.pop("gzip", False)
self.virtual_size = kwargs.pop("virtual_size", None)
self.mutate_callback_creates_final_image = False
+ self.skip_compression = kwargs.pop("skip_compression", False)
# this is used in case the image has a different disk
# name than the platform
@@ -305,6 +307,11 @@ class QemuVariantImage(_Build):
'uncompressed-size': size,
})
+ if self.skip_compression:
+ meta_patch.update({
+ 'skip-compression': True
+ })
+
return meta_patch
def _build_artifacts(self, *args, **kwargs):
