diff --git a/defaults/main.yml b/defaults/main.yml index 14a24d8a..f350dcdc 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -322,7 +322,6 @@ horizon_pip_packages: - greenlet - horizon - keystonemiddleware - - MySQL-python - PyMySQL - oslo.config - ply diff --git a/templates/horizon-manage.py.j2 b/templates/horizon-manage.py.j2 index 53e328b4..f74c6216 100644 --- a/templates/horizon-manage.py.j2 +++ b/templates/horizon-manage.py.j2 @@ -13,8 +13,11 @@ # under the License. import os +import pymysql import sys +pymysql.install_as_MySQLdb() + from django.core.management import execute_from_command_line # noqa if __name__ == "__main__": diff --git a/templates/horizon_django.wsgi.j2 b/templates/horizon_django.wsgi.j2 index b7fbe818..9766ba2e 100644 --- a/templates/horizon_django.wsgi.j2 +++ b/templates/horizon_django.wsgi.j2 @@ -1,9 +1,12 @@ import logging import os +import pymysql import sys from django.core.wsgi import get_wsgi_application from django.conf import settings +pymysql.install_as_MySQLdb() + # Add this file path to sys.path in order to import settings sys.path.insert(0, os.path.normpath(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../..'))) os.environ['DJANGO_SETTINGS_MODULE'] = 'openstack_dashboard.settings' diff --git a/templates/horizon_local_settings.py.j2 b/templates/horizon_local_settings.py.j2 index ae71ca74..87825379 100644 --- a/templates/horizon_local_settings.py.j2 +++ b/templates/horizon_local_settings.py.j2 @@ -1,4 +1,5 @@ import os +import pymysql from django.utils.translation import ugettext_lazy as _ @@ -7,6 +8,8 @@ from horizon.utils import secret_key from openstack_dashboard import exceptions from openstack_dashboard.settings import HORIZON_CONFIG +pymysql.install_as_MySQLdb() + DEBUG = {{ debug }} TEMPLATE_DEBUG = DEBUG diff --git a/vars/debian.yml b/vars/debian.yml index a890f2fe..e5d214c3 100644 --- a/vars/debian.yml +++ b/vars/debian.yml @@ -20,7 +20,6 @@ horizon_system_service_name: apache2 horizon_devel_distro_packages: - git - - libmariadbclient-dev # required to build MySQL-python - libssl-dev - libxslt1.1 - openssl @@ -31,7 +30,6 @@ horizon_distro_packages: - cron # required by the Ansible cron module - gettext - libapache2-mod-wsgi - - python-mysqldb # required by the Ansible mysql_db module horizon_service_distro_packages: - openstack-dashboard diff --git a/vars/redhat-7.yml b/vars/redhat-7.yml index dcc93bf9..44b87ea2 100644 --- a/vars/redhat-7.yml +++ b/vars/redhat-7.yml @@ -29,9 +29,7 @@ horizon_distro_packages: - httpd-tools - mod_ssl - mod_wsgi - - MySQL-python - which - - MariaDB-devel # required to build MySQL-python horizon_service_distro_packages: - openstack-designate-ui @@ -45,6 +43,7 @@ horizon_service_distro_packages: - openstack-octavia-ui - python-django-horizon - python-memcached + - python-PyMySQL horizon_apache_conf: "/etc/httpd/conf/httpd.conf" horizon_apache_default_log_folder: "/var/log/httpd" diff --git a/vars/suse-42.yml b/vars/suse.yml similarity index 96% rename from vars/suse-42.yml rename to vars/suse.yml index 71889e60..a4977e69 100644 --- a/vars/suse-42.yml +++ b/vars/suse.yml @@ -28,9 +28,7 @@ horizon_distro_packages: - cronie - cronie-anacron - gettext - - python-MySQL-python - which - - MariaDB-devel # required to build MySQL-python horizon_service_distro_packages: - openstack-horizon-plugin-designate-ui @@ -46,6 +44,7 @@ horizon_service_distro_packages: - openstack-horizon-plugin-trove-ui - python-horizon - python-memcached + - python-PyMySQL # SUSE does not currently have packages for the following dashboards horizon_enable_heat_ui: False