Fix the missing region name information for Keystone client

When using several regions, Rally's Keystone client does not use
the region endpoint specified in the context. So we added
the region name used in credentials to be able to connect
to the correct region endpoint

Change-Id: I441aee8ffb82963396d40405ea740276edc7dfe5
Co-Authored-By: rcherrueau <Ronan-Alexandre.Cherrueau@inria.fr>
This commit is contained in:
Marie-Donnie 2018-04-24 15:19:14 +02:00 committed by Andrey Kurilin
parent 81ab47030e
commit 238be7cc0a
2 changed files with 11 additions and 3 deletions

View File

@ -24,6 +24,12 @@ Added
* Added neutron trunk scenarios
Fixed
~~~~~
* Do not ignore ``region_name`` from environment specification while
initializing keystone client.
[1.3.0] - 2018-10-08
--------------------
@ -151,8 +157,6 @@ Fixed
valid name for the context (if there is no other ``api_versions`` contexts
for other platforms, but the case of name conflict is covered by another
check).
* The endpoint_type defined in environment specification/deployment
configuration is the endpoint interface for gnocchi.
[1.0.0] - 2018-03-28
--------------------

View File

@ -368,10 +368,14 @@ class Keystone(OSClient):
# keystoneclient chooses).
version = self.choose_version(version)
sess = self.get_session(version=version)[0]
sess, auth_plugin = self.get_session(version=version)
kw = {"version": version, "session": sess,
"timeout": CONF.openstack_client_http_timeout}
# check for keystone version
if auth_plugin._user_domain_name and self.credential.region_name:
kw["region_name"] = self.credential.region_name
if keystoneclient.__version__[0] == "1":
# NOTE(andreykurilin): let's leave this hack for envs which uses
# old(<2.0.0) keystoneclient version. Upstream fix: