Support for section AVAILABLE_REGIONS added
This section generate dropdown menu in horizon and
user can switch between regions.
Change-Id: I76c19e610dfae6347339468496c79a9840b01ec7
diff --git a/horizon/files/horizon_settings/_keystone_settings.py b/horizon/files/horizon_settings/_keystone_settings.py
index 686eb92..299cef8 100644
--- a/horizon/files/horizon_settings/_keystone_settings.py
+++ b/horizon/files/horizon_settings/_keystone_settings.py
@@ -33,6 +33,15 @@
# ('http://cluster2.example.com:5000/v2.0', 'cluster2'),
# ]
+{%- if app.regions is defined %}
+AVAILABLE_REGIONS = [
+{%- for region in app.regions %}
+ ('{{ region.address }}', '{{ region.name }}'),
+{%- endfor %}
+]
+{%- endif %}
+
+
OPENSTACK_HOST = "{{ app.identity.host }}"
{%- if app.get('api_versions', {}).identity is defined and app.get('api_versions', {}).identity != 2 %}
OPENSTACK_KEYSTONE_URL = "http{% if app.identity.encryption == 'ssl' %}s{% endif %}://%s:{{ app.identity.port }}/v{{ app.api_versions.identity }}" % OPENSTACK_HOST
diff --git a/tests/pillar/cluster.sls b/tests/pillar/cluster.sls
index 7240cdd..1f640cd 100644
--- a/tests/pillar/cluster.sls
+++ b/tests/pillar/cluster.sls
@@ -27,6 +27,11 @@
api_version: 2
encryption: ssl
endpoint_type: publicURL
+ regions:
+ - name: cluster1
+ address: http://cluster1.example.com:5000/v2.0
+ - name: cluster2
+ address: http://cluster2.example.com:5000/v2.0
websso:
login_url: "WEBROOT + 'auth/login/'"
logout_url: "WEBROOT + 'auth/logout/'"
diff --git a/tests/pillar/single.sls b/tests/pillar/single.sls
index d06d73d..0dbc3cb 100644
--- a/tests/pillar/single.sls
+++ b/tests/pillar/single.sls
@@ -25,6 +25,11 @@
encryption: ssl
api_version: 2
endpoint_type: publicURL
+ regions:
+ - name: cluster1
+ address: http://cluster1.example.com:5000/v2.0
+ - name: cluster2
+ address: http://cluster2.example.com:5000/v2.0
websso:
login_url: "WEBROOT + 'auth/login/'"
logout_url: "WEBROOT + 'auth/logout/'"