From bf80f5a94b7d5e617612904723c2ae053e137d3b Mon Sep 17 00:00:00 2001 From: hari gowtham Date: Thu, 28 Apr 2016 11:48:23 +0530 Subject: heal/xml : xml implementation of heal info and splitbrain info back-port of : http://review.gluster.org/#/c/14100/ Current output: heal didn't have xml output. expected output with patch: gluster v heal v1 info --xml 10.70.42.183:/home/bricks/b1 Connected 0 10.70.42.183:/home/bricks/b2 Connected 0 0 0 gluster v heal v1 info split-brain --xml 10.70.42.183:/home/bricks/b1 Connected 0 10.70.42.183:/home/bricks/b2 Connected 0 0 0 >hange-Id: I20ad5eb7950d4721364ab46089e3af515162db82 >BUG: 1331287 >Signed-off-by: hari gowtham Change-Id: Ie2d74222213b71fb6c80d0384a35a1c705aafcd0 BUG: 1334074 Signed-off-by: hari gowtham Reviewed-on: http://review.gluster.org/14250 Smoke: Gluster Build System Tested-by: hari gowtham NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Ravishankar N Reviewed-by: Niels de Vos --- cli/src/cli-cmd-volume.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'cli') diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c index f5ee1b14544..bc4f42c5967 100644 --- a/cli/src/cli-cmd-volume.c +++ b/cli/src/cli-cmd-volume.c @@ -2172,6 +2172,9 @@ cli_launch_glfs_heal (int heal_op, dict_t *options) switch (heal_op) { case GF_SHD_OP_INDEX_SUMMARY: + if (global_state->mode & GLUSTER_MODE_XML) { + runner_add_args (&runner, "xml", NULL); + } break; case GF_SHD_OP_SBRAIN_HEAL_FROM_BIGGER_FILE: ret = dict_get_str (options, "file", &filename); @@ -2193,6 +2196,9 @@ cli_launch_glfs_heal (int heal_op, dict_t *options) break; case GF_SHD_OP_SPLIT_BRAIN_FILES: runner_add_args (&runner, "split-brain-info", NULL); + if (global_state->mode & GLUSTER_MODE_XML) { + runner_add_args (&runner, "xml", NULL); + } break; default: ret = -1; @@ -2262,8 +2268,10 @@ cli_cmd_volume_heal_cbk (struct cli_state *state, struct cli_cmd_word *word, out: if (ret) { cli_cmd_sent_status_get (&sent); - if ((sent == 0) && (parse_error == 0)) + if ((sent == 0) && (parse_error == 0) && + !(global_state->mode & GLUSTER_MODE_XML)) { cli_out ("Volume heal failed."); + } } CLI_STACK_DESTROY (frame); -- cgit