From: Davanum Srinivas Date: Wed, 6 Feb 2013 01:54:43 +0000 (-0500) Subject: Allow tools/install_venv_common.py to be run from within the source directory. X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=87b1cdc164856bf32dee403c6eab19e2f7f1efab;p=openstack-build%2Fcinder-build.git Allow tools/install_venv_common.py to be run from within the source directory. (Copy latest update from oslo) Not doing this raised exceptions when it tried importing modules that didn't exist in the path. Fixes LP# 1112484 Change-Id: I2be7bde0bf873a22318617b987a76b209caef22a --- diff --git a/tools/install_venv_common.py b/tools/install_venv_common.py index 928dc3c9f..34ec14279 100644 --- a/tools/install_venv_common.py +++ b/tools/install_venv_common.py @@ -25,6 +25,12 @@ import os import subprocess import sys +possible_topdir = os.getcwd() +if os.path.exists(os.path.join(possible_topdir, "cinder", + "__init__.py")): + sys.path.insert(0, possible_topdir) + + from cinder.openstack.common import cfg