From e078092e827807aec0eef185198771f49f809b34 Mon Sep 17 00:00:00 2001 From: Vijaikumar M Date: Tue, 25 Mar 2014 15:44:56 +0530 Subject: snapshot: cleanup unwanted CG-code Change-Id: Id3da2a7aac84027aeff050f6dd9a3484719362bc BUG: 1073780 Signed-off-by: Vijaikumar M Reviewed-on: http://review.gluster.org/7204 Reviewed-by: Rajesh Joseph Tested-by: Rajesh Joseph --- cli/src/cli-rpc-ops.c | 41 ++++++++--------------------------------- 1 file changed, 8 insertions(+), 33 deletions(-) (limited to 'cli') diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index e8cda5352..677431127 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -7535,12 +7535,8 @@ out: int32_t cli_snapshot_remove_reply (gf_cli_rsp *rsp, dict_t *dict, call_frame_t *frame) { - int32_t ret = -1; - char *snap_name = NULL; - char *cg_name = NULL; - int64_t volcount = -1; - char *volname = NULL; - gf_boolean_t is_cg = _gf_false; + int32_t ret = -1; + char *snap_name = NULL; GF_ASSERT (rsp); GF_ASSERT (dict); @@ -7554,35 +7550,14 @@ cli_snapshot_remove_reply (gf_cli_rsp *rsp, dict_t *dict, call_frame_t *frame) goto out; } - ret = dict_get_int64 (dict, "volcount", &volcount); - if (!ret) { - if (volcount == 1) { - ret = dict_get_str (dict, "volname1", &volname); - if (ret) - gf_log ("", GF_LOG_WARNING, "getting volume name" - " failed"); - } else - is_cg = _gf_true; - } - - if (is_cg) { - if (dict_get_str (dict, "cgname", - &cg_name) != 0) - cg_name = "???"; - - cli_out ("snapshot delete: %s: consistency " - "group removed successfully", - cg_name); - } else { - if (dict_get_str (dict, "snapname", - &snap_name) != 0) - snap_name = "???"; - - cli_out ("snapshot delete: %s: " - "snap removed successfully", - snap_name); + ret = dict_get_str (dict, "snapname", &snap_name); + if (ret) { + gf_log ("cli", GF_LOG_ERROR, "Failed to get snapname"); + goto out; } + cli_out ("snapshot delete: %s: snap removed successfully", + snap_name); ret = 0; out: -- cgit