summaryrefslogtreecommitdiffstats
path: root/glustolibs-gluster/glustolibs
diff options
context:
space:
mode:
authorJonathan Holloway <jholloway@redhat.com>2017-08-07 21:55:58 -0500
committerJonathan Holloway <jholloway@redhat.com>2017-08-08 01:03:35 -0500
commit9a1060760da18999f5031732f8bc3d591b41a68e (patch)
tree5175af2d040b40fd7bb6776b4a1350725998d149 /glustolibs-gluster/glustolibs
parentf7f8b46c6d15a26576db0066efe8a93ab07f0a63 (diff)
add gluster object exists check to volume config default
gluster_base_class.py: fix error by adding check to ensure gluster entry exists when no gluster object defined in config file setup.py: version up to 0.21 Change-Id: I37001673c03a32571b78bbd32489fc1992333d73 Signed-off-by: Jonathan Holloway <jholloway@redhat.com>
Diffstat (limited to 'glustolibs-gluster/glustolibs')
-rw-r--r--glustolibs-gluster/glustolibs/gluster/gluster_base_class.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/glustolibs-gluster/glustolibs/gluster/gluster_base_class.py b/glustolibs-gluster/glustolibs/gluster/gluster_base_class.py
index ee7a23f3c..3dd8f976f 100644
--- a/glustolibs-gluster/glustolibs/gluster/gluster_base_class.py
+++ b/glustolibs-gluster/glustolibs/gluster/gluster_base_class.py
@@ -206,10 +206,9 @@ 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'])
+ if (g.config.get('gluster') and
+ g.config['gluster'].get('volume_options')):
+ cls.volume_options = g.config['gluster']['volume_options']
# Get the volume configuration.
cls.volume = {}