Blob Blame History Raw
From bd9148d6e5fa3586a7971634f74ae1b53877924f Mon Sep 17 00:00:00 2001
From: Jiffin Tony Thottan <jthottan@redhat.com>
Date: Tue, 8 Nov 2016 19:54:11 +0530
Subject: [PATCH 165/206] nfs/cli : add warning message while enabling gluster
 nfs

>Change-Id: Ice70003f7295d2d8af9877e1ecf6f3c81422b30c
>BUG: 1376693
>Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
>Reviewed-on: http://review.gluster.org/15805
>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: Atin Mukherjee <amukherj@redhat.com>
>Reviewed-by: soumya k <skoduri@redhat.com>
>Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
>(cherry picked from commit a35d63050ec7e745a66c1aef8e1c8eb42d7b67a1)

Change-Id: Ice70003f7295d2d8af9877e1ecf6f3c81422b30c
BUG: 1376695
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/90282
Reviewed-by: Soumya Koduri <skoduri@redhat.com>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
---
 cli/src/cli-cmd-parser.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c
index 04c8a22..7eed1a4 100644
--- a/cli/src/cli-cmd-parser.c
+++ b/cli/src/cli-cmd-parser.c
@@ -1679,6 +1679,20 @@ cli_cmd_volume_set_parse (struct cli_state *state, const char **words,
                                 goto out;
                         }
                 }
+                if ((!strcmp (key, "nfs.disable")) &&
+                            (!strcmp (value, "off"))) {
+                        question = "Gluster NFS is being deprecated in favor "
+                                   "of NFS-Ganesha Enter \"yes\" to continue "
+                                   "using Gluster NFS";
+                        answer = cli_cmd_get_confirmation (state, question);
+                        if (GF_ANSWER_NO == answer) {
+                                gf_log ("cli", GF_LOG_ERROR, "Operation "
+                                        "cancelled, exiting");
+                                *op_errstr = gf_strdup ("Aborted by user.");
+                                ret = -1;
+                                goto out;
+                        }
+                }
         }
 
         ret = dict_set_int32 (dict, "count", wordcount-3);
-- 
2.9.3