From 098cace25fe192ced2812259633dc7a8ef20faa9 Mon Sep 17 00:00:00 2001 From: Avra Sengupta Date: Tue, 12 Apr 2016 12:26:54 +0530 Subject: snapshot/cli: Fix snapshot status xml output Backport of http://review.gluster.org/#/c/14018/ snap status --xml errors out if a brick is down and doesn't have pid. It is handled in the cli of the snap status where "N/A" is displayed in such a scenario. Handled the same in xml snap status --xml fails as the writer is not initialised for the same. Using GF_SNAP_STATUS_TYPE_ITER instead of GF_SNAP_STATUS_TYPE_SNAP for all snap's status to differentiate between the two scenarios. Added testcase volume-snapshot-xml.t to check all snapshot commands xml outputs > Reviewed-on: http://review.gluster.org/14018 > Smoke: Gluster Build System > CentOS-regression: Gluster Build System > NetBSD-regression: NetBSD Build System > Reviewed-by: Rajesh Joseph Change-Id: I99563e8f3e84f1aaeabd865326bb825c44f5c745 BUG: 1369363 Signed-off-by: Avra Sengupta Reviewed-on: http://review.gluster.org/15290 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Rajesh Joseph --- xlators/mgmt/glusterd/src/glusterd-snapshot.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'xlators') diff --git a/xlators/mgmt/glusterd/src/glusterd-snapshot.c b/xlators/mgmt/glusterd/src/glusterd-snapshot.c index 5e86ab76403..1207b2180cc 100644 --- a/xlators/mgmt/glusterd/src/glusterd-snapshot.c +++ b/xlators/mgmt/glusterd/src/glusterd-snapshot.c @@ -5966,6 +5966,7 @@ glusterd_snapshot_status_prevalidate (dict_t *dict, char **op_errstr, { break; } + case GF_SNAP_STATUS_TYPE_ITER: case GF_SNAP_STATUS_TYPE_SNAP: { ret = dict_get_str (dict, "snapname", &snapname); @@ -7878,6 +7879,7 @@ glusterd_snapshot_status_commit (dict_t *dict, char **op_errstr, } break; } + case GF_SNAP_STATUS_TYPE_ITER: case GF_SNAP_STATUS_TYPE_SNAP: { -- cgit