keystone/bin/keystone-manage
Mark McLoughlin 13dfd219c5 Fix thinko in keystone-all sys.path hack
We shouldn't be looking for keystone-all/__init__.py

Change-Id: I833342cbc3d0fff3168d31d72d1c7e8b029e32fd
2012-02-22 20:56:51 +00:00

29 lines
877 B
Python
Executable File

#!/usr/bin/env python
import os
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]),
os.pardir,
os.pardir))
if os.path.exists(os.path.join(possible_topdir,
'keystone',
'__init__.py')):
sys.path.insert(0, possible_topdir)
from keystone import cli
if __name__ == '__main__':
dev_conf = os.path.join(possible_topdir,
'etc',
'keystone.conf')
config_files = None
if os.path.exists(dev_conf):
config_files = [dev_conf]
cli.main(argv=sys.argv, config_files=config_files)