Fix config path for running wsgi in developer mode

When following the new developer instructions for running keystone
under uwsgi, keystone could not find the keystone config file under
./etc/. This then caused it to be unable to find the paste config file
that it would have looked for in the same directory, resulting in an
error[1]. This patch adds the same logic that the eventlet server used
to have to add ./etc/keystone.conf to the list of potential config file
locations.

[1] http://paste.openstack.org/show/497439/

Change-Id: Iae02715df3ec28bf537cb8014f829ad52cc54c68
This commit is contained in:
Colleen Murphy 2016-05-17 20:40:34 -07:00
parent 45c92c4bd8
commit 80d7bee46d
1 changed files with 11 additions and 0 deletions

View File

@ -39,8 +39,19 @@ CONF = cfg.CONF
def initialize_application(name,
post_log_configured_function=lambda: None,
config_files=None):
possible_topdir = os.path.normpath(os.path.join(
os.path.abspath(__file__),
os.pardir,
os.pardir,
os.pardir))
dev_conf = os.path.join(possible_topdir,
'etc',
'keystone.conf')
if not config_files:
config_files = None
if os.path.exists(dev_conf):
config_files = [dev_conf]
common.configure(config_files=config_files)