diff options
authorRamesh Nachimuthu <>2014-05-07 09:42:47 +0530
committerSahina Bose <>2014-05-06 22:54:55 -0700
commit2b35b6649b5af2d4d4296612f1c711bddcdf7930 (patch)
parent43e66567238af129d9d0b4bf82f0af1ee2f1b3ca (diff)
glustercli: fix for local ip address issue in peerStatus
glustercli._getIpAddresses() throws an exception when 'ovirtmgmt' bridge is present. This is used by peerStatus() to get the local ip address of the node and peer status is failing because of the exception. Current approach is anyway not fool proof as the node can have multiple network devices and we may not get the right ip address. So adding 'localhost' as the address for the current host in peerStatus() API. Change-Id: Ib804b2109a2578f180b6bf54904a28f19bbdbb7a Signed-off-by: Ramesh Nachimuthu <> Reviewed-on: Reviewed-by: Sahina Bose <>
1 files changed, 6 insertions, 3 deletions
diff --git a/glusternagios/ b/glusternagios/
index c424438..77e514e 100755
--- a/glusternagios/
+++ b/glusternagios/
@@ -626,6 +626,10 @@ def peerStatus():
[{'hostname': HOSTNAME, 'uuid': UUID, 'status': STATE}, ...]
+ Note: Current host will be the first entry in the list with name as
+ 'localhost' and status as CONNECTED
command = _getGlusterPeerCmd() + ["status"]
@@ -633,8 +637,7 @@ def peerStatus():
except GlusterCmdFailedException as e:
raise GlusterCmdFailedException(rc=e.rc, err=e.err)
- return _parsePeerStatus(xmltree,
- _getLocalIpAddress() or _getGlusterHostName(),
- hostUUIDGet(), HostStatus.CONNECTED)
+ return _parsePeerStatus(xmltree, "localhost", hostUUIDGet(),
+ HostStatus.CONNECTED)
except _etreeExceptions:
raise GlusterCmdFailedException(err=[etree.tostring(xmltree)])