Helpdesk frontend related fixes and general cleanup

Change-Id: Id0ef4366febaa47d8f6393b3370bd19fd69185d3
Closes-Bug: #1555138
This commit is contained in:
Adam Tengler 2016-03-09 15:45:16 +01:00
parent a22ebefc02
commit ec904fe889
3 changed files with 35 additions and 51 deletions

View File

@ -3,12 +3,12 @@ from django.utils.translation import ugettext_lazy as _
from openstack_dashboard import exceptions
{%- from "horizon/map.jinja" import server with context %}
{%- if server.app is defined %}
{%- set app = salt['pillar.get']('horizon:server:app:'+app_name) %}
{% include "horizon/files/horizon_settings/_local_settings.py" %}
{% include "horizon/files/horizon_settings/_horizon_settings.py" %}
{% include "horizon/files/horizon_settings/_keystone_settings.py" %}
{%- else %}
{%- set app = salt['pillar.get']('horizon:server') %}
{%- endif %}
# OpenStack Dashboard configuration.
HORIZON_CONFIG = {
@ -30,15 +30,19 @@ HORIZON_CONFIG = {
SESSION_TIMEOUT = 3600 * 24
{%- if app.theme is defined or app.plugin.horizon_theme is defined %}
{%- if app.theme is defined %}
CUSTOM_THEME_PATH = 'dashboards/theme/static/themes/{{ app.theme }}'
{%- elif app.plugin.horizon_theme.theme_name is defined %}
# Enable custom theme if it is present.
try:
from openstack_dashboard.enabled._99_horizon_theme import CUSTOM_THEME_PATH
except ImportError:
pass
{%- endif %}
{%- endif %}
INSTALLED_APPS = (
{%- for plugin_name, plugin in app.plugin.iteritems() %}
{%- if not plugin_name == 'horizon_theme' %}
'{{ plugin.app }}',
{%- endif %}
{%- endfor %}
'helpdesk_auth',
'horizon_contrib',
'redactor',
'openstack_dashboard',
'django.contrib.contenttypes',
'django.contrib.auth',
@ -58,6 +62,14 @@ REDACTOR_UPLOAD = 'uploads/'
ROOT_URLCONF = 'helpdesk_dashboard.url_overrides'
{% include "horizon/files/horizon_settings/_keystone_settings.py" %}
{% include "horizon/files/horizon_settings/_local_settings.py" %}
AUTHENTICATION_BACKENDS = ('helpdesk_auth.backend.HelpdeskBackend',)
AUTHENTICATION_URLS = ['helpdesk_auth.urls']
API_RESULT_PAGE_SIZE = 25
{% include "horizon/files/horizon_settings/_horizon_settings.py" %}

View File

@ -1,6 +1,6 @@
{% set server = salt['grains.filter_by']({
'Debian': {
'pkgs': ['openstack-dashboard', 'python-lesscpy', 'python-memcache'],
'pkgs': ['apache2', 'openstack-dashboard', 'python-lesscpy', 'python-memcache'],
'pkgs_multi': ['python-memcache', 'python-psycopg2', 'python-imaging',
'python-docutils', 'python-simplejson', 'build-essential',
'libxslt1-dev', 'libxml2-dev', 'libffi-dev', 'libssl-dev',
@ -16,7 +16,7 @@
'cache': {'host': '127.0.0.1', 'port': 11211}
},
'RedHat': {
'pkgs': ['openstack-dashboard', 'python-lesscpy', 'python-memcached'],
'pkgs': ['httpd', 'openstack-dashboard', 'python-lesscpy', 'python-memcached'],
'pkgs_multi': ['python-memcached', 'python-psycopg2', 'python-pillow',
'python-docutils', 'python-simplejson', 'libxslt-devel', 'gcc',
'libxml2-devel', 'libffi-devel', 'openssl-devel',

View File

@ -5,14 +5,6 @@ horizon_packages:
pkg.installed:
- names: {{ server.pkgs }}
{%- if grains.os == "Ubuntu" %}
horizon_ubuntu_theme_absent:
pkg.purged:
- name: openstack-dashboard-ubuntu-theme
{%- endif %}
horizon_config:
file.managed:
- name: {{ server.config }}
@ -23,10 +15,6 @@ horizon_config:
- group: root
- require:
- pkg: horizon_packages
{%- if grains.os == "Ubuntu" %}
- pkg: horizon_ubuntu_theme_absent
{%- endif %}
horizon_apache_port_config:
file.managed:
@ -52,6 +40,14 @@ horizon_apache_config:
- require:
- pkg: horizon_packages
/etc/apache2/conf-enabled/openstack-dashboard.conf:
file.symlink:
- target: /etc/apache2/conf-available/openstack-dashboard.conf
apache_enable_wsgi:
apache_module.enable:
- name: wsgi
horizon_services:
service.running:
- name: {{ server.service }}
@ -77,28 +73,4 @@ horizon_log_file:
- require:
- file: horizon_log_dir
{#
{%- if server.get('api_versions', {}).identity is defined %}
horizon_keystone_policy:
file.managed:
- name: /usr/share/openstack-dashboard/openstack_dashboard/conf/keystone_policy.json
{%- if server.get('api_versions', {}).identity == '3' %}
- source: salt://horizon/files/policy/{{ server.version }}-keystone-v3.json
{%- else %}
- source: salt://horizon/files/policy/{{ server.version }}-keystone-v2.json
{%- endif %}
{%- endif %}
{%- if server.logging is defined %}
# TODO: package this
raven:
pip.installed:
- name: raven >= 4
{%- endif %}
#}
{%- endif %}