Barbican manages its config options with the global oslo_config CONF object. Config options are first registered, and after all config options have been registered, the config file is parsed.
If the config file has already been parsed, any further attempts to add config options raises an error.
Currently, Barbican parses by calling config.parse_args() during "create_main_app" in app.py, and config options are registered in the separate modules.
This presents a rather hazardous race condition since if certain modules and plugins have not been loaded when parse_args() is called during startup, their options will not be registered in time and an error will be raised.
Right now, we have to make sure that all modules and plugins containing configurations have been imported into app.py before create_main_app is called.
This issue forces us to design modules in a non-pythonic fashion.
Fix proposed to branch: master /review. openstack. org/187297
Review: https:/