diff options
| author | Shireesh Anjal <shireesh@gluster.com> | 2011-08-01 14:36:12 +0530 |
|---|---|---|
| committer | Shireesh Anjal <shireesh@gluster.com> | 2011-08-01 14:36:12 +0530 |
| commit | f772c9c4b1ecb971f1fba384adfc879fbba170f6 (patch) | |
| tree | b4779c9d44ed36605223a83ee272f673334ed727 | |
| parent | f9b8d8cd78ee198f60e5aa64bd7e951808c0c3eb (diff) | |
| parent | 446ec5f7e77698da40b7a30d374c50ae138012bb (diff) | |
Merge branch 'master' of github.com:gluster/console
| -rw-r--r-- | src/com.gluster.storage.management.gateway.scripts/src/DiskUtils.py | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/src/com.gluster.storage.management.gateway.scripts/src/DiskUtils.py b/src/com.gluster.storage.management.gateway.scripts/src/DiskUtils.py index 4fadc71a..a0e5d802 100644 --- a/src/com.gluster.storage.management.gateway.scripts/src/DiskUtils.py +++ b/src/com.gluster.storage.management.gateway.scripts/src/DiskUtils.py @@ -138,12 +138,10 @@ def getMounts(): device["Uuid"] = getDiskPartitionUuid(tokens[0].strip()) device["Status"] = "INITIALIZED" if mountPoint: - if "/export/" in mountPoint: - device["Type"] = "DATA" - else: + if mountPoint in ["/", "/boot"]: device["Type"] = "BOOT" - else: - device["Type"] = "UNKNOWN" + else: + device["Type"] = "DATA" mounts[tokens[0].strip()] = device return mounts @@ -179,12 +177,7 @@ def getRaidDisk(): device = getDevice(tokens[0]) raid['MountPoint'] = getDeviceMountPoint(device) if raid['MountPoint']: - if "/export/" in raid['MountPoint']: - raid['Type'] = "DATA" - else: - raid['Type'] = "BOOT" - else: - raid['Type'] = "UNKNOWN" + raid['Type'] = "DATA" rv = Utils.runCommand("blkid -c /dev/null %s" % (device), output=True, root=True) raid['Uuid'] = None raid['FsType'] = None @@ -310,12 +303,10 @@ def getDiskInfo(diskDeviceList=None): disk["Status"] = "INITIALIZED" mountPoint = str(partitionHalDevice.GetProperty('volume.mount_point')) if mountPoint: - if "/export/" in mountPoint: - disk["Type"] = "DATA" - else: + if mountPoint in ["/", "/boot"]: disk["Type"] = "BOOT" - else: - disk["Type"] = "UNKNOWN" + else: + disk["Type"] = "DATA" disk["FsType"] = str(partitionHalDevice.GetProperty('volume.fstype')) if disk["FsType"] and "UNINITIALIZED" == disk["Status"]: disk["Status"] = "INITIALIZED" @@ -352,10 +343,10 @@ def getDiskInfo(diskDeviceList=None): partition["Init"] = True partition["Status"] = "INITIALIZED" if partition["MountPoint"]: - if "/export/" in partition["MountPoint"]: - partition["Type"] = "DATA" - else: + if partition["MountPoint"] in ["/", "/boot"]: partition["Type"] = "BOOT" + else: + partition["Type"] = "DATA" else: if "SWAP" == partition["FsType"].strip().upper(): partition["Type"] = "SWAP" |
