From 83402810be11111e3f61f3a9c3771bb96161e551 Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Thu, 9 Sep 2010 02:30:07 -0700 Subject: [PATCH] put soren's fancy path code in scheduler bin as well --- bin/nova-scheduler | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bin/nova-scheduler b/bin/nova-scheduler index 97f98b17f267..38a8f213fedf 100755 --- a/bin/nova-scheduler +++ b/bin/nova-scheduler @@ -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