From 6026944157798e0aca087a540776c0701ab0ced6 Mon Sep 17 00:00:00 2001 From: jiffin tony thottan Date: Mon, 7 Dec 2015 14:38:54 +0530 Subject: glusterd/ganesha : throw proper error for "gluster nfs-ganesha disable" For first time or if "gluster nfs-ganesha enable" fails the global option "nfs-ganesha" won't be stored in glusterd's dictionary. In both cases the "gluster nfs-ganesha disable" throws following error : "nfs-ganesha: failed: nfs-ganesha is already (null)d." Also this patch provides the missing prompt for nfs-ganesha disable in 3.10 Change-Id: I7c9fd6dabedc0cfb14c5190b3554bc63a6bc0340 BUG: 1427759 Signed-off-by: Jiffin Tony Thottan Reviewed-on: https://review.gluster.org/16791 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: soumya k Reviewed-by: Kaleb KEITHLEY --- cli/src/cli-cmd-parser.c | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) (limited to 'cli/src') diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c index d234ad09c4e..0061f019f8e 100644 --- a/cli/src/cli-cmd-parser.c +++ b/cli/src/cli-cmd-parser.c @@ -875,18 +875,26 @@ 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 the entire " + "ganesha cluster across the trusted pool. Do you " + "still want to continue?\n"; + } else { + ret = -1; + goto out; + } + + 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