De-client-ify Service List

Change-Id: I22149f4dd2d63b0f3b809015f4e9633f20a0a1d0
This commit is contained in:
Samuel de Medeiros Queiroz 2017-07-10 12:19:42 -04:00
parent a8843fa797
commit bda65e7265
2 changed files with 8 additions and 9 deletions

View File

@ -127,11 +127,6 @@ class MachineSetProvision(task_manager.Task):
return client.ironic_client.node.set_provision_state(**self.args)
class ServiceList(task_manager.Task):
def main(self, client):
return client.keystone_client.services.list()
class ServiceUpdate(task_manager.Task):
def main(self, client):
return client.keystone_client.services.update(**self.args)

View File

@ -805,10 +805,14 @@ class OperatorCloud(openstackcloud.OpenStackCloud):
:raises: ``OpenStackCloudException`` if something goes wrong during the
openstack API call.
"""
# TODO(mordred) When this changes to REST, force interface=admin
# in the adapter call
with _utils.shade_exceptions():
services = self.manager.submit_task(_tasks.ServiceList())
if self.cloud_config.get_api_version('identity').startswith('2'):
url, key = '/OS-KSADM/services', 'OS-KSADM:services'
else:
url, key = '/services', 'services'
data = self._identity_client.get(
url, endpoint_filter={'interface': 'admin'},
error_message="Failed to list services")
services = self._get_and_munchify(key, data)
return _utils.normalize_keystone_services(services)
def search_services(self, name_or_id=None, filters=None):