e7a346
From 90d143d0011c15a5a334946cb628b5415825c786 Mon Sep 17 00:00:00 2001
e7a346
From: Jiffin Tony Thottan <jthottan@redhat.com>
e7a346
Date: Mon, 30 Apr 2018 12:35:01 +0530
e7a346
Subject: [PATCH 252/260] glusterd/ganesha : Skip non-ganesha nodes properly
e7a346
 for ganesha HA set up
e7a346
e7a346
Label: BACKPORT FROM UPSTREAM 3.10
e7a346
e7a346
Upstream reference:
e7a346
>Patch unlink https://review.gluster.org/#/c/19949/
e7a346
>Change-Id: Iff7bc3ead43e97847219c5a5cc8b967bf0967903
e7a346
>BUG: 1573078
e7a346
>Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
e7a346
e7a346
Change-Id: Iff7bc3ead43e97847219c5a5cc8b967bf0967903
e7a346
BUG: 1570541
e7a346
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
e7a346
Reviewed-on: https://code.engineering.redhat.com/gerrit/137768
e7a346
Tested-by: RHGS Build Bot <nigelb@redhat.com>
e7a346
Reviewed-by: Kaleb Keithley <kkeithle@redhat.com>
e7a346
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
e7a346
---
e7a346
 xlators/mgmt/glusterd/src/glusterd-ganesha.c | 21 ++++++++++++---------
e7a346
 1 file changed, 12 insertions(+), 9 deletions(-)
e7a346
e7a346
diff --git a/xlators/mgmt/glusterd/src/glusterd-ganesha.c b/xlators/mgmt/glusterd/src/glusterd-ganesha.c
e7a346
index b130d5e..ae7485f 100644
e7a346
--- a/xlators/mgmt/glusterd/src/glusterd-ganesha.c
e7a346
+++ b/xlators/mgmt/glusterd/src/glusterd-ganesha.c
e7a346
@@ -834,15 +834,18 @@ pre_setup (gf_boolean_t run_setup, char **op_errstr)
e7a346
 {
e7a346
         int    ret = 0;
e7a346
 
e7a346
-        if (check_host_list()) {
e7a346
-                ret = setup_cluster(run_setup);
e7a346
-                if (ret == -1)
e7a346
-                        gf_asprintf (op_errstr, "Failed to set up HA "
e7a346
-                                     "config for NFS-Ganesha. "
e7a346
-                                     "Please check the log file for details");
e7a346
-        } else
e7a346
-		ret = -1;
e7a346
-
e7a346
+        if (run_setup) {
e7a346
+                if (!check_host_list()) {
e7a346
+                        gf_asprintf (op_errstr, "Running nfs-ganesha setup command "
e7a346
+                                     "from node which is not part of ganesha cluster");
e7a346
+                        return -1;
e7a346
+                }
e7a346
+        }
e7a346
+        ret = setup_cluster(run_setup);
e7a346
+        if (ret == -1)
e7a346
+                gf_asprintf (op_errstr, "Failed to set up HA "
e7a346
+                             "config for NFS-Ganesha. "
e7a346
+                             "Please check the log file for details");
e7a346
         return ret;
e7a346
 }
e7a346
 
e7a346
-- 
e7a346
1.8.3.1
e7a346