diff options
-rwxr-xr-x | glusternagios/glustercli.py | 10 | ||||
-rw-r--r-- | tests/test_glustercli.py | 8 |
2 files changed, 16 insertions, 2 deletions
diff --git a/glusternagios/glustercli.py b/glusternagios/glustercli.py index abbd3b8..4c2f564 100755 --- a/glusternagios/glustercli.py +++ b/glusternagios/glustercli.py @@ -398,7 +398,9 @@ def _parseVolumeInfo(tree): 'uuid': UUID, 'volumeName': NAME, 'volumeStatus': STATUS, - 'volumeType': TYPE}, ...} + 'volumeType': TYPE, + 'disperseCount': DISPERSE_COUNT, + 'redundancyCount': REDUNDANCY_COUNT}, ...} """ volumes = {} for el in tree.findall('volInfo/volumes/volume'): @@ -415,6 +417,8 @@ def _parseVolumeInfo(tree): value['distCount'] = el.find('distCount').text value['stripeCount'] = el.find('stripeCount').text value['replicaCount'] = el.find('replicaCount').text + value['disperseCount'] = el.find('disperseCount').text + value['redundancyCount'] = el.find('redundancyCount').text transportType = el.find('transport').text if transportType == '0': value['transportType'] = [TransportType.TCP] @@ -453,7 +457,9 @@ def volumeInfo(volumeName=None, remoteServer=None): 'uuid': UUID, 'volumeName': NAME, 'volumeStatus': STATUS, - 'volumeType': TYPE}, ...} + 'volumeType': TYPE, + 'disperseCount': DISPERSE_COUNT, + 'redundancyCount': REDUNDANCY_COUNT}, ...} """ command = _getGlusterVolCmd() + ["info"] if remoteServer: diff --git a/tests/test_glustercli.py b/tests/test_glustercli.py index bca1502..2f3f8cb 100644 --- a/tests/test_glustercli.py +++ b/tests/test_glustercli.py @@ -56,6 +56,8 @@ class GlusterCliTests(TestCaseBase): <distCount>2</distCount> <stripeCount>1</stripeCount> <replicaCount>2</replicaCount> + <disperseCount>5</disperseCount> + <redundancyCount>1</redundancyCount> <type>2</type> <typeStr>Replicate</typeStr> <transport>0</transport> @@ -84,6 +86,8 @@ class GlusterCliTests(TestCaseBase): <distCount>1</distCount> <stripeCount>1</stripeCount> <replicaCount>1</replicaCount> + <disperseCount>5</disperseCount> + <redundancyCount>1</redundancyCount> <type>0</type> <typeStr>Distribute</typeStr> <transport>1</transport> @@ -116,6 +120,8 @@ class GlusterCliTests(TestCaseBase): 'options': {'auth.allow': '*'}, 'replicaCount': '2', 'stripeCount': '1', + 'disperseCount': '5', + 'redundancyCount': '1', 'transportType': [gcli.TransportType.TCP], 'uuid': 'b3114c71-741b-4c6f-a39e-80384c4ea3cf', 'volumeName': 'music', @@ -131,6 +137,8 @@ class GlusterCliTests(TestCaseBase): 'options': {}, 'replicaCount': '1', 'stripeCount': '1', + 'disperseCount': '5', + 'redundancyCount': '1', 'transportType': [gcli.TransportType.RDMA], 'uuid': 'b444ed94-f346-4cda-bd55-0282f21d22db', 'volumeName': 'test1', |