[openstack-dev] [Trove] Configurable db plugins

boden boden at linux.vnet.ibm.com
Mon Apr 28 19:03:09 UTC 2014


Guys,
I have a few small features / enhancements I'd like to suggest. I'm 
willing to contribute the code / unit tests myself, but am looking for a 
consensus from the group before I invest the time.

There are a few enhancements on my list -- I will send details each in a 
separate email to keep the communication clearer.


I'd like to propose the ability to support configurable db plugins for 
trove. Currently the sqlalchemy api's configure_db() function in trove 
supports the ability to pass in 1 or more db plugin (mappers) classes 
[1] which allow consumers to add their own schema (tables) to trove's 
db. However the current trove.cmd.*.py entry points do not support any 
means to pass in such plugins (example [2]).

I was thinking something like the following:
(a) Support a comma list property on CONF.DEFAULT in the trove conf 
files.. e.g.
[DEFAULT]
db_plugins = 
org.foo.bar.sqlalchemy.BarPlugins,org.yadda.sqlalchemy.MyPlugins

(b) In the trove CONF, default the comma list property to empty list 
(e.g. []).

(c) Update each of the respective trove.cmd.*.py entry point (main() 
methods) which call into configure_db() to first load any plugin classes 
and them pass them into the method.. e.g.
get_db_api().configure_db(CONF, import_classes(CONF.db_plugins))


The above should give consumers the ability to plug into the trove 
database api and add scheme without upstream changes.

Any disagreement / comments on this enhancement? Again -- I can 
contribute the code, unless someone is bored and wants to run with it 
short-term.

Thanks


[1] 
https://github.com/openstack/trove/blob/master/trove/db/sqlalchemy/api.py#L84
[2] https://github.com/openstack/trove/blob/master/trove/cmd/api.py#L41




More information about the OpenStack-dev mailing list