Always reset CONF when starting the wsgi app

This ensures that options loaded during any prior run of the
application are dropped before being added again during init_application.

Change-Id: I968cbe6091856c3090840511e8006af518b99f3a
This commit is contained in:
Hervé Beraud 2020-06-04 12:28:30 +02:00 committed by Rico Lin
parent 4a707e45f5
commit c17eef90da
2 changed files with 6 additions and 0 deletions

View File

@ -33,6 +33,9 @@ CONF = cfg.CONF
def init_application():
i18n.enable_lazy()
# NOTE(hberaud): Call reset to ensure the ConfigOpts object doesn't
# already contain registered options if the app is reloaded.
CONF.reset()
logging.register_options(CONF)
version = hversion.version_info.version_string()
CONF(project='heat', prog='heat-api', version=version)

View File

@ -33,6 +33,9 @@ CONF = cfg.CONF
def init_application():
i18n.enable_lazy()
# NOTE(hberaud): Call reset to ensure the ConfigOpts object doesn't
# already contain registered options if the app is reloaded.
CONF.reset()
logging.register_options(CONF)
CONF(project='heat',
prog='heat-api-cfn',