diff --git a/WebContent/WEB-INF/config/log4j-config.xml b/WebContent/WEB-INF/config/log4j-config.xml index 801540e5..fb39773b 100644 --- a/WebContent/WEB-INF/config/log4j-config.xml +++ b/WebContent/WEB-INF/config/log4j-config.xml @@ -24,7 +24,7 @@ - + diff --git a/src/com/platform/glusterfs/ClusterInfo.java b/src/com/platform/glusterfs/ClusterInfo.java index 017efe41..df56469a 100644 --- a/src/com/platform/glusterfs/ClusterInfo.java +++ b/src/com/platform/glusterfs/ClusterInfo.java @@ -41,7 +41,7 @@ public class ClusterInfo { public Map showClusterInfo() { // log.info("get cluster info"); Map peerIps = new HashMap(); - + peerIps.put(Constant.hostIp, Constant.peerincluster_connected); List reStrings = Constant.ganymedSSH.execCmdWaitAcquiescent(Constant.glusterPeerStatus); if (reStrings == null) { log.error("1101 command get result is null"); @@ -51,9 +51,12 @@ public class ClusterInfo { log.error("1102 command get result is nothing"); return null; } - + + if (reStrings.get(0).contains("No peers present")) { + return peerIps; + } + if (!(reStrings.get(0).split(":")[0].contains("Number of Peers"))) { - log.error("1103 get result string wrong"); return null; } @@ -90,7 +93,7 @@ public class ClusterInfo { } } - peerIps.put(Constant.hostIp, Constant.peerincluster_connected); + // for (Map.Entry entry:peerIps.entrySet()){ // String key=entry.getKey(); // if(key.equals(Constant.hostIp)){