[openstack-dev] [oslo] usage patterns for oslo.config
alistair.coles at hp.com
Fri Aug 8 13:40:21 UTC 2014
I've been looking at the implications of applying oslo.config in Swift, and I have a question about the best pattern for registering options.
Looking at how keystone uses oslo.config, the pattern seems to be to have all options declared and registered 'up-front' in a single place (keystone/common/config.py) before loading wsgi pipeline/starting the service. Is there another usage pattern where each middleware registers its options independently 'on-demand' rather than maintaining them all in a single place?
I read about a pattern  whereby modules register opts during import, but does that require there to be some point in the lifecycle where all required modules are imported *before* parsing config files? Seems like that would mean parsing the wsgi pipeline to 'discover' the middleware modules being used, importing all those modules, then parsing config files, then loading the wsgi pipeline?
OR - is it acceptable for each middleware module to register its own options if/when it is imported during wsgi pipeline loading (CONF.register_options()) and then call CONF.reload_config_files() ?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the OpenStack-dev