Browse Source

Merge "Remove legacy_endpoint_id and enabled from service catalog"

Jenkins 5 years ago
parent
commit
6f4cade9ed

+ 3
- 0
keystone/catalog/backends/sql.py View File

@@ -286,6 +286,9 @@ class Catalog(catalog.Driver):
286 286
         def make_v3_endpoint(endpoint):
287 287
             endpoint = endpoint.to_dict()
288 288
             del endpoint['service_id']
289
+            del endpoint['legacy_endpoint_id']
290
+            del endpoint['enabled']
291
+
289 292
             endpoint['url'] = core.format_url(endpoint['url'], d)
290 293
             return endpoint
291 294
 

+ 2
- 0
keystone/contrib/endpoint_filter/backends/catalog_sql.py View File

@@ -50,6 +50,8 @@ class EndpointFilterCatalog(sql.Catalog):
50 50
                     self.get_service(service_id))
51 51
                 service = services[service_id]
52 52
                 del endpoint['service_id']
53
+                del endpoint['enabled']
54
+                del endpoint['legacy_endpoint_id']
53 55
                 endpoint['url'] = catalog_core.format_url(
54 56
                     endpoint['url'], d)
55 57
                 # populate filtered endpoints

+ 9
- 0
keystone/tests/test_v3.py View File

@@ -581,6 +581,15 @@ class RestfulTestCase(tests.SQLDriverOverrides, rest.RestfulTestCase):
581 581
 
582 582
         if require_catalog:
583 583
             self.assertIn('catalog', token)
584
+
585
+            if isinstance(token['catalog'], list):
586
+                # only test JSON
587
+                for service in token['catalog']:
588
+                    for endpoint in service['endpoints']:
589
+                        self.assertNotIn('enabled', endpoint)
590
+                        self.assertNotIn('legacy_endpoint_id', endpoint)
591
+                        self.assertNotIn('service_id', endpoint)
592
+
584 593
             # sub test for the OS-EP-FILTER extension enabled
585 594
             if endpoint_filter:
586 595
                 # verify the catalog hs no more than the endpoints

Loading…
Cancel
Save