diff options
-rw-r--r-- | cli/src/cli-cmd-parser.c | 19 | ||||
-rw-r--r-- | cli/src/cli-cmd-snapshot.c | 2 |
2 files changed, 12 insertions, 9 deletions
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c index 6abd97ce7..c70c5a752 100644 --- a/cli/src/cli-cmd-parser.c +++ b/cli/src/cli-cmd-parser.c @@ -3311,8 +3311,9 @@ out: /* remove command takes either the snapname or the cg name. If snap has to be remvoed for a volume, then the volume name also should be given in the command. If cg should be removed, - then volume name is not necessary. - "gluster snapshot delete (<volname> -s <snapname> | -c <cgname>)" + then volume name is not necessary. Giving "force" will delete + the snapshot without giving notification. + "gluster snapshot delete (<volname> -s <snapname> | -c <cgname>) [force]" return value: -1 on failure 1 if user cancels the operation 0 on success @@ -3404,12 +3405,14 @@ cli_snap_remove_parse (dict_t *dict, const char **words, int wordcount, } } - answer = cli_cmd_get_confirmation (state, question); - if (GF_ANSWER_NO == answer) { - ret = 1; - gf_log ("", GF_LOG_DEBUG, "User cancelled " - "snapshot delete operation"); - goto out; + if ((strcmp (words[wordcount - 1], "force"))) { + answer = cli_cmd_get_confirmation (state, question); + if (GF_ANSWER_NO == answer) { + ret = 1; + gf_log ("", GF_LOG_DEBUG, "User cancelled " + "snapshot delete operation"); + goto out; + } } out: diff --git a/cli/src/cli-cmd-snapshot.c b/cli/src/cli-cmd-snapshot.c index f16e68dd6..1a5a2feef 100644 --- a/cli/src/cli-cmd-snapshot.c +++ b/cli/src/cli-cmd-snapshot.c @@ -100,7 +100,7 @@ struct cli_cmd snapshot_cmds[] = { cli_cmd_snapshot_cbk, "Snapshot Config." }, - {"snapshot delete (<volname> -s <snapname> | -c <cgname>)", + {"snapshot delete (<volname> -s <snapname> | -c <cgname>) [force]", cli_cmd_snapshot_cbk, "Snapshot Delete." }, |