diff options
author | jiffin tony thottan <jthottan@redhat.com> | 2015-12-07 14:38:54 +0530 |
---|---|---|
committer | Kaleb KEITHLEY <kkeithle@redhat.com> | 2017-04-24 10:32:20 +0000 |
commit | 6026944157798e0aca087a540776c0701ab0ced6 (patch) | |
tree | f0e47576340218faaf49bf5a3bb6c4d67ea3d1ca /cli/src/cli-cmd-parser.c | |
parent | c8e1c2d9382bd57fbdcc491e21fe24be3d4a1252 (diff) |
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 <jthottan@redhat.com>
Reviewed-on: https://review.gluster.org/16791
Smoke: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: soumya k <skoduri@redhat.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Diffstat (limited to 'cli/src/cli-cmd-parser.c')
-rw-r--r-- | cli/src/cli-cmd-parser.c | 30 |
1 files changed, 19 insertions, 11 deletions
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 .."); |