Add murano-api to PYTHONPATH

It's required during running from command line

Change-Id: Ibb4bf0114fb54bb6e14735dd29c778d2fa63be70
This commit is contained in:
Ekaterina Fedorova 2013-09-24 14:46:30 +04:00
parent 59b036a956
commit 19d64eebcf
1 changed files with 9 additions and 1 deletions

View File

@ -13,8 +13,16 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import os
import sys
# If ../muranoapi/__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(__file__),
os.pardir,
os.pardir,
os.pardir))
if os.path.exists(os.path.join(possible_topdir, 'muranoapi', '__init__.py')):
sys.path.insert(0, possible_topdir)
from muranoapi.common import config
from muranoapi.common.service import TaskResultHandlerService