summaryrefslogtreecommitdiffstats
path: root/cli/src/cli-cmd-snapshot.c
diff options
context:
space:
mode:
authorVijaikumar M <vmallika@redhat.com>2014-01-15 14:28:44 +0530
committerVijaikumar M <vmallika@redhat.com>2014-01-15 14:30:35 +0530
commitf05bd50f2de5001cbd7b45e3c4164b6d131b17b0 (patch)
treed6c736248d8964f317fd24c642a2fb729c7f8ab9 /cli/src/cli-cmd-snapshot.c
parente17b100f73b3204867d70f0f95a9b2de9c13b467 (diff)
glusterd/snapshot: A Warning must be displayed before the snapshot is deleted
Currently, on deleting snapshot , there is no warning message displayed to the user. A Warning must be displayed before the snapshot is deleted as follows: Deleting snap will erase all information about the snap. Do you want to continue? (y/n) Change-Id: I60f4f346da36b6564576c7482f5989a17d4bb5e1 BUG: 1048216 Signed-off-by: Vijaikumar M <vmallika@redhat.com>
Diffstat (limited to 'cli/src/cli-cmd-snapshot.c')
-rw-r--r--cli/src/cli-cmd-snapshot.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/cli/src/cli-cmd-snapshot.c b/cli/src/cli-cmd-snapshot.c
index 6d31dc2d5..f16e68dd6 100644
--- a/cli/src/cli-cmd-snapshot.c
+++ b/cli/src/cli-cmd-snapshot.c
@@ -53,8 +53,14 @@ cli_cmd_snapshot_cbk (struct cli_state *state, struct cli_cmd_word *word,
/* Parses the command entered by the user */
ret = cli_cmd_snapshot_parse (words, wordcount, &options, state);
if (ret) {
- cli_usage_out (word->pattern);
- parse_err = 1;
+ if (ret < 0) {
+ cli_usage_out (word->pattern);
+ parse_err = 1;
+ }
+ else {
+ /* User might have cancelled the snapshot operation */
+ ret = 0;
+ }
goto out;
}