From 9a1060760da18999f5031732f8bc3d591b41a68e Mon Sep 17 00:00:00 2001 From: Jonathan Holloway Date: Mon, 7 Aug 2017 21:55:58 -0500 Subject: 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 --- glustolibs-gluster/glustolibs/gluster/gluster_base_class.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'glustolibs-gluster/glustolibs') 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 = {} -- cgit