From d9db4a8ff300012eee87f31d73e303862d2de9b6 Mon Sep 17 00:00:00 2001 From: "Bala.FA" Date: Thu, 26 Sep 2013 08:09:35 +0530 Subject: cli: add node uuid in rebalance and remove brick status xml output This patch adds node uuid in rebalance/remove-brick status xml output. Output XML will look like 0 0 3 1 localhost ==>> 883626f8-4d29-4d02-8c5d-c9f48c5b2445 0 0 0 0 3 completed 0 0 0 0 3 completed Change-Id: I5a1d4f9043b33b9e88150647a243ddb16154e843 BUG: 1012296 Signed-off-by: Bala.FA Reviewed-on: http://review.gluster.org/6005 Reviewed-by: Kaushal M Tested-by: Gluster Build System --- cli/src/cli-xml-output.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'cli/src/cli-xml-output.c') diff --git a/cli/src/cli-xml-output.c b/cli/src/cli-xml-output.c index cb42e303d..6cc734a18 100644 --- a/cli/src/cli-xml-output.c +++ b/cli/src/cli-xml-output.c @@ -2989,6 +2989,7 @@ cli_xml_output_vol_rebalance_status (xmlTextWriterPtr writer, dict_t *dict, int ret = -1; int count = 0; char *node_name = NULL; + char *node_uuid = NULL; uint64_t files = 0; uint64_t size = 0; uint64_t lookups = 0; @@ -3026,13 +3027,22 @@ cli_xml_output_vol_rebalance_status (xmlTextWriterPtr writer, dict_t *dict, XML_RET_CHECK_AND_GOTO (ret, out); memset (key, 0, sizeof (key)); - snprintf (key, sizeof (key), "node-uuid-%d", i); + snprintf (key, sizeof (key), "node-name-%d", i); ret = dict_get_str (dict, key, &node_name); if (ret) goto out; ret = xmlTextWriterWriteFormatElement (writer, (xmlChar *)"nodeName", "%s", node_name); + + memset (key, 0, sizeof (key)); + snprintf (key, sizeof (key), "node-uuid-%d", i); + ret = dict_get_str (dict, key, &node_uuid); + if (ret) + goto out; + ret = xmlTextWriterWriteFormatElement (writer, + (xmlChar *)"id", + "%s", node_uuid); XML_RET_CHECK_AND_GOTO (ret, out); memset (key, 0, sizeof (key)); -- cgit