Blob Blame History Raw
From 90d143d0011c15a5a334946cb628b5415825c786 Mon Sep 17 00:00:00 2001
From: Jiffin Tony Thottan <jthottan@redhat.com>
Date: Mon, 30 Apr 2018 12:35:01 +0530
Subject: [PATCH 252/260] glusterd/ganesha : Skip non-ganesha nodes properly
 for ganesha HA set up

Label: BACKPORT FROM UPSTREAM 3.10

Upstream reference:
>Patch unlink https://review.gluster.org/#/c/19949/
>Change-Id: Iff7bc3ead43e97847219c5a5cc8b967bf0967903
>BUG: 1573078
>Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>

Change-Id: Iff7bc3ead43e97847219c5a5cc8b967bf0967903
BUG: 1570541
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/137768
Tested-by: RHGS Build Bot <nigelb@redhat.com>
Reviewed-by: Kaleb Keithley <kkeithle@redhat.com>
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
---
 xlators/mgmt/glusterd/src/glusterd-ganesha.c | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/xlators/mgmt/glusterd/src/glusterd-ganesha.c b/xlators/mgmt/glusterd/src/glusterd-ganesha.c
index b130d5e..ae7485f 100644
--- a/xlators/mgmt/glusterd/src/glusterd-ganesha.c
+++ b/xlators/mgmt/glusterd/src/glusterd-ganesha.c
@@ -834,15 +834,18 @@ pre_setup (gf_boolean_t run_setup, char **op_errstr)
 {
         int    ret = 0;
 
-        if (check_host_list()) {
-                ret = setup_cluster(run_setup);
-                if (ret == -1)
-                        gf_asprintf (op_errstr, "Failed to set up HA "
-                                     "config for NFS-Ganesha. "
-                                     "Please check the log file for details");
-        } else
-		ret = -1;
-
+        if (run_setup) {
+                if (!check_host_list()) {
+                        gf_asprintf (op_errstr, "Running nfs-ganesha setup command "
+                                     "from node which is not part of ganesha cluster");
+                        return -1;
+                }
+        }
+        ret = setup_cluster(run_setup);
+        if (ret == -1)
+                gf_asprintf (op_errstr, "Failed to set up HA "
+                             "config for NFS-Ganesha. "
+                             "Please check the log file for details");
         return ret;
 }
 
-- 
1.8.3.1