wsgi: Always reset conf.CONF when starting the application

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

Change-Id: I41b5c7990d4d62a3a397f1686261f3fb7dc1a0be
Closes-bug: #1784155
This commit is contained in:
Lee Yarwood 2018-09-20 18:09:04 +01:00
parent 8e27880a18
commit d83b1056b4
1 changed files with 5 additions and 0 deletions

View File

@ -101,6 +101,11 @@ def _set_middleware_defaults():
def init_application():
# initialize the config system
conffile = _get_config_file()
# NOTE(lyarwood): Call reset to ensure the ConfigOpts object doesn't
# already contain registered options if the app is reloaded.
conf.CONF.reset()
# This will raise cfg.ConfigFilesNotFoundError and cfg.RequiredOptError
# when either conffile is not there or some required option is not set
# (notably the database connection string). We want both of these to