From 6f7a90ff7cb600146c12e6761df7d688d28f5176 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Thu, 18 Jan 2018 15:26:59 +0000 Subject: [PATCH] Export PYTHON_VERSION This is the '{MAJOR}.{MAJOR}' version number. Two incorrect usages of the 'python_version' function are replaced. Change-Id: I5770594a680268f8757d853a624cd5e1e545bd26 Signed-off-by: Stephen Finucane --- lib/keystone | 2 +- lib/placement | 2 +- tools/install_prereqs.sh | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/keystone b/lib/keystone index 714f089cca..c5405a17d9 100644 --- a/lib/keystone +++ b/lib/keystone @@ -179,7 +179,7 @@ function _config_keystone_apache_wsgi { keystone_auth_port=$KEYSTONE_AUTH_PORT_INT fi if [[ ${USE_VENV} = True ]]; then - venv_path="python-path=${PROJECT_VENV["keystone"]}/lib/$(python_version)/site-packages" + venv_path="python-path=${PROJECT_VENV["keystone"]}/lib/${PYTHON_VERSION}/site-packages" fi sudo cp $FILES/apache-keystone.template $keystone_apache_conf diff --git a/lib/placement b/lib/placement index 1d68f8a185..9ba251ab17 100644 --- a/lib/placement +++ b/lib/placement @@ -85,7 +85,7 @@ function _config_placement_apache_wsgi { # reuse nova's venv if there is one as placement code lives # there if [[ ${USE_VENV} = True ]]; then - venv_path="python-path=${PROJECT_VENV["nova"]}/lib/$(python_version)/site-packages" + venv_path="python-path=${PROJECT_VENV["nova"]}/lib/${PYTHON_VERSION}/site-packages" nova_bin_dir=${PROJECT_VENV["nova"]}/bin fi diff --git a/tools/install_prereqs.sh b/tools/install_prereqs.sh index da59093581..b42dd4cf44 100755 --- a/tools/install_prereqs.sh +++ b/tools/install_prereqs.sh @@ -84,8 +84,10 @@ fi if python3_enabled; then install_python3 export PYTHON=$(which python${PYTHON3_VERSION} 2>/dev/null || which python3 2>/dev/null) + export PYTHON_VERSION="$PYTHON3_VERSION" else export PYTHON=$(which python 2>/dev/null) + export PYTHON_VERSION="$PYTHON2_VERSION" fi # Mark end of run