From 5e08e4d2ca0a0e95b76d93861283b21c6bf6f3e7 Mon Sep 17 00:00:00 2001 From: Pranav Date: Wed, 27 May 2020 14:58:08 +0530 Subject: [Libfix] Change sequence of option set & start op As SSL cannot be set after volume start op, moving set_volume_option prior to volume start. Change-Id: I14e1dc42deb0c0c28736f03e07cf25f3adb48349 Signed-off-by: Pranav --- .../glustolibs/gluster/volume_libs.py | 32 ++++++++++++++++------ 1 file changed, 24 insertions(+), 8 deletions(-) (limited to 'glustolibs-gluster/glustolibs') diff --git a/glustolibs-gluster/glustolibs/gluster/volume_libs.py b/glustolibs-gluster/glustolibs/gluster/volume_libs.py index 6bb8d9c2f..a797d4d9e 100644 --- a/glustolibs-gluster/glustolibs/gluster/volume_libs.py +++ b/glustolibs-gluster/glustolibs/gluster/volume_libs.py @@ -302,6 +302,20 @@ def setup_volume(mnode, all_servers_info, volume_config, multi_vol=False, volname)) return True + is_ganesha = False + if 'nfs_ganesha' in volume_config: + is_ganesha = bool(volume_config['nfs_ganesha']['enable']) + + if not is_ganesha: + # Set all the volume options: + if 'options' in volume_config: + volume_options = volume_config['options'] + ret = set_volume_options(mnode=mnode, volname=volname, + options=volume_options) + if not ret: + g.log.error("Unable to set few volume options") + return False + # Start Volume time.sleep(2) ret = volume_start(mnode, volname) @@ -420,14 +434,16 @@ def setup_volume(mnode, all_servers_info, volume_config, multi_vol=False, g.log.error("USS is not enabled on the volume %s", volname) return False - # Set all the volume options: - if 'options' in volume_config: - volume_options = volume_config['options'] - ret = set_volume_options(mnode=mnode, volname=volname, - options=volume_options) - if not ret: - g.log.error("Unable to set few volume options") - return False + if is_ganesha: + # Set all the volume options for NFS Ganesha + if 'options' in volume_config: + volume_options = volume_config['options'] + ret = set_volume_options(mnode=mnode, volname=volname, + options=volume_options) + if not ret: + g.log.error("Unable to set few volume options") + return False + return True -- cgit