[openstack-dev] [oslo] usage patterns for oslo.config

Coles, Alistair 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 [1] 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() ?


[1] http://docs.openstack.org/developer/oslo.config/cfg.html#global-configopts

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20140808/b7c0e694/attachment.html>

More information about the OpenStack-dev mailing list