From 9e01ff316f7814e7b81362b49f7cbb8259d18979 Mon Sep 17 00:00:00 2001 From: Steve Lewis Date: Fri, 24 Apr 2015 10:52:07 -0700 Subject: [PATCH] Update Horizon configuration Additional feature changes have been made since we last updated our template file. This brings our configuration file in line with the example. During Liberty, one of these changes related to execeptions will likely need to be revised but for now this is the correct way of handling them. Change-Id: I81a0fe7503c4ca93eb13a6001805639649cabdfb Closes-Bug: 1448241 Related-Bug: 1433395 Related-Bug: 1440903 Related-Bug: 1439905 Related-Bug: 1439906 --- .../templates/horizon_local_settings.py.j2 | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/playbooks/roles/os_horizon/templates/horizon_local_settings.py.j2 b/playbooks/roles/os_horizon/templates/horizon_local_settings.py.j2 index 6a33653975..964ffd7c08 100644 --- a/playbooks/roles/os_horizon/templates/horizon_local_settings.py.j2 +++ b/playbooks/roles/os_horizon/templates/horizon_local_settings.py.j2 @@ -1,6 +1,8 @@ import os from django.utils.translation import ugettext_lazy as _ +from openstack_dashboard import exceptions + DEBUG = {{ debug }} TEMPLATE_DEBUG = DEBUG COMPRESS_OFFLINE = True @@ -71,6 +73,9 @@ HORIZON_CONFIG = { 'types': ['alert-success', 'alert-info'] }, 'help_url': "{{ horizon_help_url|default('http://docs.openstack.org') }}", + 'exceptions': {'recoverable': exceptions.RECOVERABLE, + 'not_found': exceptions.NOT_FOUND, + 'unauthorized': exceptions.UNAUTHORIZED}, 'modal_backdrop': 'static', 'angular_modules': [], 'js_files': [], @@ -364,6 +369,7 @@ ENFORCE_PASSWORD_CHECK = {{ horizon_enforce_password_check }} # 'image': 'glance_policy.json', # 'orchestration': 'heat_policy.json', # 'network': 'neutron_policy.json', +# 'telemetry': 'ceilometer_policy.json', #} # Trove user and database extension support. By default support for @@ -621,3 +627,24 @@ SECURITY_GROUP_RULES = { # auth_token middleware are using. Allowed values are the # algorithms supported by Python's hashlib library. #OPENSTACK_TOKEN_HASH_ALGORITHM = 'md5' + +# AngularJS requires some settings to be made available to +# the client side. Some settings are required by in-tree / built-in horizon +# features. These settings must be added to REST_API_REQUIRED_SETTINGS in the +# form of ['SETTING_1','SETTING_2'], etc. +# +# You may remove settings from this list for security purposes, but do so at +# the risk of breaking a built-in horizon feature. These settings are required +# for horizon to function properly. Only remove them if you know what you +# are doing. These settings may in the future be moved to be defined within +# the enabled panel configuration. +# You should not add settings to this list for out of tree extensions. +# See: https://wiki.openstack.org/wiki/Horizon/RESTAPI +REST_API_REQUIRED_SETTINGS = ['OPENSTACK_HYPERVISOR_FEATURES'] + +# Additional settings can be made available to the client side for +# extensibility by specifying them in REST_API_ADDITIONAL_SETTINGS +# !! Please use extreme caution as the settings are transferred via HTTP/S +# and are not encrypted on the browser. This is an experimental API and +# may be deprecated in the future without notice. +#REST_API_ADDITIONAL_SETTINGS = []