Merge "Make use of keystoneauth service-type filtering for versions"

This commit is contained in:
Zuul 2018-11-02 18:48:06 +00:00 committed by Gerrit Code Review
commit 594eeae2de
3 changed files with 4 additions and 16 deletions

View File

@ -38,7 +38,7 @@ jmespath==0.9.0
jsonpatch==1.16
jsonpointer==1.13
jsonschema==2.6.0
keystoneauth1==3.4.0
keystoneauth1==3.6.2
kombu==4.0.0
linecache2==1.0.0
MarkupSafe==1.0

View File

@ -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

View File

@ -6,7 +6,7 @@ six>=1.10.0 # MIT
Babel!=2.4.0,>=2.3.4 # BSD
cliff!=2.9.0,>=2.8.0 # Apache-2.0
keystoneauth1>=3.4.0 # Apache-2.0
keystoneauth1>=3.6.2 # Apache-2.0
openstacksdk>=0.17.0 # Apache-2.0
osc-lib>=1.10.0 # Apache-2.0
oslo.i18n>=3.15.3 # Apache-2.0