Fix python3 issue in devstack plugin

Use $PYTHON to execute manage.py commands because it handles
both py2 and py3 environment.

Change-Id: I694f42db9b8110ee2b95b8132cd5ee5aa9d7357b
This commit is contained in:
Hongbin Lu 2019-11-25 12:41:44 +00:00
parent 86f2dbfa36
commit 6e6a0a9e55

View File

@ -1,6 +1,7 @@
# plugin.sh - DevStack plugin.sh dispatch script zun-ui
ZUN_UI_DIR=$(cd $(dirname $BASH_SOURCE)/.. && pwd)
PYTHON=${PYTHON:-python}
function install_zun_ui {
# NOTE(shu-mutou): workaround for devstack bug: 1540328
@ -19,7 +20,7 @@ function configure_zun_ui {
# NOTE: If locale directory does not exist, compilemessages will fail,
# so check for an existence of locale directory is required.
if [ -d ${ZUN_UI_DIR}/zun_ui/locale ]; then
(cd ${ZUN_UI_DIR}/zun_ui; DJANGO_SETTINGS_MODULE=openstack_dashboard.settings ../manage.py compilemessages)
(cd ${ZUN_UI_DIR}/zun_ui; DJANGO_SETTINGS_MODULE=openstack_dashboard.settings $PYTHON ../manage.py compilemessages)
fi
}