From 98b185a744446c611c500e078ed9bddfc2af4098 Mon Sep 17 00:00:00 2001 From: Jilju Joy Date: Thu, 29 Nov 2018 11:49:49 +0530 Subject: 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 --- glustolibs-gluster/glustolibs/gluster/nfs_libs.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'glustolibs-gluster/glustolibs') 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 -- cgit