]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Allow tools/install_venv_common.py to be run from within the source directory.
authorDavanum Srinivas <dims@linux.vnet.ibm.com>
Wed, 6 Feb 2013 01:54:43 +0000 (20:54 -0500)
committerDavanum Srinivas <dims@linux.vnet.ibm.com>
Wed, 6 Feb 2013 01:56:04 +0000 (20:56 -0500)
(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

tools/install_venv_common.py

index 928dc3c9f60569699a6b688084dede63dd2c6253..34ec142793f5618c1866c292ebda45a1be51f3bc 100644 (file)
@@ -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