summaryrefslogtreecommitdiffstats
path: root/src/com.gluster.storage.management.server
diff options
context:
space:
mode:
authorSelvasundaram <selvam@gluster.com>2011-07-24 21:16:39 +0530
committerSelvasundaram <selvam@gluster.com>2011-07-24 21:19:53 +0530
commite4be833158e0e311b7c9fc271357b8a43d67ec20 (patch)
tree1fc6dea47b6a8c0b568af4f445fb792bd4debf29 /src/com.gluster.storage.management.server
parentc55864548de5d1b5b75893a411cd3aff8443aebb (diff)
Bug 3061 - Volumes summary view is broken if brick for a volume is on different mount point other than /export - fix
Diffstat (limited to 'src/com.gluster.storage.management.server')
-rw-r--r--src/com.gluster.storage.management.server/src/com/gluster/storage/management/server/utils/GlusterUtil.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/com.gluster.storage.management.server/src/com/gluster/storage/management/server/utils/GlusterUtil.java b/src/com.gluster.storage.management.server/src/com/gluster/storage/management/server/utils/GlusterUtil.java
index 304da012..22da9ca3 100644
--- a/src/com.gluster.storage.management.server/src/com/gluster/storage/management/server/utils/GlusterUtil.java
+++ b/src/com.gluster.storage.management.server/src/com/gluster/storage/management/server/utils/GlusterUtil.java
@@ -25,6 +25,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
+import java.util.regex.Pattern;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -410,7 +411,13 @@ public class GlusterUtil {
}
private void addBrickToVolume(Volume volume, String serverName, String brickDir, BRICK_STATUS status) {
- volume.addBrick(new Brick(serverName, status, brickDir.split("/")[2].trim(), brickDir));
+ //If brick directory has standard path, find and assign device name otherwise null
+ String stdBrickDirPattern = "^/export/.*/.*"; // e.g: /export/sdb/test
+ String deviceName = null;
+ if (Pattern.matches(stdBrickDirPattern, brickDir) ) {
+ deviceName = brickDir.split("/")[2].trim();
+ }
+ volume.addBrick(new Brick(serverName, status, deviceName, brickDir));
}
// Do not throw exception, Gracefully handle as Offline brick.