From 88e9e82bae967153a00317a5b4c790266eb227c4 Mon Sep 17 00:00:00 2001 From: Tim Date: Tue, 19 Jul 2011 14:46:41 +0530 Subject: Updated DiskUtils.py to return disk partition as INITIALIZED if the device is mounted properly Updated gluster_provision_block_wrapper.py to run udevtrigger once the device is formated. --- .../src/DiskUtils.py | 2 +- .../src/gluster_provision_block_wrapper.py | 17 +++-------------- 2 files changed, 4 insertions(+), 15 deletions(-) (limited to 'src') 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") -- cgit