add region_name to auth plugin parameters

If endpoint is not specified, then auth plugin will request to keystone
to get target endpoint, however, we don't provide region name for it,
this will cause critical issue in multiple region scenario.

Change-Id: I99ceafec25072988435018ca1affbd778ca9b22f
Closes-Bug: #1439553
(cherry picked from commit bfb6d122fa)
This commit is contained in:
ZhiQiang Fan 2015-04-02 16:10:25 +08:00 committed by gordon chung
parent 7d7e4b8782
commit e1439f5c72
2 changed files with 3 additions and 0 deletions

View File

@ -179,6 +179,7 @@ class AuthPlugin(auth.BaseAuthPlugin):
'insecure': strutils.bool_from_string(
self.opts.get('insecure')),
'endpoint_type': self.opts.get('endpoint_type'),
'region_name': self.opts.get('region_name'),
}
# retrieve session
@ -315,6 +316,7 @@ def get_auth_plugin(endpoint, **kwargs):
token=kwargs.get('token'),
endpoint_type=kwargs.get('endpoint_type'),
insecure=kwargs.get('insecure'),
region_name=kwargs.get('region_name'),
cacert=kwargs.get('cacert'),
tenant_id=kwargs.get('project_id') or kwargs.get('tenant_id'),
endpoint=endpoint,

View File

@ -81,6 +81,7 @@ class ClientTest(utils.BaseTestCase):
'service_type': None,
'token': '1234',
'endpoint_type': None,
'region_name': None,
'auth_url': 'http://no.where',
'tenant_id': None,
'insecure': None,