Filter endpoints in service catalog by type
When I originally added support for using Keystone for authenticating to Craton, I made a mistake in setting a keyword argument of "service_type". The correct way to use keystoneauth1 to filter the endpoint by service type is to specify an endpoint filter dictionary that specifies the service_type as "fleet_management" Change-Id: I6dcdde351d5e2051105df904b2d936abafbcc231
This commit is contained in:
parent
5e9ee807dd
commit
4c7569df22
@ -199,13 +199,14 @@ class Session(object):
|
||||
def _request(self, **kwargs):
|
||||
"""Make a request and optionally remove the Keystone parameters."""
|
||||
# Default the Keystone specific arguments
|
||||
kwargs.setdefault('service_type', 'fleet_management')
|
||||
kwargs.setdefault('endpoint_filter',
|
||||
{'service_type': 'fleet_management'})
|
||||
try:
|
||||
response = self._session.request(**kwargs)
|
||||
except TypeError:
|
||||
# If we're using a Session object that doesn't support Keystone
|
||||
# parameters, we need to remove them and retry.
|
||||
kwargs.pop('service_type')
|
||||
kwargs.pop('endpoint_filter')
|
||||
response = self._session.request(**kwargs)
|
||||
return response
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user