diff options
author | Manuel Bentele | 2021-08-05 10:01:43 +0200 |
---|---|---|
committer | Manuel Bentele | 2021-08-05 10:01:43 +0200 |
commit | 5f1e01a36f86452c5f7d7962e75e92515222095d (patch) | |
tree | 2556d8ca7b1037f2de0f0158fa6a7f5c73f9bb7d /dozentenmodul | |
parent | [client] fix classcast exception and import (diff) | |
download | tutor-module-5f1e01a36f86452c5f7d7962e75e92515222095d.tar.gz tutor-module-5f1e01a36f86452c5f7d7962e75e92515222095d.tar.xz tutor-module-5f1e01a36f86452c5f7d7962e75e92515222095d.zip |
[client] Do not print compression warning for QCOW2 images
Diffstat (limited to 'dozentenmodul')
-rw-r--r-- | dozentenmodul/src/main/java/org/openslx/dozmod/util/ImageWrapper.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/util/ImageWrapper.java b/dozentenmodul/src/main/java/org/openslx/dozmod/util/ImageWrapper.java index 9e272dda..fe884a15 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/util/ImageWrapper.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/util/ImageWrapper.java @@ -9,6 +9,7 @@ import org.openslx.thrifthelper.TConst; import org.openslx.virtualization.configuration.VirtualizationConfigurationException; import org.openslx.virtualization.configuration.container.ContainerDefinition; import org.openslx.virtualization.disk.DiskImage; +import org.openslx.virtualization.disk.DiskImage.ImageFormat; import org.openslx.virtualization.disk.DiskImageException; import java.io.File; @@ -44,6 +45,7 @@ public class ImageWrapper { String ext = virtualizerId; boolean imageIsCompressed = false; + ImageFormat imageFormat = null; // unwrap each image individually // TODO In future maybe this is a check to distinguish between VM-Image and Container Image @@ -63,13 +65,14 @@ public class ImageWrapper { } else { try (DiskImage diskImage = DiskImage.newInstance(tmpDiskFile)) { - ext = diskImage.getFormat().getExtension(); + imageFormat = diskImage.getFormat(); + ext = imageFormat.getExtension(); imageIsCompressed = diskImage.isCompressed(); } catch (IOException | DiskImageException e) { LOGGER.warn("Could not open/analyze downloaded image", e); } - if (imageIsCompressed) { + if (imageIsCompressed && imageFormat != ImageFormat.QCOW2) { Gui.asyncMessageBox(I18n.THRIFT.getString("ThriftActions.Message.warning.diskImageCompressed", imageName, Branding.getServiceFAQWebsite()), MessageType.WARNING, null, null); } |