From 89ae9c91c39e64d26099f6f9c1ff2e0e880d4b6e 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. Backport of http://review.gluster.org/13450 > 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 > Signed-off-by: Muthu-vigneshwaran Change-Id: I9b80ce1316cbba641b55cefe7870f4a67d59eb90 BUG: 1364382 Signed-off-by: Muthu-vigneshwaran Reviewed-on: http://review.gluster.org/15096 Tested-by: Muthu Vigneshwaran Reviewed-by: jiffin tony Thottan Tested-by: jiffin tony Thottan NetBSD-regression: NetBSD Build System Smoke: Gluster Build System CentOS-regression: Gluster Build System Reviewed-by: Manikandan Selvaganesh Reviewed-by: Atin Mukherjee --- cli/src/cli-cmd-parser.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c index 64f526a7aae..692bd26e969 100644 --- a/cli/src/cli-cmd-parser.c +++ b/cli/src/cli-cmd-parser.c @@ -881,18 +881,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