diff options
| author | Monty Taylor <mordred@inaugust.com> | 2018-07-23 15:53:53 -0500 |
|---|---|---|
| committer | Monty Taylor <mordred@inaugust.com> | 2018-10-19 07:55:41 -0500 |
| commit | dfd37a2e6e49fc547e7a2e8f7840561ece8ff46f (patch) | |
| tree | 9870a02645c2a529eabae2fd0b3c5bbb28dccded /openstackclient/common | |
| parent | 02f492ae4cc52ed2642f42bc0c1e5e417ebfe527 (diff) | |
| download | python-openstackclient-dfd37a2e6e49fc547e7a2e8f7840561ece8ff46f.tar.gz | |
Make use of keystoneauth service-type filtering for versions
The first version of the versions show command does client-side
service-type filtering, which while functional, causes many more API
calls than needed. Now that keystoneauth supports the filtering at the
source, use it.
Change-Id: I57c49e67f9cb285a5f5bc19ec53a42d10de9f0da
Diffstat (limited to 'openstackclient/common')
| -rw-r--r-- | openstackclient/common/versions.py | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/openstackclient/common/versions.py b/openstackclient/common/versions.py index 6a93d300..3c267bfe 100644 --- a/openstackclient/common/versions.py +++ b/openstackclient/common/versions.py @@ -14,7 +14,6 @@ """Versions Action Implementation""" -import os_service_types from osc_lib.command import command from openstackclient.i18n import _ @@ -67,7 +66,8 @@ class ShowVersions(command.Lister): session = self.app.client_manager.session version_data = session.get_all_version_data( interface=interface, - region_name=parsed_args.region_name) + region_name=parsed_args.region_name, + service_type=parsed_args.service) columns = [ "Region Name", @@ -83,22 +83,10 @@ class ShowVersions(command.Lister): if status: status = status.upper() - service = parsed_args.service - if service: - # Normalize service type argument to official type - service_type_manager = os_service_types.ServiceTypes() - service = service_type_manager.get_service_type(service) - versions = [] for region_name, interfaces in version_data.items(): for interface, services in interfaces.items(): for service_type, service_versions in services.items(): - if service and service != service_type: - # TODO(mordred) Once there is a version of - # keystoneauth that can do this filtering - # before making all the discovery calls, switch - # to that. - continue for data in service_versions: if status and status != data['status']: continue |
