summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJilju Joy <jijoy@redhat.com>2018-11-29 11:49:49 +0530
committerVijay Avuthu <vavuthu@redhat.com>2018-12-06 06:04:42 +0000
commit98b185a744446c611c500e078ed9bddfc2af4098 (patch)
tree4e7b1b86e87f2df53fea67e53dbfd9a3e0326a55
parent3d9799eeed606f0b38e5c435d88831807c319065 (diff)
Correction in volume export scenario
Either nfs-ganesha or gnfs can be enabled. Both cannot co-exist. If 'nfs_ganesha' enable option is set to True in the configuration file, volume will be exported through nfs-ganesha, else it will be exported through gnfs Change-Id: I26e5aa8b29d54fc5d41d77fea7951df66e4de1e7
-rw-r--r--glustolibs-gluster/glustolibs/gluster/nfs_libs.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/glustolibs-gluster/glustolibs/gluster/nfs_libs.py b/glustolibs-gluster/glustolibs/gluster/nfs_libs.py
index 003ebc2d0..ad0f1e7a8 100644
--- a/glustolibs-gluster/glustolibs/gluster/nfs_libs.py
+++ b/glustolibs-gluster/glustolibs/gluster/nfs_libs.py
@@ -37,13 +37,6 @@ def export_volume_through_nfs(mnode, volname, enable_ganesha=False,
bool: If volume is successfully exported through nfs returns True.
False Otherwise.
"""
- # Enable nfs on the volume
- cmd = ("gluster volume set %s nfs.disable off --mode=script" % volname)
- ret, _, _ = g.run(mnode, cmd)
- if ret != 0:
- g.log.error("Failed to enable nfs for the volume %s", volname)
- return False
-
# Enable ganesha on the volume if enable_ganesha is True
if enable_ganesha:
cmd = ("gluster volume set %s ganesha.enable on --mode=script" %
@@ -52,6 +45,13 @@ def export_volume_through_nfs(mnode, volname, enable_ganesha=False,
if ret != 0:
g.log.error("Failed to enable nfs ganesha for volume %s", volname)
return False
+ else:
+ # Enable nfs on the volume
+ cmd = ("gluster volume set %s nfs.disable off --mode=script" % volname)
+ ret, _, _ = g.run(mnode, cmd)
+ if ret != 0:
+ g.log.error("Failed to enable nfs for the volume %s", volname)
+ return False
time.sleep(time_delay)
# Verify if volume is exported