summaryrefslogtreecommitdiffstats
path: root/glustolibs-gluster/glustolibs/gluster
diff options
context:
space:
mode:
authorPranav <prprakas@redhat.com>2020-05-27 14:58:08 +0530
committerArthy Loganathan <aloganat@redhat.com>2020-06-03 10:51:33 +0000
commit5e08e4d2ca0a0e95b76d93861283b21c6bf6f3e7 (patch)
tree1e1783d9b32f0a46a1105a962347e20474e22713 /glustolibs-gluster/glustolibs/gluster
parentee175bd6b40743268a341cc748dca50f58951c4a (diff)
[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 <prprakas@redhat.com>
Diffstat (limited to 'glustolibs-gluster/glustolibs/gluster')
-rw-r--r--glustolibs-gluster/glustolibs/gluster/volume_libs.py32
1 files changed, 24 insertions, 8 deletions
diff --git a/glustolibs-gluster/glustolibs/gluster/volume_libs.py b/glustolibs-gluster/glustolibs/gluster/volume_libs.py
index 6bb8d9c..a797d4d 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