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