Add more configurable options
- added configurable option for disabling autocomplete in horizon forms [security request]
- added configurable option for disabling port verification [horizon crushes when you have no ports attached to some VM in project and try to associate a floating ip to another VM in this project via UI]
diff --git a/.kitchen.yml b/.kitchen.yml
index 00b9cae..c024b42 100644
--- a/.kitchen.yml
+++ b/.kitchen.yml
@@ -13,7 +13,7 @@
log_level: error
formula: horizon
grains:
- noservices: True
+ noservices: False
state_top:
base:
"*":
diff --git a/horizon/files/horizon_settings/_horizon_config.py b/horizon/files/horizon_settings/_horizon_config.py
new file mode 100644
index 0000000..fcd6503
--- /dev/null
+++ b/horizon/files/horizon_settings/_horizon_config.py
@@ -0,0 +1,23 @@
+{#- TODO (msenin): replace this construction on iteration by pillar data #}
+
+{%- set _horizon_config = app.get('horizon_config', {}) %}
+
+
+HORIZON_CONFIG = {
+ 'user_home': 'openstack_dashboard.views.get_user_home',
+ 'ajax_queue_limit': 10,
+ 'auto_fade_alerts': {
+ 'delay': 3000,
+ 'fade_duration': 1500,
+ 'types': ['alert-success', 'alert-info']
+ },
+ 'help_url': "http://docs.openstack.org",
+ 'exceptions': {'recoverable': exceptions.RECOVERABLE,
+ 'not_found': exceptions.NOT_FOUND,
+ 'unauthorized': exceptions.UNAUTHORIZED},
+ 'modal_backdrop': 'static',
+ 'angular_modules': [],
+ 'js_files': [],
+ 'js_spec_files': [],
+ 'password_autocomplete': "{{ _horizon_config.get('password_autocomplete', 'on') }}"
+}
diff --git a/horizon/files/horizon_settings/_neutron_settings.py b/horizon/files/horizon_settings/_neutron_settings.py
index c714b7c..cc7b111 100644
--- a/horizon/files/horizon_settings/_neutron_settings.py
+++ b/horizon/files/horizon_settings/_neutron_settings.py
@@ -13,6 +13,9 @@
# The OPENSTACK_NEUTRON_NETWORK settings can be used to enable optional
# services provided by neutron. Options currenly available are load
# balancer service, security groups, quotas, VPN service.
+
+{%- set neutron_data = app.get('openstack_neutron_network', {}) %}
+
OPENSTACK_NEUTRON_NETWORK = {
'enable_lb': True,
'enable_firewall': False,
@@ -23,6 +26,8 @@
# configured via the dashboard. When using specific plugins the
# profile_support can be turned on if needed.
'profile_support': None,
+ 'enable_fip_topology_check': {{ neutron_data.get('enable_fip_topology_check', True) }},
+
#'profile_support': 'cisco',
}
diff --git a/horizon/files/local_settings/liberty_settings.py b/horizon/files/local_settings/liberty_settings.py
index fc422f8..04705b6 100644
--- a/horizon/files/local_settings/liberty_settings.py
+++ b/horizon/files/local_settings/liberty_settings.py
@@ -10,24 +10,9 @@
{%- set app = salt['pillar.get']('horizon:server') %}
{%- endif %}
-HORIZON_CONFIG = {
- 'user_home': 'openstack_dashboard.views.get_user_home',
- 'ajax_queue_limit': 10,
- 'auto_fade_alerts': {
- 'delay': 3000,
- 'fade_duration': 1500,
- 'types': ['alert-success', 'alert-info']
- },
- 'help_url': "http://docs.openstack.org",
- 'exceptions': {'recoverable': exceptions.RECOVERABLE,
- 'not_found': exceptions.NOT_FOUND,
- 'unauthorized': exceptions.UNAUTHORIZED},
- 'modal_backdrop': 'static',
- 'angular_modules': [],
- 'js_files': [],
- 'js_spec_files': [],
- 'password_autocomplete': 'on'
-}
+{% include "horizon/files/horizon_settings/_horizon_config.py" %}
+
+
{%- if app.theme is defined or (app.plugin is defined and app.plugin.horizon_theme is defined) %}
{%- if app.theme is defined %}
CUSTOM_THEME_PATH = 'themes/{{ app.theme }}'
diff --git a/tests/pillar/cluster.sls b/tests/pillar/cluster.sls
index 61a80d2..8a5c582 100644
--- a/tests/pillar/cluster.sls
+++ b/tests/pillar/cluster.sls
@@ -32,6 +32,11 @@
websso_choices:
- saml2
- oidc
+ horizon_config:
+ password_autocomplete: off
+ openstack_neutron_network:
+ enable_fip_topology_check: False
+
haproxy:
proxy:
listens:
diff --git a/tests/pillar/single.sls b/tests/pillar/single.sls
index bbb2360..9352c62 100644
--- a/tests/pillar/single.sls
+++ b/tests/pillar/single.sls
@@ -30,3 +30,7 @@
websso_choices:
- saml2
- oidc
+ horizon_config:
+ password_autocomplete: off
+ openstack_neutron_network:
+ enable_fip_topology_check: False
\ No newline at end of file