Merge "Remove legacy_endpoint_id and enabled from service catalog"
This commit is contained in:
@@ -286,6 +286,9 @@ class Catalog(catalog.Driver):
|
||||
def make_v3_endpoint(endpoint):
|
||||
endpoint = endpoint.to_dict()
|
||||
del endpoint['service_id']
|
||||
del endpoint['legacy_endpoint_id']
|
||||
del endpoint['enabled']
|
||||
|
||||
endpoint['url'] = core.format_url(endpoint['url'], d)
|
||||
return endpoint
|
||||
|
||||
|
||||
@@ -50,6 +50,8 @@ class EndpointFilterCatalog(sql.Catalog):
|
||||
self.get_service(service_id))
|
||||
service = services[service_id]
|
||||
del endpoint['service_id']
|
||||
del endpoint['enabled']
|
||||
del endpoint['legacy_endpoint_id']
|
||||
endpoint['url'] = catalog_core.format_url(
|
||||
endpoint['url'], d)
|
||||
# populate filtered endpoints
|
||||
|
||||
@@ -581,6 +581,15 @@ class RestfulTestCase(tests.SQLDriverOverrides, rest.RestfulTestCase):
|
||||
|
||||
if require_catalog:
|
||||
self.assertIn('catalog', token)
|
||||
|
||||
if isinstance(token['catalog'], list):
|
||||
# only test JSON
|
||||
for service in token['catalog']:
|
||||
for endpoint in service['endpoints']:
|
||||
self.assertNotIn('enabled', endpoint)
|
||||
self.assertNotIn('legacy_endpoint_id', endpoint)
|
||||
self.assertNotIn('service_id', endpoint)
|
||||
|
||||
# sub test for the OS-EP-FILTER extension enabled
|
||||
if endpoint_filter:
|
||||
# verify the catalog hs no more than the endpoints
|
||||
|
||||
Reference in New Issue
Block a user