Calls manager.py by "$PYTHON" instead of "env python"

devstack should call manager.py by using $PYTHON variable that devstack
uses through openstack installation because manage.py uses python2
unless caller explicitly uses python3 interpreter.

Currently devstack fails with the following error message when devstack
uses python3::

  ++ /opt/stack/trove-dashboard/devstack/plugin.sh:configure_trove_dashboard:14 :   ../manage.py compilemessages
  Traceback (most recent call last):
    File "../manage.py", line 18, in <module>
      from django.core.management import execute_from_command_line
  ImportError: No module named django.core.management
  + /opt/stack/trove-dashboard/devstack/plugin.sh:configure_trove_dashboard:1 :   exit_trap

The reason for this error is no django.core.management library exists
in python2 site-packages because devstack installs the library as a
python3 library.

Story: 2007463
Task: 39148
Signed-off-by: Hirotaka Wakabayashi <hiwkby@yahoo.com>
Change-Id: Ia5f87788e117e9bbd9823afb6a8f139eb3ae5870
This commit is contained in:
Hirotaka Wakabayashi 2020-03-23 05:22:21 +00:00
parent e03bad61e9
commit 0db9bad00c
1 changed files with 1 additions and 1 deletions

View File

@ -11,7 +11,7 @@ function configure_trove_dashboard {
# NOTE: If locale directory does not exist, compilemessages will fail,
# so check for an existence of locale directory is required.
if [ -d ${TROVE_DASHBOARD_DIR}/trove_dashboard/locale ]; then
(cd ${TROVE_DASHBOARD_DIR}/trove_dashboard; DJANGO_SETTINGS_MODULE=openstack_dashboard.settings ../manage.py compilemessages)
(cd ${TROVE_DASHBOARD_DIR}/trove_dashboard; DJANGO_SETTINGS_MODULE=openstack_dashboard.settings $PYTHON ../manage.py compilemessages)
fi
}