summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorShireesh Anjal <anjalshireesh@gmail.com>2011-08-11 08:27:26 -0700
committerShireesh Anjal <anjalshireesh@gmail.com>2011-08-11 08:27:26 -0700
commitd6af18cc4a6c046a0416dadc1f697b19fb113c54 (patch)
tree3d09c186746267ac71e3060e28c04d1aa3201948 /src
parent15222c97d166a1899d73b298e228a6c8e4447c8d (diff)
parent16d926ab7bc04225032febb9c6f98c9f4f15c01d (diff)
Merge pull request #229 from Selvasundaram/master
Gluster online server parsing issue fix
Diffstat (limited to 'src')
-rw-r--r--src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/actions/StartVolumeAction.java2
-rw-r--r--src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/actions/StopVolumeAction.java4
-rw-r--r--src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/dialogs/CreateVolumeWizard.java2
-rw-r--r--src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/services/VolumeService.java15
-rw-r--r--src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/utils/GlusterUtil.java2
5 files changed, 16 insertions, 9 deletions
diff --git a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/actions/StartVolumeAction.java b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/actions/StartVolumeAction.java
index 2c254e59..c86b66cf 100644
--- a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/actions/StartVolumeAction.java
+++ b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/actions/StartVolumeAction.java
@@ -55,7 +55,7 @@ public class StartVolumeAction extends AbstractActionDelegate {
List<String> failedVolumes = new ArrayList<String>();
String errorMessage = "";
- for (Volume volume : selectedVolumes) {
+ for (Volume volume : selectedVolumes.toArray(new Volume[0])) {
if (volume.getStatus() == VOLUME_STATUS.ONLINE) {
continue; // skip if already started
}
diff --git a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/actions/StopVolumeAction.java b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/actions/StopVolumeAction.java
index f02d090e..6e5b4d30 100644
--- a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/actions/StopVolumeAction.java
+++ b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/actions/StopVolumeAction.java
@@ -65,7 +65,7 @@ public class StopVolumeAction extends AbstractActionDelegate {
List<String> failedVolumes = new ArrayList<String>();
String errorMessage = "";
- for (Volume volume : volumes) {
+ for (Volume volume : volumes.toArray(new Volume[0])) {
if (volume.getStatus() == VOLUME_STATUS.OFFLINE) {
continue; // skip if already stopped
}
@@ -138,7 +138,7 @@ public class StopVolumeAction extends AbstractActionDelegate {
for (Volume volume : volumes) {
if (volume.getStatus() == VOLUME_STATUS.ONLINE) {
action.setEnabled(true);
- break;// If find an online volume, enable the action
+ break; // If find an online volume, enable the action
}
}
}
diff --git a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/dialogs/CreateVolumeWizard.java b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/dialogs/CreateVolumeWizard.java
index a7b7d251..bfb29ee1 100644
--- a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/dialogs/CreateVolumeWizard.java
+++ b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/dialogs/CreateVolumeWizard.java
@@ -111,7 +111,7 @@ public class CreateVolumeWizard extends Wizard {
if (error) {
MessageDialog.openWarning(getShell(), title, message1);
- } else {
+ } else if (message1.trim().length() > 0) {
MessageDialog.openInformation(getShell(), title, message1);
}
} else { // Start volume is not checked
diff --git a/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/services/VolumeService.java b/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/services/VolumeService.java
index 66c73260..1a7fa38f 100644
--- a/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/services/VolumeService.java
+++ b/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/services/VolumeService.java
@@ -33,6 +33,7 @@ import java.util.Date;
import java.util.List;
import org.apache.log4j.Logger;
+import org.hibernate.mapping.Array;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -302,8 +303,11 @@ public class VolumeService {
public void createCIFSUsers(String clusterName, String volumeName, String cifsUsers) {
try {
File file = createOnlineServerList(clusterName);
- ProcessResult result = serverUtil.executeGlusterScript(true, VOLUME_CREATE_CIFS_SCRIPT,
- file.getAbsolutePath(), volumeName, cifsUsers.replace(",", " "));
+ List<String> arguments = new ArrayList<String>();
+ arguments.add(file.getAbsolutePath());
+ arguments.add(volumeName);
+ arguments.addAll( Arrays.asList(cifsUsers.replaceAll(" ", "").split(",")));
+ ProcessResult result = serverUtil.executeGlusterScript(true, VOLUME_CREATE_CIFS_SCRIPT, arguments);
file.delete();
Volume volume = getVolume(clusterName, volumeName);
// If the volume service is already in running, create user may start CIFS re-export automatically.
@@ -326,8 +330,11 @@ public class VolumeService {
public void modifyCIFSUsers(String clusterName, String volumeName, String cifsUsers) {
try {
File file = createOnlineServerList(clusterName);
- ProcessResult result = serverUtil.executeGlusterScript(true, VOLUME_MODIFY_CIFS_SCRIPT,
- file.getAbsolutePath(), volumeName, cifsUsers.replace(",", " "));
+ List<String> arguments = new ArrayList<String>();
+ arguments.add(file.getAbsolutePath());
+ arguments.add(volumeName);
+ arguments.addAll( Arrays.asList(cifsUsers.split(",")));
+ ProcessResult result = serverUtil.executeGlusterScript(true, VOLUME_MODIFY_CIFS_SCRIPT, arguments);
file.delete();
if (!result.isSuccess()) {
throw new GlusterRuntimeException(result.toString());
diff --git a/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/utils/GlusterUtil.java b/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/utils/GlusterUtil.java
index ccb1054a..86337a6a 100644
--- a/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/utils/GlusterUtil.java
+++ b/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/utils/GlusterUtil.java
@@ -56,7 +56,7 @@ public class GlusterUtil {
private static final String HOSTNAME_PFX = "Hostname:";
private static final String UUID_PFX = "Uuid:";
private static final String STATE_PFX = "State:";
- private static final String GLUSTER_SERVER_STATUS_ONLINE = "Connected";
+ private static final String GLUSTER_SERVER_STATUS_ONLINE = "Peer in Cluster (Connected)";
private static final String VOLUME_NAME_PFX = "Volume Name:";
private static final String VOLUME_TYPE_PFX = "Type:";