]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Allow tools/install_venv_common.py to be run from within the source directory.
authorDavanum Srinivas <dims@linux.vnet.ibm.com>
Tue, 5 Feb 2013 23:08:45 +0000 (18:08 -0500)
committerDavanum Srinivas <dims@linux.vnet.ibm.com>
Tue, 5 Feb 2013 23:08:45 +0000 (18:08 -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# 1116269

Change-Id: I3e2ed3ac96b51ec89def911054720d11bbcd9407

tools/install_venv_common.py

index 7bef5bf501a8151e607a7d268fabc347be742c9e..2de8e1c8298dedd31df12cc85a03ce555e5d291b 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, "quantum",
+                               "__init__.py")):
+    sys.path.insert(0, possible_topdir)
+
+
 from quantum.openstack.common import cfg