De-client-ify Endpoint List
Change-Id: If711f71ec05a03e5613cf25849c7b6a68f23eb55
This commit is contained in:
parent
eb28fa5751
commit
179430c986
|
@ -107,11 +107,6 @@ class EndpointUpdate(task_manager.Task):
|
|||
return client.keystone_client.endpoints.update(**self.args)
|
||||
|
||||
|
||||
class EndpointList(task_manager.Task):
|
||||
def main(self, client):
|
||||
return client.keystone_client.endpoints.list()
|
||||
|
||||
|
||||
class RoleAssignmentList(task_manager.Task):
|
||||
def main(self, client):
|
||||
return client.keystone_client.role_assignments.list(**self.args)
|
||||
|
|
|
@ -1011,14 +1011,13 @@ class OperatorCloud(openstackcloud.OpenStackCloud):
|
|||
:raises: ``OpenStackCloudException``: if something goes wrong during
|
||||
the openstack API call.
|
||||
"""
|
||||
# NOTE(SamYaple): With keystone v3 we can filter directly via the
|
||||
# the keystone api, but since the return of all the endpoints even in
|
||||
# large environments is small, we can continue to filter in shade just
|
||||
# like the v2 api.
|
||||
# TODO(mordred) When this changes to REST, force interface=admin
|
||||
# in the adapter call
|
||||
with _utils.shade_exceptions("Failed to list endpoints"):
|
||||
endpoints = self.manager.submit_task(_tasks.EndpointList())
|
||||
# Force admin interface if v2.0 is in use
|
||||
v2 = self._is_client_version('identity', 2)
|
||||
kwargs = {'endpoint_filter': {'interface': 'admin'}} if v2 else {}
|
||||
|
||||
data = self._identity_client.get(
|
||||
'/endpoints', error_message="Failed to list endpoints", **kwargs)
|
||||
endpoints = self._get_and_munchify('endpoints', data)
|
||||
|
||||
return endpoints
|
||||
|
||||
|
@ -1040,6 +1039,10 @@ class OperatorCloud(openstackcloud.OpenStackCloud):
|
|||
:raises: ``OpenStackCloudException``: if something goes wrong during
|
||||
the openstack API call.
|
||||
"""
|
||||
# NOTE(SamYaple): With keystone v3 we can filter directly via the
|
||||
# the keystone api, but since the return of all the endpoints even in
|
||||
# large environments is small, we can continue to filter in shade just
|
||||
# like the v2 api.
|
||||
endpoints = self.list_endpoints()
|
||||
return _utils._filter_list(endpoints, id, filters)
|
||||
|
||||
|
|
Loading…
Reference in New Issue