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 +++---- glustolibs-gluster/setup.py | 2 +- 2 files changed, 4 insertions(+), 5 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 = {} diff --git a/glustolibs-gluster/setup.py b/glustolibs-gluster/setup.py index ad1635924..005571b83 100644 --- a/glustolibs-gluster/setup.py +++ b/glustolibs-gluster/setup.py @@ -19,7 +19,7 @@ from setuptools import setup, find_packages from distutils import dir_util -version = '0.2' +version = '0.21' name = 'glustolibs-gluster' setup( -- cgit