diff options
author | Jiffin Tony Thottan <jthottan@redhat.com> | 2018-04-30 12:35:01 +0530 |
---|---|---|
committer | Jiffin Tony Thottan <jthottan@redhat.com> | 2018-04-30 12:51:27 +0530 |
commit | 5cbde22e109fa49c85c5cfe571b1ebf779ad1b3d (patch) | |
tree | 68fb1299eddaf8fe2c8d03f6324de67d6e52a15e /xlators | |
parent | c420ef1251b6958c9602e5c8a47c7b614daedf24 (diff) |
glusterd/ganesha : Skip non-ganesha nodes properly for ganesha HA set uprelease-3.10
Change-Id: Iff7bc3ead43e97847219c5a5cc8b967bf0967903
BUG: 1573078
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-ganesha.c | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-ganesha.c b/xlators/mgmt/glusterd/src/glusterd-ganesha.c index b4410707cf9..bbe637d530f 100644 --- a/xlators/mgmt/glusterd/src/glusterd-ganesha.c +++ b/xlators/mgmt/glusterd/src/glusterd-ganesha.c @@ -807,18 +807,17 @@ start_ganesha (char **op_errstr) goto out; } } - - runinit (&runner); - runner_add_args (&runner, - GANESHA_PREFIX"/ganesha-ha.sh", - "--setup-ganesha-conf-files", CONFDIR, "yes", NULL); - ret = runner_run (&runner); - if (ret) { - gf_asprintf (op_errstr, "creation of symlink ganesha.conf " - "in /etc/ganesha failed"); - goto out; - } if (check_host_list()) { + runinit (&runner); + runner_add_args (&runner, + GANESHA_PREFIX"/ganesha-ha.sh", + "--setup-ganesha-conf-files", CONFDIR, "yes", NULL); + ret = runner_run (&runner); + if (ret) { + gf_asprintf (op_errstr, "creation of symlink ganesha.conf " + "in /etc/ganesha failed"); + goto out; + } ret = manage_service ("start"); if (ret) gf_asprintf (op_errstr, "NFS-Ganesha failed to start." @@ -834,15 +833,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; } |