summaryrefslogtreecommitdiffstats
path: root/cli
diff options
context:
space:
mode:
authorhari gowtham <hgowtham@redhat.com>2016-04-28 11:48:23 +0530
committerAtin Mukherjee <amukherj@redhat.com>2016-05-08 21:00:50 -0700
commit50984a76c27d8f0a2f9457192ac66169fdd7b9ba (patch)
tree7bee660d61ffbe8c0699e50778ca7ceee8824462 /cli
parent3639c84d9a3b7e3e490c0b87964d33422ba922a9 (diff)
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 <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <cliOutput> <healInfo> <bricks> <brick hostUuid="3677edbb-0a6a-415e-b0ee-b846ff93259c"> <name>10.70.42.183:/home/bricks/b1</name> <status>Connected</status> <numberOfEntries>0</numberOfEntries> </brick> <brick hostUuid="3677edbb-0a6a-415e-b0ee-b846ff93259c"> <name>10.70.42.183:/home/bricks/b2</name> <status>Connected</status> <numberOfEntries>0</numberOfEntries> </brick> </bricks> </healInfo> <opRet>0</opRet> <opErrno>0</opErrno> <opErrstr/> </cliOutput> gluster v heal v1 info split-brain --xml <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <cliOutput> <healInfo> <bricks> <brick hostUuid="3677edbb-0a6a-415e-b0ee-b846ff93259c"> <name>10.70.42.183:/home/bricks/b1</name> <status>Connected</status> <numberOfEntries>0</numberOfEntries> </brick> <brick hostUuid="3677edbb-0a6a-415e-b0ee-b846ff93259c"> <name>10.70.42.183:/home/bricks/b2</name> <status>Connected</status> <numberOfEntries>0</numberOfEntries> </brick> </bricks> </healInfo> <opRet>0</opRet> <opErrno>0</opErrno> <opErrstr/> </cliOutput> >Change-Id: I20ad5eb7950d4721364ab46089e3af515162db82 >BUG: 1331287 >Signed-off-by: hari gowtham <hgowtham@redhat.com> Change-Id: I64c4aee63e545b0fa54d2482e000a543823c6be9 BUG: 1063506 Signed-off-by: hari gowtham <hgowtham@redhat.com> Reviewed-on: http://review.gluster.org/14249 NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Atin Mukherjee <amukherj@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Diffstat (limited to 'cli')
-rw-r--r--cli/src/cli-cmd-volume.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c
index 39a6e7d3aa4..0c1b2d2274e 100644
--- a/cli/src/cli-cmd-volume.c
+++ b/cli/src/cli-cmd-volume.c
@@ -2175,6 +2175,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);
@@ -2196,6 +2199,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;
@@ -2265,8 +2271,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);