From 80d7bee46d6a9e11b0fe9a3905d8de251e9afddf Mon Sep 17 00:00:00 2001 From: Colleen Murphy Date: Tue, 17 May 2016 20:40:34 -0700 Subject: [PATCH] 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 --- keystone/server/wsgi.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/keystone/server/wsgi.py b/keystone/server/wsgi.py index 14fc9a2c5a..1c8f6350f3 100644 --- a/keystone/server/wsgi.py +++ b/keystone/server/wsgi.py @@ -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)