Merge "Filter deprecated versions out"

This commit is contained in:
Zuul 2018-05-18 01:40:58 +00:00 committed by Gerrit Code Review
commit e328fafccf
3 changed files with 24 additions and 1 deletions

View File

@ -50,6 +50,12 @@ SERVICE_NAMES = {
# depending on whether they get discovered as supported. Services with only one
# version don't need to be here, neither do service versions that are not
# configurable in tempest.conf
# TODO(mkopec) since Queens, there are only image v2, identity v3 and
# volume v3 versions, however, for backward compatibility let's keep
# all versions here
# TODO(mkopec) Move this information about supported versions somewhere else,
# so that we don't have to have this global object, for example move the
# information to service classes
SERVICE_VERSIONS = {
'image': {'supported_versions': ['v1', 'v2'], 'catalog': 'image'},
'identity': {'supported_versions': ['v2', 'v3'], 'catalog': 'identity'},

View File

@ -83,7 +83,11 @@ class VersionedService(Service):
self.versions = self.deserialize_versions(body)
def deserialize_versions(self, body):
return map(lambda x: x['id'], body['versions'])
versions = []
for version in body['versions']:
if version['status'] != "DEPRECATED":
versions.append(version)
return map(lambda x: x['id'], versions)
def no_port_cut_url(self):
# if there is no port defined, cut the url from version to the end

View File

@ -116,6 +116,19 @@ class BaseServiceTest(base.BaseTestCase):
"values": [
{"id": 'v2.0'}
]
}, {
"status": "DEPRECATED",
"updated": "2013-07-23T11:33:21Z",
"links": [{
"href": "http://10.200.16.10:8774/v1/",
"rel": "self"
}],
"min_version": "1.0",
"version": "1.0",
"id": "v1.0",
"values": [
{"id": 'v1.0'}
]
}]
}
)