From 9678045a7032a302da57d92e2cbf7e0abd131621 Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Wed, 6 May 2020 10:48:09 +0300 Subject: [PATCH] Use horizon native wsgi app The only difference between our and native wsgi app were adding extra path [1] to sys.path. However, nowadays this path is already part of syspath [1] /openstack/venvs/horizon-20.1.1.dev7/lib/python3.6 Change-Id: I90a502fbdeb0040832b66e9df389ab3517b951f4 --- defaults/main.yml | 2 +- tasks/horizon_post_install.yml | 10 ---------- templates/horizon_django.wsgi.j2 | 14 -------------- 3 files changed, 1 insertion(+), 25 deletions(-) delete mode 100644 templates/horizon_django.wsgi.j2 diff --git a/defaults/main.yml b/defaults/main.yml index 08ca85d3..2a99a294 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -149,7 +149,7 @@ horizon_help_url: https://docs.openstack.org/horizon/latest/user/ ## Installation directories horizon_lib_dir: "{{ _horizon_lib_dir }}" -horizon_lib_wsgi_file: "{{ horizon_lib_dir }}/openstack_dashboard/wsgi/django.wsgi" +horizon_lib_wsgi_file: "{{ horizon_lib_dir }}/openstack_dashboard/wsgi.py" horizon_endpoint_type: internalURL diff --git a/tasks/horizon_post_install.yml b/tasks/horizon_post_install.yml index 7de18b22..34c6c60f 100644 --- a/tasks/horizon_post_install.yml +++ b/tasks/horizon_post_install.yml @@ -59,16 +59,6 @@ with_items: - { src: "/etc/horizon/local_settings.py", dest: "{{ horizon_lib_dir }}/openstack_dashboard/local/local_settings.py" } -- name: Setup Horizon config(s) - template: - src: "{{ item.src }}" - dest: "{{ item.dest }}" - owner: "{{ horizon_system_user_name }}" - group: "{{ horizon_system_group_name }}" - with_items: - - { src: "horizon_django.wsgi.j2", dest: "{{ horizon_lib_wsgi_file }}" } - notify: Restart apache2 - - name: Create customization module directory file: path: "{{ horizon_lib_dir }}/horizon_customization" diff --git a/templates/horizon_django.wsgi.j2 b/templates/horizon_django.wsgi.j2 deleted file mode 100644 index b7fbe818..00000000 --- a/templates/horizon_django.wsgi.j2 +++ /dev/null @@ -1,14 +0,0 @@ -import logging -import os -import sys -from django.core.wsgi import get_wsgi_application -from django.conf import settings - -# 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' -sys.stdout = sys.stderr - -DEBUG = False - -application = get_wsgi_application()