put soren's fancy path code in scheduler bin as well

This commit is contained in:
Vishvananda Ishaya 2010-09-09 02:30:07 -07:00
parent 68309b148f
commit 83402810be

View File

@ -21,6 +21,17 @@
Twistd daemon for the nova scheduler nodes.
"""
import os
import sys
# If ../nova/__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, 'nova', '__init__.py')):
sys.path.insert(0, possible_topdir)
from nova import service
from nova import twistd