summaryrefslogtreecommitdiffstats
path: root/src/com.gluster.storage.management.gateway
diff options
context:
space:
mode:
authorBala.FA <bala@gluster.com>2011-08-03 14:46:53 +0530
committerBala.FA <bala@gluster.com>2011-08-03 14:46:53 +0530
commit73644291bb5ea77cbb7d3e351992fea13e1a6be9 (patch)
treec2198affd530d3b63f1a3a072bbc80662336c928 /src/com.gluster.storage.management.gateway
parent70a47524e47df67184a054c6b98eb006cb29c092 (diff)
parentd7188e0556d5978850acff3f6cae9ac024557dbf (diff)
Merge remote branch 'upstream/master'
Diffstat (limited to 'src/com.gluster.storage.management.gateway')
-rw-r--r--src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/utils/GlusterUtil.java20
1 files changed, 17 insertions, 3 deletions
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 5db3926b..443b1853 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
@@ -74,6 +74,7 @@ public class GlusterUtil {
private static final GlusterCoreUtil glusterCoreUtil = new GlusterCoreUtil();
private static final String INITIALIZE_DISK_STATUS_SCRIPT = "get_format_device_status.py";
+ private static final String BRICK_STATUS_SCRIPT = "get_brick_status.py";
@Autowired
private SshUtil sshUtil;
@@ -422,9 +423,12 @@ public class GlusterUtil {
// Do not throw exception, Gracefully handle as Offline brick.
private BRICK_STATUS getBrickStatus(String serverName, String volumeName, String brick){
try {
- ProcessResult output = getSshUtil().executeRemote(serverName, "get_brick_status.py" + " " + volumeName + " " + brick);
-
- if (output.isSuccess() && output.getOutput().equals(CoreConstants.ONLINE)) {
+ Object output = serverUtil.executeScriptOnServer(true, serverName, BRICK_STATUS_SCRIPT + " " + volumeName + " " + brick, String.class);
+ if(output instanceof Status) {
+ // script failed. throw exception.
+ throw new GlusterRuntimeException(((Status)output).toString());
+ }
+ if (((String)output).equals(CoreConstants.ONLINE)) {
return BRICK_STATUS.ONLINE;
} else {
return BRICK_STATUS.OFFLINE;
@@ -523,6 +527,16 @@ public class GlusterUtil {
}
}
}
+
+ // TODO: Execute the python script to find whether the volume is cifs enabled or not
+ boolean isCifsEnabled = false;
+ List<String> cifsUsers = new ArrayList<String>();
+ if(isCifsEnabled) {
+ volume.enableCifs();
+ volume.setCifsUsers(cifsUsers);
+ } else {
+ volume.disableCifs();
+ }
if (volume != null) {// Adding the last volume parsed
volumes.add(volume);