Merge "Detect python version in install_venv"

This commit is contained in:
Jenkins 2011-08-05 20:37:41 +00:00 committed by Gerrit Code Review
commit de78df9020

View File

@ -100,12 +100,20 @@ def install_dependencies(venv=VENV):
redirect_output=False)
# Tell the virtual env how to "import glance"
pthfile = os.path.join(venv, "lib", "python2.6", "site-packages",
"glance.pth")
py_ver = _detect_python_version(venv)
pthfile = os.path.join(venv, "lib", py_ver, "site-packages", "glance.pth")
f = open(pthfile, 'w')
f.write("%s\n" % ROOT)
def _detect_python_version(venv):
lib_dir = os.path.join(venv, "lib")
for pathname in os.listdir(lib_dir):
if pathname.startswith('python'):
return pathname
raise Exception('Unable to detect Python version')
def print_help():
help = """
Glance development environment setup is complete.