Remove legacy_endpoint_id and enabled from service catalog

Those two fields are for internal use, and should not be in the token.

The token size was expanding past the threshold where it could
be passed between a wsgi process and Apache HTTPD, even for
a basic, devstack sized catalog.  This reduces the size.

Change-Id: Ic8eb70e519a8a35fd05b497d917f9889e82b6e7f
Closes-Bug: 1302075
This commit is contained in:
Adam Young 2014-04-03 13:21:23 -04:00 committed by Dolph Mathews
parent 9c9b13bbe1
commit 717917c576
3 changed files with 14 additions and 0 deletions

View File

@ -292,6 +292,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

View File

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

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