diff options
author | Aravinda VK <avishwan@redhat.com> | 2013-08-30 14:37:03 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2013-09-12 10:57:22 -0700 |
commit | cd7951aa31ae4bbdf35fc6d1f2466636844b889d (patch) | |
tree | b504ffb4e6bbc24ced3809d0302180a008865756 /cli/src/cli-xml-output.c | |
parent | 643533c77fd49316b7d16015fa1a008391d14bb2 (diff) |
cli: Add statusStr xml tag to task list and rebalance/remove brick status
New xml tag statusStr added to following gluster cli commands
gluster volume status all --xml (For Task status)
gluster volume rebalance <VOLNAME> status --xml
gluster volume remove-brick <VOLNAME> <BRICK1..> status --xml
Example(volume status all):
<task>
<type>Rebalance</type>
<id>82d8d122-8738-4144-8507-d93fc98b61df</id>
<status>3</status>
<statusStr>completed</statusStr>
</task>
Example(volume rebalance <VOL> status)
<node>
<nodeName>localhost</nodeName>
<files>0</files>
<size>0</size>
<lookups>0</lookups>
<failures>0</failures>
<status>3</status>
<statusStr>completed</statusStr>
</node>
Also modified task status as string instead of showing number
in gluster volume status all
Example:
Status of volume: gv1
Gluster process Port Online Pid
------------------------------------------------------------------------------
Brick sumne.sumne:/gfs/b1 49154 Y 15489
Brick sumne.sumne:/gfs/b2 49155 Y 15493
NFS Server on localhost N/A N 15913
Task ID Status
---- -- ------
Rebalance 82d8d122-8738-4144-8507-d93fc98b61df completed
BUG: 1003521
Change-Id: Ib283016af4c18132fb13fb33d44075782d77823c
Signed-off-by: Aravinda VK <avishwan@redhat.com>
Reviewed-on: http://review.gluster.org/5739
Reviewed-by: Kaushal M <kaushal@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'cli/src/cli-xml-output.c')
-rw-r--r-- | cli/src/cli-xml-output.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/cli/src/cli-xml-output.c b/cli/src/cli-xml-output.c index 6103a2cbd1d..5218e19e91d 100644 --- a/cli/src/cli-xml-output.c +++ b/cli/src/cli-xml-output.c @@ -1436,6 +1436,21 @@ cli_xml_output_vol_status_tasks (cli_local_t *local, dict_t *dict) { "%d", status); XML_RET_CHECK_AND_GOTO (ret, out); + if (!strcmp (task_type, "Replace brick")) { + if (status) { + status = GF_DEFRAG_STATUS_COMPLETE; + } else { + status = GF_DEFRAG_STATUS_STARTED; + } + } + + ret = xmlTextWriterWriteFormatElement (local->writer, + (xmlChar *)"statusStr", + "%s", + cli_vol_task_status_str[status]); + + XML_RET_CHECK_AND_GOTO (ret, out); + /* </task> */ ret = xmlTextWriterEndElement (local->writer); XML_RET_CHECK_AND_GOTO (ret, out); @@ -2968,6 +2983,12 @@ cli_xml_output_vol_rebalance_status (xmlTextWriterPtr writer, dict_t *dict) "%d", status_rcd); XML_RET_CHECK_AND_GOTO (ret, out); + ret = xmlTextWriterWriteFormatElement (writer, + (xmlChar *)"statusStr", + "%s", + cli_vol_task_status_str[status_rcd]); + XML_RET_CHECK_AND_GOTO (ret, out); + /* </node> */ ret = xmlTextWriterEndElement (writer); XML_RET_CHECK_AND_GOTO (ret, out); |