Merge "Remove legacy_endpoint_id and enabled from service catalog"

This commit is contained in:
Jenkins
2014-04-04 19:45:30 +00:00
committed by Gerrit Code Review
3 changed files with 14 additions and 0 deletions
+3
View File
@@ -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
+9
View File
@@ -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