summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRamesh Nachimuthu <rnachimu@redhat.com>2014-05-07 09:42:47 +0530
committerSahina Bose <sabose@redhat.com>2014-05-06 22:54:55 -0700
commit2b35b6649b5af2d4d4296612f1c711bddcdf7930 (patch)
tree020c53ce66ebfa4cdc4fa72ae0a060f60abfa928
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 <rnachimu@redhat.com> Reviewed-on: http://review.gluster.org/7688 Reviewed-by: Sahina Bose <sabose@redhat.com>
-rwxr-xr-xglusternagios/glustercli.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/glusternagios/glustercli.py b/glusternagios/glustercli.py
index c424438..77e514e 100755
--- a/glusternagios/glustercli.py
+++ b/glusternagios/glustercli.py
@@ -626,6 +626,10 @@ def peerStatus():
"""
Returns:
[{'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"]
try:
@@ -633,8 +637,7 @@ def peerStatus():
except GlusterCmdFailedException as e:
raise GlusterCmdFailedException(rc=e.rc, err=e.err)
try:
- return _parsePeerStatus(xmltree,
- _getLocalIpAddress() or _getGlusterHostName(),
- hostUUIDGet(), HostStatus.CONNECTED)
+ return _parsePeerStatus(xmltree, "localhost", hostUUIDGet(),
+ HostStatus.CONNECTED)
except _etreeExceptions:
raise GlusterCmdFailedException(err=[etree.tostring(xmltree)])