Introduce a PYTHON env var

* $PYTHON will have the path to python runtime to be used
* Use $PYTHON to run all the scripts

Change-Id: Ib5ab7820fc18cae5e50ea47302b610494197ad47
This commit is contained in:
Davanum Srinivas 2017-01-05 16:11:17 -05:00
parent 281c5c22ce
commit 51ecf0a869
3 changed files with 8 additions and 13 deletions

View File

@ -87,7 +87,7 @@ function write_clouds_yaml {
CA_CERT_ARG="--os-cacert $SSL_BUNDLE_FILE" CA_CERT_ARG="--os-cacert $SSL_BUNDLE_FILE"
fi fi
# demo -> devstack # demo -> devstack
$TOP_DIR/tools/update_clouds_yaml.py \ $PYTHON $TOP_DIR/tools/update_clouds_yaml.py \
--file $CLOUDS_YAML \ --file $CLOUDS_YAML \
--os-cloud devstack \ --os-cloud devstack \
--os-region-name $REGION_NAME \ --os-region-name $REGION_NAME \
@ -99,7 +99,7 @@ function write_clouds_yaml {
--os-project-name demo --os-project-name demo
# alt_demo -> devstack-alt # alt_demo -> devstack-alt
$TOP_DIR/tools/update_clouds_yaml.py \ $PYTHON $TOP_DIR/tools/update_clouds_yaml.py \
--file $CLOUDS_YAML \ --file $CLOUDS_YAML \
--os-cloud devstack-alt \ --os-cloud devstack-alt \
--os-region-name $REGION_NAME \ --os-region-name $REGION_NAME \
@ -111,7 +111,7 @@ function write_clouds_yaml {
--os-project-name alt_demo --os-project-name alt_demo
# admin -> devstack-admin # admin -> devstack-admin
$TOP_DIR/tools/update_clouds_yaml.py \ $PYTHON $TOP_DIR/tools/update_clouds_yaml.py \
--file $CLOUDS_YAML \ --file $CLOUDS_YAML \
--os-cloud devstack-admin \ --os-cloud devstack-admin \
--os-region-name $REGION_NAME \ --os-region-name $REGION_NAME \

View File

@ -81,11 +81,7 @@ function configure_horizon {
# Horizon is installed as develop mode, so we can compile here. # Horizon is installed as develop mode, so we can compile here.
# Message catalog compilation is handled by Django admin script, # Message catalog compilation is handled by Django admin script,
# so compiling them after the installation avoids Django installation twice. # so compiling them after the installation avoids Django installation twice.
if python3_enabled; then (cd $HORIZON_DIR; $PYTHON manage.py compilemessages)
(cd $HORIZON_DIR; python${PYTHON3_VERSION} manage.py compilemessages)
else
(cd $HORIZON_DIR; python manage.py compilemessages)
fi
# ``local_settings.py`` is used to override horizon default settings. # ``local_settings.py`` is used to override horizon default settings.
local local_settings=$HORIZON_DIR/openstack_dashboard/local/local_settings.py local local_settings=$HORIZON_DIR/openstack_dashboard/local/local_settings.py
@ -166,11 +162,7 @@ function install_django_openstack_auth {
git_clone_by_name "django_openstack_auth" git_clone_by_name "django_openstack_auth"
# Compile message catalogs before installation # Compile message catalogs before installation
_prepare_message_catalog_compilation _prepare_message_catalog_compilation
if python3_enabled; then (cd $dir; $PYTHON setup.py compile_catalog)
(cd $dir; python${PYTHON3_VERSION} setup.py compile_catalog)
else
(cd $dir; python setup.py compile_catalog)
fi
setup_dev_lib "django_openstack_auth" setup_dev_lib "django_openstack_auth"
fi fi
# if we aren't using this library from git, then we just let it # if we aren't using this library from git, then we just let it

View File

@ -83,6 +83,9 @@ fi
if python3_enabled; then if python3_enabled; then
install_python3 install_python3
export PYTHON=$(which python${PYTHON3_VERSION} 2>/dev/null || which python3 2>/dev/null)
else
export PYTHON=$(which python 2>/dev/null)
fi fi
# Mark end of run # Mark end of run