diff options
author | ShwethaHP <spandura@redhat.com> | 2017-08-03 05:33:27 +0530 |
---|---|---|
committer | ShwethaHP <spandura@redhat.com> | 2017-08-03 05:47:14 +0530 |
commit | f7f8b46c6d15a26576db0066efe8a93ab07f0a63 (patch) | |
tree | d878c03195a67422d10acd32a740bb2f602586de /glustolibs-gluster | |
parent | 9db25c3567bbc0897a64ab7856abf91ad2fe5af8 (diff) |
Set volume options on all the volume types
Providing a section in the config file to set volume options that can be
applicable to any volume type created. The glusterbase class also reads
the volume_options if provided in config file and set it on all the
volumes being created. These volume options will be overwritten if there
are any volume options specified while defining the volumes under 'volumes'
section.
Change-Id: I0003312251b4f8b151c9ba5c71d1b6a8884cc85e
Signed-off-by: ShwethaHP <spandura@redhat.com>
Diffstat (limited to 'glustolibs-gluster')
-rw-r--r-- | glustolibs-gluster/glustolibs/gluster/gluster_base_class.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/glustolibs-gluster/glustolibs/gluster/gluster_base_class.py b/glustolibs-gluster/glustolibs/gluster/gluster_base_class.py index 09946d739..ee7a23f3c 100644 --- a/glustolibs-gluster/glustolibs/gluster/gluster_base_class.py +++ b/glustolibs-gluster/glustolibs/gluster/gluster_base_class.py @@ -204,6 +204,13 @@ class GlusterBaseClass(unittest.TestCase): } } + # Default volume options which is applicable for all the volumes + cls.volume_options = {} + if ('volume_options' in g.config['gluster'] and + g.config['gluster']['volume_options']): + cls.volume_options = ( + g.config['gluster']['volume_options']) + # Get the volume configuration. cls.volume = {} if cls.volume_type: @@ -241,7 +248,7 @@ class GlusterBaseClass(unittest.TestCase): # Set volume options if 'options' not in cls.volume: - cls.volume['options'] = {} + cls.volume['options'] = cls.volume_options # Define Volume Useful Variables. cls.volname = cls.volume['name'] |