Replace FLAGS with cfg.CONF in db

Replace all the FLAGS with cfg.CONF in cinder/db
Large commit "https://review.openstack.org/31172" was split into several parts
Use the common pattern: CONF = cfg.CONF

Change-Id: Ibac0a4b233ba82e13e3a9bfb6bd3fd418cdab29f
Fixes: bug #1182037
This commit is contained in:
Sergey Vilgelm
2013-06-03 13:12:32 +04:00
committed by Sergey Vilgelm
parent a003e4a41f
commit 4b05a10331
6 changed files with 28 additions and 31 deletions

View File

@@ -18,17 +18,18 @@
"""Base class for classes that need modular database access."""
from oslo.config import cfg
from cinder import flags
from cinder.openstack.common import importutils
db_driver_opt = cfg.StrOpt('db_driver',
default='cinder.db',
help='driver to use for database access')
FLAGS = flags.FLAGS
FLAGS.register_opt(db_driver_opt)
CONF = cfg.CONF
CONF.register_opt(db_driver_opt)
class Base(object):
@@ -36,5 +37,5 @@ class Base(object):
def __init__(self, db_driver=None):
if not db_driver:
db_driver = FLAGS.db_driver
db_driver = CONF.db_driver
self.db = importutils.import_module(db_driver) # pylint: disable=C0103