diff options
| author | Shireesh Anjal <anjalshireesh@gmail.com> | 2011-08-01 01:52:51 -0700 |
|---|---|---|
| committer | Shireesh Anjal <anjalshireesh@gmail.com> | 2011-08-01 01:52:51 -0700 |
| commit | 446ec5f7e77698da40b7a30d374c50ae138012bb (patch) | |
| tree | aa913f2924aa07dd0ce2acc77d0cb7dfda3ef236 /src | |
| parent | 151771468b70906affb42ddff0e2ce4ea7d37ff9 (diff) | |
| parent | b6dc76c7dad5dfc695b8f875e770a17c93e9d318 (diff) | |
Merge pull request #171 from TimothyAsir/master
Changed disk status from UNKNOWN to DATA if its mounted.
Diffstat (limited to 'src')
| -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" |
