[openstack-dev] [OSLO] DB Support
Mark McLoughlin
markmc at redhat.com
Tue Apr 23 12:43:13 UTC 2013
On Tue, 2013-04-23 at 10:54 +0300, Gary Kotton wrote:
> 3. In the current Quantum versions all of the database configuration
> information is under a section [DATABASE]. The common code moves this to
> [DEFAULT]. If possible it would be great if we could preserve the
> current configuration file settings. This will enable us to have
> smoother version upgrades. If this is not possible then we will need a
> migration script to update configuration files. Does anyone have
> thoughts on this? I would like to make changes to the common code to
> ensure that we can use the DATABASE section.
Ok, the bug outlines one option:
https://bugs.launchpad.net/oslo/+bug/1171837
we move the db options to the 'database' group and make the group names
case insensitive as per:
https://blueprints.launchpad.net/oslo/+spec/cfg-lowercase-groups
Another option is to have get_session() in oslo take an sql_connection
parameter which would override CONF.sql_connection. Quantum would have
something like this:
sql_opts = [
cfg.StrOpt('sql_connection', default=None),
]
CONF.register_opts(sql_opts, group='DEFAULT')
def get_session():
if CONF.sql_connection:
log.warn("deprecated!")
return db_session.get_session(CONF.sql_connection)
If the sets DATABASE.sql_connection they get a deprecation warning but
it still works. If they don't set DATABASE.sql_connection, the common DB
code just falls back to DEFAULT.sql_connection.
Cheers,
Mark.
More information about the OpenStack-dev
mailing list