From 015282013a22dda84d1849e18659d42bb5bb48f4 Mon Sep 17 00:00:00 2001 From: Aravinda VK Date: Mon, 12 Jan 2015 12:19:17 +0530 Subject: geo-rep: Handle Volume status error while getting slave nodes gluster volume status command not returns xml output, when any error like "Transaction in Progress", we need to handle returncode along with xml error. BUG: 1151412 Signed-off-by: Aravinda VK Change-Id: Id5b7712df7cff58744b4c5a0d00870aec1d926a8 Reviewed-on: http://review.gluster.org/9432 Tested-by: Gluster Build System Reviewed-by: Kotresh HR Reviewed-by: Venky Shankar Tested-by: Venky Shankar --- geo-replication/syncdaemon/monitor.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/geo-replication/syncdaemon/monitor.py b/geo-replication/syncdaemon/monitor.py index 3e0360332bd..ee3c91f3e9f 100644 --- a/geo-replication/syncdaemon/monitor.py +++ b/geo-replication/syncdaemon/monitor.py @@ -35,7 +35,12 @@ def get_slave_bricks_status(host, vol): stdout=PIPE, stderr=PIPE) vix = po.stdout.read() po.wait() - po.terminate_geterr() + po.terminate_geterr(fail_on_err=False) + if po.returncode != 0: + logging.info("Volume status command failed, unable to get " + "list of up nodes of %s, returning empty list: %s" % + (vol, po.returncode)) + return [] vi = XET.fromstring(vix) if vi.find('opRet').text != '0': logging.info("Unable to get list of up nodes of %s, " -- cgit