From 0faf837454e3636876483dc289342e202af318e2 Mon Sep 17 00:00:00 2001 From: Shwetha Panduranga Date: Thu, 1 Dec 2016 00:50:32 +0530 Subject: Start gluster nfs-server only when the mount type is 'nfs'. Change-Id: Ie7a25927d9bd55a7115adfae4fd550f96f435950 Signed-off-by: Shwetha Panduranga --- glustolibs-gluster/glustolibs/gluster/gluster_base_class.py | 12 ++++++++++-- glustolibs-gluster/glustolibs/gluster/volume_libs.py | 7 ------- 2 files changed, 10 insertions(+), 9 deletions(-) (limited to 'glustolibs-gluster/glustolibs/gluster') diff --git a/glustolibs-gluster/glustolibs/gluster/gluster_base_class.py b/glustolibs-gluster/glustolibs/gluster/gluster_base_class.py index 23274e97f..5c38e0919 100644 --- a/glustolibs-gluster/glustolibs/gluster/gluster_base_class.py +++ b/glustolibs-gluster/glustolibs/gluster/gluster_base_class.py @@ -151,6 +151,15 @@ class GlusterBaseClass(unittest.TestCase): cls.volume_type) return False + # Set volume options + if 'options' not in cls.volume: + cls.volume['options'] = {} + + # Set nfs.disable to 'off' to start gluster-nfs server on start of the + # volume if the mount type is 'nfs' + if cls.mount_type == 'nfs': + cls.volume['options']['nfs.disable'] = 'off' + # SMB Info if cls.mount_type == 'cifs' or cls.mount_type == 'smb': cls.volume['smb'] = {} @@ -326,8 +335,7 @@ class GlusterVolumeBaseClass(GlusterBaseClass): (mount_obj.server_system, mount_obj.volname, mount_obj.client_system, mount_obj.mountpoint)) rc = False - if not rc: - return False + assert (rc == True), ("Unmount of all mounts are not successful") # Cleanup volume if cleanup_vol: diff --git a/glustolibs-gluster/glustolibs/gluster/volume_libs.py b/glustolibs-gluster/glustolibs/gluster/volume_libs.py index c3a67f608..24aac821d 100644 --- a/glustolibs-gluster/glustolibs/gluster/volume_libs.py +++ b/glustolibs-gluster/glustolibs/gluster/volume_libs.py @@ -216,13 +216,6 @@ def setup_volume(mnode, all_servers_info, volume_config, force=False): g.log.error("Unable to create volume %s" % volname) return False - # Set volume option nfs.disable to 'off' to start gluster-nfs server - cmd = "gluster volume set %s nfs.disable off" % volname - ret, out, err = g.run(mnode, cmd) - if ret != 0: - g.log.error("Unable to set the volume option nfs.disable to off.") - return False - # Start Volume time.sleep(2) ret = volume_start(mnode, volname) -- cgit