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