From 546ed2dc498e1182859ebab19a3459e49bbe48ca Mon Sep 17 00:00:00 2001 From: Michael Kerrin Date: Mon, 22 Jul 2013 13:35:37 +0000 Subject: [PATCH] Fix oslo.config.cfg.NoSuchOptError when running individual tests We need to import cinder.common.config wherever we are using an olso configuration option from this module. Otherwise it is not necessarily the case that olso knows about the option and it complains. cinder.tests imports this configuration module but it not the case that this module has been imported when you you are running individual tests. Change-Id: I8f2c966848f55c80213d2ecd2dbf75b777627e6b Fixes: bug #1203737 --- cinder/backup/__init__.py | 5 ++--- cinder/volume/__init__.py | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/cinder/backup/__init__.py b/cinder/backup/__init__.py index 1d59acc02..354580f36 100644 --- a/cinder/backup/__init__.py +++ b/cinder/backup/__init__.py @@ -17,11 +17,10 @@ # collisions with use of 'from cinder.backup import ' elsewhere. -from oslo.config import cfg - +from cinder.common import config import cinder.openstack.common.importutils -CONF = cfg.CONF +CONF = config.CONF API = cinder.openstack.common.importutils.import_class(CONF.backup_api_class) diff --git a/cinder/volume/__init__.py b/cinder/volume/__init__.py index eaeba432a..40cb71bbb 100644 --- a/cinder/volume/__init__.py +++ b/cinder/volume/__init__.py @@ -20,11 +20,10 @@ # collisions with use of 'from cinder.volume import ' elsewhere. -from oslo.config import cfg - +from cinder.common import config import cinder.openstack.common.importutils as import_utils -CONF = cfg.CONF +CONF = config.CONF API = import_utils.import_class(CONF.volume_api_class) -- 2.45.2