From eb33931e4f7f57af87e307d36baba5084cd97da8 Mon Sep 17 00:00:00 2001 From: Rajesh Joseph Date: Wed, 26 Aug 2015 08:28:59 +0530 Subject: gluster/cli: snapshot delete all does not work with xml Backport of http://review.gluster.org/#/c/12027/ Problem: snapshot delete all command fails with --xml option Fix: Provided xml support for delete all command Change-Id: I77cad131473a9160e188c783f442b6a38a37f758 BUG: 1258113 Signed-off-by: Rajesh Joseph Reviewed-on: http://review.gluster.org/12027 Tested-by: NetBSD Build System Tested-by: Gluster Build System Reviewed-by: Avra Sengupta (cherry picked from commit fd47635a4ffab621a2357c99cd1edd0482940bd5) Reviewed-on: http://review.gluster.org/12042 --- xlators/mgmt/glusterd/src/glusterd-snapshot.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'xlators') diff --git a/xlators/mgmt/glusterd/src/glusterd-snapshot.c b/xlators/mgmt/glusterd/src/glusterd-snapshot.c index f9a01f31e63..a957377b1a6 100644 --- a/xlators/mgmt/glusterd/src/glusterd-snapshot.c +++ b/xlators/mgmt/glusterd/src/glusterd-snapshot.c @@ -5506,15 +5506,16 @@ glusterd_handle_snapshot_delete (rpcsvc_request_t *req, glusterd_op_t op, GF_ASSERT (err_str); GF_VALIDATE_OR_GOTO (this->name, op_errno, out); - ret = dict_get_int32 (dict, "delete-cmd", &delete_cmd); + ret = dict_get_int32 (dict, "sub-cmd", &delete_cmd); if (ret) { gf_msg (this->name, GF_LOG_ERROR, 0, - GD_MSG_COMMAND_NOT_FOUND, "Failed to get delete-cmd"); + GD_MSG_COMMAND_NOT_FOUND, "Failed to get sub-cmd"); goto out; } switch (delete_cmd) { case GF_SNAP_DELETE_TYPE_SNAP: + case GF_SNAP_DELETE_TYPE_ITER: ret = glusterd_handle_snapshot_delete_type_snap (req, op, dict, err_str, op_errno, len); @@ -5647,7 +5648,7 @@ glusterd_snapshot_status_prevalidate (dict_t *dict, char **op_errstr, goto out; } - ret = dict_get_int32 (dict, "status-cmd", &cmd); + ret = dict_get_int32 (dict, "sub-cmd", &cmd); if (ret) { gf_msg (this->name, GF_LOG_ERROR, 0, GD_MSG_DICT_GET_FAILED, @@ -7531,7 +7532,7 @@ glusterd_snapshot_status_commit (dict_t *dict, char **op_errstr, conf = this->private; GF_ASSERT (conf); - ret = dict_get_int32 (dict, "status-cmd", &cmd); + ret = dict_get_int32 (dict, "sub-cmd", &cmd); if (ret) { gf_msg (this->name, GF_LOG_ERROR, 0, GD_MSG_DICT_GET_FAILED, @@ -7539,7 +7540,7 @@ glusterd_snapshot_status_commit (dict_t *dict, char **op_errstr, goto out; } - ret = dict_set_int32 (rsp_dict, "status-cmd", cmd); + ret = dict_set_int32 (rsp_dict, "sub-cmd", cmd); if (ret) { gf_msg (this->name, GF_LOG_ERROR, 0, GD_MSG_DICT_SET_FAILED, -- cgit