From d7573c28f9257280239b37985f142cfd416e443c Mon Sep 17 00:00:00 2001 From: "Chen, Haochuan Z" Date: Thu, 7 Jan 2021 13:33:22 +0800 Subject: [PATCH] WA to fix mysqlclient version conflict with Django https://stackoverflow.com/questions/55657752/django-installing-mysqlclient-error-mysqlclient-1-3-13-or-newer-is-required Fix with guide from stackoverflow. After openstack image upgrade to ussuri, Django upgrade to 2.2, which request mysqlclient newer than 1.3.13, conflict with version 0.9.3 in current image. Fix with WA in above link, and currently we use pymysql not mysql. Closes-Bug: 1908117 Change-Id: Ic7054c6736993394d92bb0aec25397fd22f84d31 Signed-off-by: Chen, Haochuan Z --- openstack/python-horizon/centos/stx-horizon.dev_docker_image | 2 ++ openstack/python-horizon/centos/stx-horizon.stable_docker_image | 2 ++ 2 files changed, 4 insertions(+) diff --git a/openstack/python-horizon/centos/stx-horizon.dev_docker_image b/openstack/python-horizon/centos/stx-horizon.dev_docker_image index 98928503..d7f89083 100644 --- a/openstack/python-horizon/centos/stx-horizon.dev_docker_image +++ b/openstack/python-horizon/centos/stx-horizon.dev_docker_image @@ -10,6 +10,8 @@ CUSTOMIZATION="\ sudo cp /opt/rh/httpd24/root/etc/httpd/conf.modules.d/10-rh-python36-wsgi.conf /etc/httpd/conf.modules.d/10-wsgi.conf && \ sudo cp /opt/rh/httpd24/root/usr/lib64/httpd/modules/mod_rh-python36-wsgi.so /etc/httpd/modules/ && \ ln -s /bin/true /usr/bin/a2enmod && \ + sed -i -e 's/raise ImproperlyConfigured..mysqlclient 1.3.13 or newer is required.*/pass/' /var/lib/openstack/lib/python3.6/site-packages/django/db/backends/mysql/base.py && \ + sed -i -e '/query.decode.errors=.replace../s/decode/encode/' /var/lib/openstack/lib/python3.6/site-packages/django/db/backends/mysql/operations.py && \ sed -i 's/Listen 80/#Listen 80/' /etc/httpd/conf/httpd.conf \ " PYTHON3=yes diff --git a/openstack/python-horizon/centos/stx-horizon.stable_docker_image b/openstack/python-horizon/centos/stx-horizon.stable_docker_image index 0d14d5d9..bb1fac31 100644 --- a/openstack/python-horizon/centos/stx-horizon.stable_docker_image +++ b/openstack/python-horizon/centos/stx-horizon.stable_docker_image @@ -11,6 +11,8 @@ CUSTOMIZATION="\ sudo cp /opt/rh/httpd24/root/etc/httpd/conf.modules.d/10-rh-python36-wsgi.conf /etc/httpd/conf.modules.d/10-wsgi.conf && \ sudo cp /opt/rh/httpd24/root/usr/lib64/httpd/modules/mod_rh-python36-wsgi.so /etc/httpd/modules/ && \ ln -s /bin/true /usr/bin/a2enmod && \ + sed -i -e 's/raise ImproperlyConfigured..mysqlclient 1.3.13 or newer is required.*/pass/' /var/lib/openstack/lib/python3.6/site-packages/django/db/backends/mysql/base.py && \ + sed -i -e '/query.decode.errors=.replace../s/decode/encode/' /var/lib/openstack/lib/python3.6/site-packages/django/db/backends/mysql/operations.py && \ sed -i 's/Listen 80/#Listen 80/' /etc/httpd/conf/httpd.conf \ " PYTHON3=yes