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() ?

Thanks,
Alistair

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

_______________________________________________
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

Reply via email to