From c2462200ac3c3d49992561f2c9dd0fc55d1300c1 Mon Sep 17 00:00:00 2001 From: jiffin tony thottan Date: Mon, 7 Dec 2015 14:38:54 +0530 Subject: cli : provide prompt for the nfs-ganesha disable cli Presently, when we are executing the command "gluster nfs-ganesha disable", the disable of nfs-ganesha cluster starts working whereas, in some cases the user may not want to disable the cluster. So we shall let him know by giving a prompt to let him say "yes or no" for going ahead with the disable procedures. Change-Id: I860dad1479f7ca16bc2736b8056b609473bef65f BUG: 1289031 Signed-off-by: Jiffin Tony Thottan Reviewed-on: http://review.gluster.org/13450 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Kaleb KEITHLEY Reviewed-by: Niels de Vos --- cli/src/cli-cmd-parser.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'cli') diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c index 08cdce467ab..04c7ae20580 100644 --- a/cli/src/cli-cmd-parser.c +++ b/cli/src/cli-cmd-parser.c @@ -880,18 +880,23 @@ cli_cmd_ganesha_parse (struct cli_state *state, goto out; } - question = "Enabling NFS-Ganesha requires Gluster-NFS to be" - " disabled across the trusted pool. Do you " - "still want to continue?\n"; - if (strcmp (value, "enable") == 0) { - answer = cli_cmd_get_confirmation (state, question); - if (GF_ANSWER_NO == answer) { - gf_log ("cli", GF_LOG_ERROR, "Global operation " - "cancelled, exiting"); - ret = -1; - goto out; - } + question = "Enabling NFS-Ganesha requires Gluster-NFS to be" + " disabled across the trusted pool. Do you " + "still want to continue?\n"; + + } else if (strcmp (value, "disable") == 0) { + question = "Disabling NFS-Ganesha will tear down entire " + "ganesha cluster across the trusted pool. Do you " + "still want to continue?\n"; + } + + answer = cli_cmd_get_confirmation (state, question); + if (GF_ANSWER_NO == answer) { + gf_log ("cli", GF_LOG_ERROR, "Global operation " + "cancelled, exiting"); + ret = -1; + goto out; } cli_out ("This will take a few minutes to complete. Please wait .."); -- cgit