Add murano-conductor to pythonpath in a better way

Change-Id: I97e9081e9b2efddf61e1f5b96b910e779e5277c7
This commit is contained in:
Ekaterina Fedorova 2013-09-23 19:53:10 +04:00
parent c3623ac210
commit 82806b4232

View File

@ -16,7 +16,16 @@
import sys
import os
sys.path.append(os.path.join(os.path.curdir))
# If ../muranoconductor/__init__.py exists, add ../ to Python search path, so
# it will override what happens to be installed in /usr/(local/)lib/python...
possible_topdir = os.path.normpath(os.path.join(os.path.abspath(__file__),
os.pardir,
os.pardir,
os.pardir))
if os.path.exists(os.path.join(possible_topdir,
'muranoconductor',
'__init__.py')):
sys.path.insert(0, possible_topdir)
from muranoconductor import config
from muranoconductor.openstack.common import log