From 7cf5f329aa930ecdecb97670b8b4c53d7c67ff69 Mon Sep 17 00:00:00 2001 From: Timothy Asir Date: Thu, 8 Dec 2011 18:45:56 +0530 Subject: Enhanced get_server_details.py to return partition type as 'swap' if the file system type is 'swap' --- .../src/backend/get_server_details.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/org.gluster.storage.management.gateway.scripts/src/backend/get_server_details.py') diff --git a/src/org.gluster.storage.management.gateway.scripts/src/backend/get_server_details.py b/src/org.gluster.storage.management.gateway.scripts/src/backend/get_server_details.py index bdb6caa0..956a9e44 100755 --- a/src/org.gluster.storage.management.gateway.scripts/src/backend/get_server_details.py +++ b/src/org.gluster.storage.management.gateway.scripts/src/backend/get_server_details.py @@ -160,6 +160,8 @@ def getDiskDom(): diskTag.appendChild(diskDom.createTag("type", "BOOT")) elif "UNINITIALIZED" == status: diskTag.appendChild(diskDom.createTag("type", "UNKNOWN")) + elif "swap" == value["FsType"]: + diskTag.appendChild(diskDom.createTag("type", "SWAP")) else: diskTag.appendChild(diskDom.createTag("type", "DATA")) diskTag.appendChild(diskDom.createTag("fsType", value["FsType"])) @@ -182,7 +184,10 @@ def getDiskDom(): partitionTag.appendChild(diskDom.createTag("type", "BOOT")) elif partValues["FsType"]: partitionTag.appendChild(diskDom.createTag("status", "INITIALIZED")) - partitionTag.appendChild(diskDom.createTag("type", "DATA")) + if "swap" == partValues["FsType"]: + partitionTag.appendChild(diskDom.createTag("type", "SWAP")) + else: + partitionTag.appendChild(diskDom.createTag("type", "DATA")) else: partitionTag.appendChild(diskDom.createTag("status", "UNINITIALIZED")) partitionTag.appendChild(diskDom.createTag("type", "UNKNOWN")) -- cgit