summaryrefslogtreecommitdiffstats
path: root/glustolibs-gluster/glustolibs/gluster
diff options
context:
space:
mode:
authorManisha Saini <msaini@redhat.com>2020-08-09 02:43:28 +0530
committerBala Konda Reddy M <bala12352@gmail.com>2020-08-12 05:44:03 +0000
commit20a8e916d3dda15168077838b1fc258e365ed58d (patch)
tree5fe78a86d3b974dcb1ee97166f6502879b5d83f6 /glustolibs-gluster/glustolibs/gluster
parent1d0ff4497fa3df2f4acebbc0eef044fb122b64d9 (diff)
[Libfix] Modify Client section of NFS-Ganesha to support RHEL8
Change-Id: I62ff8409a2170becdebdaf8274a1032e63db40ea Signed-off-by: Manisha Saini <msaini@redhat.com>
Diffstat (limited to 'glustolibs-gluster/glustolibs/gluster')
-rwxr-xr-xglustolibs-gluster/glustolibs/gluster/nfs_ganesha_libs.py10
-rw-r--r--glustolibs-gluster/glustolibs/gluster/nfs_ganesha_ops.py35
2 files changed, 25 insertions, 20 deletions
diff --git a/glustolibs-gluster/glustolibs/gluster/nfs_ganesha_libs.py b/glustolibs-gluster/glustolibs/gluster/nfs_ganesha_libs.py
index cda79a5e6..5f69e68f6 100755
--- a/glustolibs-gluster/glustolibs/gluster/nfs_ganesha_libs.py
+++ b/glustolibs-gluster/glustolibs/gluster/nfs_ganesha_libs.py
@@ -33,6 +33,7 @@ from glustolibs.gluster.nfs_ganesha_ops import (
configure_ports_on_clients,
ganesha_client_firewall_settings)
from glustolibs.gluster.volume_libs import is_volume_exported
+from glustolibs.gluster.lib_utils import is_rhel7
def setup_nfs_ganesha(cls):
@@ -115,10 +116,11 @@ def setup_nfs_ganesha(cls):
return False
g.log.info("Nfs-ganesha Cluster exists is in healthy state")
- ret = configure_ports_on_clients(cls.clients)
- if not ret:
- g.log.error("Failed to configure ports on clients")
- return False
+ if is_rhel7(cls.clients):
+ ret = configure_ports_on_clients(cls.clients)
+ if not ret:
+ g.log.error("Failed to configure ports on clients")
+ return False
ret = ganesha_client_firewall_settings(cls.clients)
if not ret:
diff --git a/glustolibs-gluster/glustolibs/gluster/nfs_ganesha_ops.py b/glustolibs-gluster/glustolibs/gluster/nfs_ganesha_ops.py
index dfbf63fa3..b7cbed233 100644
--- a/glustolibs-gluster/glustolibs/gluster/nfs_ganesha_ops.py
+++ b/glustolibs-gluster/glustolibs/gluster/nfs_ganesha_ops.py
@@ -25,7 +25,8 @@
import os
from glusto.core import Glusto as g
from glustolibs.gluster.glusterdir import mkdir
-from glustolibs.gluster.lib_utils import add_services_to_firewall
+from glustolibs.gluster.lib_utils import (add_services_to_firewall,
+ is_rhel7)
from glustolibs.gluster.shared_storage_ops import enable_shared_storage
from glustolibs.gluster.peer_ops import peer_probe_servers
@@ -670,12 +671,13 @@ def create_nfs_ganesha_cluster(servers, vips):
# pylint: disable=too-many-statements
ganesha_mnode = servers[0]
- # Configure ports in ganesha servers
- g.log.info("Defining statd service ports")
- ret = configure_ports_on_servers(servers)
- if not ret:
- g.log.error("Failed to set statd service ports on nodes.")
- return False
+ # Configure ports in ganesha servers for RHEL7
+ if is_rhel7(servers):
+ g.log.info("Defining statd service ports")
+ ret = configure_ports_on_servers(servers)
+ if not ret:
+ g.log.error("Failed to set statd service ports on nodes.")
+ return False
# Firewall settings for nfs-ganesha
ret = ganesha_server_firewall_settings(servers)
@@ -945,7 +947,6 @@ def cluster_auth_setup(servers):
True(bool): If configuration of cluster services is success
False(bool): If failed to configure cluster services
"""
- result = True
for node in servers:
# Enable pacemaker.service
ret, _, _ = g.run(node, "systemctl enable pacemaker.service")
@@ -969,14 +970,16 @@ def cluster_auth_setup(servers):
g.log.error("unable to set password for hacluster on %s", node)
return False
- # Perform cluster authentication between the nodes
- for node in servers:
- ret, _, _ = g.run(node, "pcs cluster auth %s -u hacluster -p "
- "hacluster" % ' '.join(servers))
- if ret != 0:
- g.log.error("pcs cluster auth command failed on %s", node)
- result = False
- return result
+ # Perform cluster authentication between the nodes
+ auth_type = 'cluster' if is_rhel7(servers) else 'host'
+ for node in servers:
+ ret, _, _ = g.run(node, "pcs %s auth %s -u hacluster -p hacluster"
+ % (auth_type, ' '.join(servers)))
+ if ret:
+ g.log.error("pcs %s auth command failed on %s",
+ auth_type, node)
+ return False
+ return True
def configure_ports_on_servers(servers):