Add support for Option Groups in LazyPluggable
Use @markmc's suggestion to enhance LazyPluggable with an optional config group. Also fix the baremetal database backend option to use the "baremetal" config group. Fixes LP #1093043 Change-Id: I28cf51a2962f516fcef4ced19e30c985220e86dc
This commit is contained in:
parent
5b04310d99
commit
84d8b43626
|
@ -50,16 +50,21 @@ from nova import utils
|
||||||
# because utils.LazyPluggable doesn't support reading from
|
# because utils.LazyPluggable doesn't support reading from
|
||||||
# option groups. See bug #1093043.
|
# option groups. See bug #1093043.
|
||||||
db_opts = [
|
db_opts = [
|
||||||
cfg.StrOpt('baremetal_db_backend',
|
cfg.StrOpt('db_backend',
|
||||||
default='sqlalchemy',
|
default='sqlalchemy',
|
||||||
help='The backend to use for db'),
|
help='The backend to use for bare-metal database'),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
baremetal_group = cfg.OptGroup(name='baremetal',
|
||||||
|
title='Baremetal Options')
|
||||||
|
|
||||||
CONF = cfg.CONF
|
CONF = cfg.CONF
|
||||||
CONF.register_opts(db_opts)
|
CONF.register_group(baremetal_group)
|
||||||
|
CONF.register_opts(db_opts, baremetal_group)
|
||||||
|
|
||||||
IMPL = utils.LazyPluggable(
|
IMPL = utils.LazyPluggable(
|
||||||
'baremetal_db_backend',
|
'db_backend',
|
||||||
|
config_group='baremetal',
|
||||||
sqlalchemy='nova.virt.baremetal.db.sqlalchemy.api')
|
sqlalchemy='nova.virt.baremetal.db.sqlalchemy.api')
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,8 @@ from nova import utils
|
||||||
|
|
||||||
|
|
||||||
IMPL = utils.LazyPluggable(
|
IMPL = utils.LazyPluggable(
|
||||||
'baremetal_db_backend',
|
'db_backend',
|
||||||
|
config_group='baremetal',
|
||||||
sqlalchemy='nova.virt.baremetal.db.sqlalchemy.migration')
|
sqlalchemy='nova.virt.baremetal.db.sqlalchemy.migration')
|
||||||
|
|
||||||
INIT_VERSION = 0
|
INIT_VERSION = 0
|
||||||
|
|
Loading…
Reference in New Issue