From 62a32a2a82abc880d9374ce446dba971849ed8e1 Mon Sep 17 00:00:00 2001 From: Timothy Asir Date: Wed, 16 Apr 2014 13:54:14 +0530 Subject: enable volumeInfo to provide host uuid Change-Id: If1f9d22c59200f707c5a86d0f89628a2d8380d55 Signed-off-by: Timothy Asir --- glusternagios/glustercli.py | 2 +- tests/test_glustercli.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/glusternagios/glustercli.py b/glusternagios/glustercli.py index 5753811..ff4781b 100755 --- a/glusternagios/glustercli.py +++ b/glusternagios/glustercli.py @@ -403,7 +403,7 @@ def _parseVolumeInfo(tree): #it returns an empty list when gluster doesnot return uuid try: brickDetail['name'] = d.find('name').text - #brickDetail['hostUuid'] = d.find('hostUuid').text + brickDetail['hostUuid'] = d.find('hostUuid').text value['bricksInfo'].append(brickDetail) except AttributeError: break diff --git a/tests/test_glustercli.py b/tests/test_glustercli.py index 1f240fa..526aa6e 100644 --- a/tests/test_glustercli.py +++ b/tests/test_glustercli.py @@ -61,8 +61,10 @@ class GlusterCliTests(TestCaseBase): 0 192.168.122.2:/tmp/m_b1192.168.122.2:/tmp/m_b1 + 883c7829-d808-4a92-a414-db87061097b3 192.168.122.2:/tmp/m_b2192.168.122.2:/tmp/m_b2 + 883c7829-d808-4a92-a414-db87061097b3 1 @@ -87,6 +89,7 @@ class GlusterCliTests(TestCaseBase): 1 192.168.122.2:/tmp/t_b1192.168.122.2:/tmp/t_b1 + 883c7829-d808-4a92-a414-db87061097b3 0 @@ -105,8 +108,10 @@ class GlusterCliTests(TestCaseBase): 'distCount': '2', 'bricksInfo': [{ 'name': '192.168.122.2:/tmp/m_b1', + 'hostUuid': '883c7829-d808-4a92-a414-db87061097b3' }, { 'name': '192.168.122.2:/tmp/m_b2', + 'hostUuid': '883c7829-d808-4a92-a414-db87061097b3' }], 'options': {'auth.allow': '*'}, 'replicaCount': '2', @@ -121,6 +126,7 @@ class GlusterCliTests(TestCaseBase): 'distCount': '1', 'bricksInfo': [{ 'name': '192.168.122.2:/tmp/t_b1', + 'hostUuid': '883c7829-d808-4a92-a414-db87061097b3' }], 'options': {}, 'replicaCount': '1', -- cgit