233933
From c5c6720c5186741a3b01a5ba2b34633fc1a00fc5 Mon Sep 17 00:00:00 2001
233933
From: Jiffin Tony Thottan <jthottan@redhat.com>
233933
Date: Mon, 30 Apr 2018 12:35:01 +0530
233933
Subject: [PATCH 080/124] glusterd/ganesha : Skip non-ganesha nodes properly
233933
 for ganesha HA set up
233933
233933
Label: DOWNSTREAM ONLY
233933
233933
Upstream reference:
233933
>Patch unlink https://review.gluster.org/#/c/19949/
233933
>Change-Id: Iff7bc3ead43e97847219c5a5cc8b967bf0967903
233933
>BUG: 1573078
233933
>Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
233933
233933
Change-Id: Iff7bc3ead43e97847219c5a5cc8b967bf0967903
233933
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
233933
Reviewed-on: https://code.engineering.redhat.com/gerrit/167165
233933
Reviewed-by: Soumya Koduri <skoduri@redhat.com>
233933
Tested-by: RHGS Build Bot <nigelb@redhat.com>
233933
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
233933
---
233933
 xlators/mgmt/glusterd/src/glusterd-ganesha.c | 23 +++++++++++++----------
233933
 1 file changed, 13 insertions(+), 10 deletions(-)
233933
233933
diff --git a/xlators/mgmt/glusterd/src/glusterd-ganesha.c b/xlators/mgmt/glusterd/src/glusterd-ganesha.c
233933
index ff36476..d882105 100644
233933
--- a/xlators/mgmt/glusterd/src/glusterd-ganesha.c
233933
+++ b/xlators/mgmt/glusterd/src/glusterd-ganesha.c
233933
@@ -842,17 +842,20 @@ static int
233933
 pre_setup(gf_boolean_t run_setup, char **op_errstr)
233933
 {
233933
     int ret = 0;
233933
-
233933
-    if (check_host_list()) {
233933
-        ret = setup_cluster(run_setup);
233933
-        if (ret == -1)
233933
+    if (run_setup) {
233933
+        if (!check_host_list()) {
233933
             gf_asprintf(op_errstr,
233933
-                        "Failed to set up HA "
233933
-                        "config for NFS-Ganesha. "
233933
-                        "Please check the log file for details");
233933
-    } else
233933
-        ret = -1;
233933
-
233933
+                        "Running nfs-ganesha setup command "
233933
+                        "from node which is not part of ganesha cluster");
233933
+            return -1;
233933
+        }
233933
+    }
233933
+    ret = setup_cluster(run_setup);
233933
+    if (ret == -1)
233933
+        gf_asprintf(op_errstr,
233933
+                    "Failed to set up HA "
233933
+                    "config for NFS-Ganesha. "
233933
+                    "Please check the log file for details");
233933
     return ret;
233933
 }
233933
 
233933
-- 
233933
1.8.3.1
233933