summaryrefslogtreecommitdiffstats
path: root/cli/src/cli-rpc-ops.c
diff options
context:
space:
mode:
Diffstat (limited to 'cli/src/cli-rpc-ops.c')
-rw-r--r--cli/src/cli-rpc-ops.c41
1 files changed, 8 insertions, 33 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c
index e8cda53..6774311 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: