diff options
author | Jonathan Bauer | 2018-04-18 16:46:16 +0200 |
---|---|---|
committer | Jonathan Bauer | 2018-04-18 16:46:16 +0200 |
commit | 35cde32855577d20e3f03695ec157a31e176974f (patch) | |
tree | 6acdb1ad263f65d117a4a5bd6e773c4baa9d8373 | |
parent | [client] add hypervisor icons to image table (diff) | |
download | tutor-module-35cde32855577d20e3f03695ec157a31e176974f.tar.gz tutor-module-35cde32855577d20e3f03695ec157a31e176974f.tar.xz tutor-module-35cde32855577d20e3f03695ec157a31e176974f.zip |
[client] do not allow a change in virtualizer
-rw-r--r-- | dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ImageUploadPage.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ImageUploadPage.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ImageUploadPage.java index 6345995c..6e25158f 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ImageUploadPage.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ImageUploadPage.java @@ -15,6 +15,7 @@ import javax.swing.filechooser.FileNameExtensionFilter; import org.apache.log4j.Logger; import org.openslx.bwlp.thrift.iface.ImageDetailsRead; +import org.openslx.bwlp.thrift.iface.Virtualizer; import org.openslx.dozmod.Config; import org.openslx.dozmod.gui.Gui; import org.openslx.dozmod.gui.helper.MessageType; @@ -137,6 +138,16 @@ public class ImageUploadPage extends ImageUploadPageLayout { } else if (state.meta instanceof QemuMetaData) { fileformat = "qcow"; } + // check if the guy somehow changed the type of the VM + if (existingImage != null && existingImage.virtId != state.meta.getVirtualizer().virtId) { + Virtualizer existingImageVirtualizer = MetaDataCache.getVirtualizerById(existingImage.virtId); + String existingImageVirtualizerName = "<error>"; + if (existingImageVirtualizer != null) + existingImageVirtualizerName = existingImageVirtualizer.virtName; + setErrorMessage("Updates für dieses Basis-VM können nur " + existingImageVirtualizerName + "-VMs sein."); + setPageComplete(false); + return; + } // TODO too much header? if (state.meta == null || state.meta.getDisplayName() == null) { |