diff options
| author | Shireesh Anjal <anjalshireesh@gmail.com> | 2011-07-19 03:56:12 -0700 |
|---|---|---|
| committer | Shireesh Anjal <anjalshireesh@gmail.com> | 2011-07-19 03:56:12 -0700 |
| commit | 996ad1d5f101a3214d6af3ec2017c309259ade83 (patch) | |
| tree | de8ff812c4d221fb7a45f00f6cbfc82c7806eff7 /src | |
| parent | ba887b6c816c24787781f2f6c535af7c2bc90e6a (diff) | |
| parent | 88e9e82bae967153a00317a5b4c790266eb227c4 (diff) | |
Merge pull request #122 from TimothyAsir/master
Updated code to change disk status as INITIALIZED once the disk is formated
Diffstat (limited to 'src')
| -rw-r--r-- | src/com.gluster.storage.management.server.scripts/src/DiskUtils.py | 2 | ||||
| -rwxr-xr-x | src/com.gluster.storage.management.server.scripts/src/gluster_provision_block_wrapper.py | 17 |
2 files changed, 4 insertions, 15 deletions
diff --git a/src/com.gluster.storage.management.server.scripts/src/DiskUtils.py b/src/com.gluster.storage.management.server.scripts/src/DiskUtils.py index e796f479..c76c1c01 100644 --- a/src/com.gluster.storage.management.server.scripts/src/DiskUtils.py +++ b/src/com.gluster.storage.management.server.scripts/src/DiskUtils.py @@ -307,7 +307,7 @@ def getDiskInfo(diskDeviceList=None): partition["SpaceInUse"] = used if partition["MountPoint"] or isDataDiskPartitionFormatted(partitionDevice): partition["Init"] = True - #partition["Status"] = "INITIALIZED" + partition["Status"] = "INITIALIZED" if partition["MountPoint"]: if "/export/" in partition["MountPoint"]: partition["Type"] = "DATA" diff --git a/src/com.gluster.storage.management.server.scripts/src/gluster_provision_block_wrapper.py b/src/com.gluster.storage.management.server.scripts/src/gluster_provision_block_wrapper.py index 89d7df38..a3b2776d 100755 --- a/src/com.gluster.storage.management.server.scripts/src/gluster_provision_block_wrapper.py +++ b/src/com.gluster.storage.management.server.scripts/src/gluster_provision_block_wrapper.py @@ -89,26 +89,15 @@ def main(): writeStatus(deviceFormatStatusFile, "Device format failed\n") sys.exit(5) - ## try: - ## process = subprocess.Popen(command, - ## stdout=fptr, - ## stderr=subprocess.PIPE, - ## stdin=subprocess.PIPE, - ## close_fds=True) - ## status = process.wait() - ## except OSError: - ## os.unlink(deviceFormatOutputFile) - ## Utils.log(syslog.LOG_ERR, "formatting disk command failed. command: %s" % str(command)) - ## writeStatus(deviceFormatStatusFile, "Formatting disk command failed\n") - ## removeLockFile() - ## sys.exit(-5) - if status != 0: Utils.removeFile(deviceFormatOutputFile) Utils.removeFile(deviceFormatLockFile) writeStatus(deviceFormatStatusFile, "Device format failed\n") sys.exit(6) + if Utils.runCommand("/sbin/udevtrigger") != 0: + Utils.log("failed running /sbin/udevtrigger") + if Utils.runCommand("/usr/bin/lshal") != 0: Utils.log("failed running /usr/bin/lshal") writeStatus(deviceFormatStatusFile, "Completed\n") |
