Merge "Detect python version in install_venv"
This commit is contained in:
commit
de78df9020
@ -100,12 +100,20 @@ def install_dependencies(venv=VENV):
|
|||||||
redirect_output=False)
|
redirect_output=False)
|
||||||
|
|
||||||
# Tell the virtual env how to "import glance"
|
# Tell the virtual env how to "import glance"
|
||||||
pthfile = os.path.join(venv, "lib", "python2.6", "site-packages",
|
py_ver = _detect_python_version(venv)
|
||||||
"glance.pth")
|
pthfile = os.path.join(venv, "lib", py_ver, "site-packages", "glance.pth")
|
||||||
f = open(pthfile, 'w')
|
f = open(pthfile, 'w')
|
||||||
f.write("%s\n" % ROOT)
|
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():
|
def print_help():
|
||||||
help = """
|
help = """
|
||||||
Glance development environment setup is complete.
|
Glance development environment setup is complete.
|
||||||
|
Loading…
Reference in New Issue
Block a user