Fix rate semaphore for keystoneclient

When using keystoneclient sessions, the new parameter is not available
and breaks the keystoneclient unit tests[1]. Only use the semaphore
kwarg when using keystoneauth sessions.

[1] https://review.openstack.org/640953

Change-Id: I0cc7f2514e143ec532d8fb895618f7cf1fea9cc3
This commit is contained in:
Colleen Murphy 2019-03-05 10:00:46 +01:00
parent 0828f7048e
commit 7b74cc9adb

View File

@ -217,6 +217,8 @@ class Adapter(object):
kwargs.setdefault('client_name', self.client_name)
if self.client_version:
kwargs.setdefault('client_version', self.client_version)
if self._rate_semaphore:
kwargs.setdefault('rate_semaphore', self._rate_semaphore)
else:
warnings.warn('Using keystoneclient sessions has been deprecated. '
@ -232,8 +234,6 @@ class Adapter(object):
if self.raise_exc is not None:
kwargs.setdefault('raise_exc', self.raise_exc)
kwargs.setdefault('rate_semaphore', self._rate_semaphore)
return self.session.request(url, method, **kwargs)
def get_token(self, auth=None):