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