File 0002-DEFAULT_SERVICE_REGIONS.patch of Package openstack-dashboard
From d8f95c64d64c1675dfbc32122cf1e418f1477a6c Mon Sep 17 00:00:00 2001
From: Timur Sufiev <tsufiev@mirantis.com>
Date: Mon, 12 Oct 2015 10:07:47 -0700
Subject: [PATCH] Introduce DEFAULT_SERVICE_REGIONS
It should be together with related change in django-openstack-auth, if
specified it will change the default service region calculation: it
will be taken from this setting (on a per-endpont basis) instead of a
value stored in cookies. This value is still checked for sanity,
i.e. it should be present in Keystone service catalog.
Change-Id: I7e36f766870793f3e8fc391a06f0ee49deaa7add
Related-Bug: #1506825
Closes-Bug: #1703390
---
diff --git a/doc/source/topics/settings.rst b/doc/source/topics/settings.rst
--- a/doc/source/topics/settings.rst
+++ b/doc/source/topics/settings.rst
@@ -554,6 +554,23 @@ This option is now marked as "deprecated
a later release. Themes are now controlled by AVAILABLE_THEMES. We suggest
changing your custom theme settings to use this option instead.
+``DEFAULT_SERVICE_REGIONS``
+---------------------------
+
+.. versionadded:: 12.0.0(Pike)
+
+Default: ``{}``
+
+The default service region is set on a per-endpoint basis, meaning that once
+the user logs into some Keystone endpoint, if a default service region is
+defined for it in this setting and exists within Keystone catalog, it will be
+set as the initial service region in this endpoint. By default it is an empty
+dictionary because upstream can neither predict service region names in a
+specific deployment, nor tell whether this behavior is desired. The key of the
+dictionary is a full url of a Keystone endpoint with version suffix, the value
+is a region name.
+
+
``DEFAULT_THEME_PATH``
----------------------
diff --git a/openstack_dashboard/local/local_settings.py.example b/openstack_dashboard/local/local_settings.py.example
--- a/openstack_dashboard/local/local_settings.py.example
+++ b/openstack_dashboard/local/local_settings.py.example
@@ -177,6 +177,13 @@ OPENSTACK_HOST = "127.0.0.1"
OPENSTACK_KEYSTONE_URL = "http://%s:5000/v2.0" % OPENSTACK_HOST
OPENSTACK_KEYSTONE_DEFAULT_ROLE = "_member_"
+# For setting the default service region on a per-endpoint basis. Note that the
+# default value for this setting is {}, and below is just an example of how it
+# should be specified.
+#DEFAULT_SERVICE_REGIONS = {
+# OPENSTACK_KEYSTONE_URL: 'RegionOne'
+#}
+
# Enables keystone web single-sign-on if set to True.
#WEBSSO_ENABLED = False
diff --git a/releasenotes/notes/introduce_default_service_regions_config-26a41e0d06582d7a.yaml b/releasenotes/notes/introduce_default_service_regions_config-26a41e0d06582d7a.yaml
new file mode 100644
index 0000000..657f253
--- /dev/null
+++ b/releasenotes/notes/introduce_default_service_regions_config-26a41e0d06582d7a.yaml
@@ -0,0 +1,5 @@
+---
+features:
+ - Added a new ``DEFAULT_SERVICE_REGIONS`` setting into local_settings.py.
+ If a value of this is specified, it will be the default region to use when
+ logging into the dashboard, instead of the value stored in cookies.
--
1.9.1