Fix keystone-manage config file path

Without this patch, the keystone-manage command looks for a default
keystone.conf relative to the installed executable. In a developer's
case this is likely to be relative to <venv name>/bin/keystone-manage.
If installed via distro packages this will be something like
/usr/bin/keystone-manage. The keystone developer documentation
instructs the developer to copy the sample config file into the etc/
directory of the keystone source directory[1], which is not necessarily
related to where the keystone-manage executable is installed. This
patch causes the keystone-manage command to search for
etc/keystone.conf relative to the python source file,
keystone/cmd/manage.py, which will always be in the same place relative
to the keystone repo's etc/ directory. If installed via distro packages
this will cause keystone-manage to search for the config in something
like /usr/lib/python2.7/dist-packages, but since it falls back to
searching the standard oslo.cfg directories, the behavior won't change.

[1] http://docs.openstack.org/developer/keystone/developing.html#configuring-keystone

Closes-bug: #1561099

Change-Id: Icf9caac030e62deb17ce5df3a82737b408591ac0
This commit is contained in:
Colleen Murphy 2016-03-22 16:10:06 -07:00
parent f738b28167
commit 139f892fec
1 changed files with 1 additions and 1 deletions

View File

@ -20,7 +20,7 @@ import sys
# If ../../keystone/__init__.py exists, add ../../ to Python search path, so
# that it will override what happens to be installed in
# /usr/(local/)lib/python...
possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
possible_topdir = os.path.normpath(os.path.join(os.path.abspath(__file__),
os.pardir,
os.pardir,
os.pardir))