summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/dialogs/CreateVolumePage1.java8
-rw-r--r--src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/OptionKeyEditingSupport.java3
2 files changed, 6 insertions, 5 deletions
diff --git a/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/dialogs/CreateVolumePage1.java b/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/dialogs/CreateVolumePage1.java
index 8e63378e..e319dcca 100644
--- a/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/dialogs/CreateVolumePage1.java
+++ b/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/dialogs/CreateVolumePage1.java
@@ -323,11 +323,11 @@ public class CreateVolumePage1 extends WizardPage {
setError("At least one disk must be selected!");
}
- String volumeType = Volume.getVolumeTypeStr((VOLUME_TYPE) ((IStructuredSelection) typeComboViewer
- .getSelection()).getFirstElement());
- if (volumeType.equals(Volume.getVolumeTypeStr(VOLUME_TYPE.DISTRIBUTED_MIRROR)) && (diskCount % 2 != 0)) {
+ VOLUME_TYPE volumeType = (VOLUME_TYPE) ((IStructuredSelection) typeComboViewer
+ .getSelection()).getFirstElement();
+ if (volumeType == VOLUME_TYPE.DISTRIBUTED_MIRROR && diskCount % 2 != 0) {
setError("Mirror type volume requires disks in multiples of two");
- } else if (volumeType.equals(Volume.getVolumeTypeStr(VOLUME_TYPE.DISTRIBUTED_STRIPE)) && (diskCount % 4 != 0)) {
+ } else if (volumeType == VOLUME_TYPE.DISTRIBUTED_STRIPE && diskCount % 4 != 0) {
setError("Stripe type volume requires disks in multiples of four");
}
}
diff --git a/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/OptionKeyEditingSupport.java b/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/OptionKeyEditingSupport.java
index b3f7ca3a..a94ae25a 100644
--- a/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/OptionKeyEditingSupport.java
+++ b/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/OptionKeyEditingSupport.java
@@ -52,6 +52,7 @@ public class OptionKeyEditingSupport extends EditingSupport {
@SuppressWarnings("unchecked")
@Override
protected void setValue(final Object element, final Object value) {
+ Entry<String, String> oldEntry = (Entry<String, String>)element;
Integer newValue = (Integer)value;
String newKey = allowedKeys[newValue];
@@ -61,7 +62,7 @@ public class OptionKeyEditingSupport extends EditingSupport {
}
// value has changed. set volume option at back-end and update model accordingly
- volume.getOptions().remove("");
+ volume.getOptions().remove(oldEntry.getKey());
volume.setOption(newKey, "");
getViewer().refresh();
}