Browse Source

Merge "Filter placement API endpoint by type too" into stable/rocky

changes/98/679198/1
Zuul 3 weeks ago
parent
commit
c618229f3c

+ 1
- 0
neutron/services/segments/placement_client.py View File

@@ -39,6 +39,7 @@ class PlacementAPIClient(object):
39 39
     """Client class for placement ReST API."""
40 40
 
41 41
     ks_filter = {'service_type': 'placement',
42
+                 'interface': cfg.CONF.placement.endpoint_type,
42 43
                  'region_name': cfg.CONF.placement.region_name}
43 44
 
44 45
     def __init__(self):

+ 7
- 0
neutron/tests/unit/extensions/test_segment.py View File

@@ -2364,6 +2364,7 @@ class PlacementAPIClientTestCase(base.DietTestCase):
2364 2364
         self.mock_request.assert_called_once_with(
2365 2365
                 expected_url, 'POST',
2366 2366
                 endpoint_filter={'region_name': mock.ANY,
2367
+                                 'interface': 'public',
2367 2368
                                  'service_type': 'placement'},
2368 2369
                 json=expected_payload)
2369 2370
 
@@ -2374,6 +2375,7 @@ class PlacementAPIClientTestCase(base.DietTestCase):
2374 2375
         self.mock_request.assert_called_once_with(
2375 2376
                 expected_url, 'DELETE',
2376 2377
                 endpoint_filter={'region_name': mock.ANY,
2378
+                                 'interface': 'public',
2377 2379
                                  'service_type': 'placement'})
2378 2380
 
2379 2381
     def test_create_inventory(self):
@@ -2384,6 +2386,7 @@ class PlacementAPIClientTestCase(base.DietTestCase):
2384 2386
         self.mock_request.assert_called_once_with(
2385 2387
                 expected_url, 'POST',
2386 2388
                 endpoint_filter={'region_name': mock.ANY,
2389
+                                 'interface': 'public',
2387 2390
                                  'service_type': 'placement'},
2388 2391
                 json=expected_payload)
2389 2392
 
@@ -2396,6 +2399,7 @@ class PlacementAPIClientTestCase(base.DietTestCase):
2396 2399
         self.mock_request.assert_called_once_with(
2397 2400
                 expected_url, 'GET',
2398 2401
                 endpoint_filter={'region_name': mock.ANY,
2402
+                                 'interface': 'public',
2399 2403
                                  'service_type': 'placement'})
2400 2404
 
2401 2405
     def _test_get_inventory_not_found(self, details, expected_exception):
@@ -2427,6 +2431,7 @@ class PlacementAPIClientTestCase(base.DietTestCase):
2427 2431
         self.mock_request.assert_called_once_with(
2428 2432
                 expected_url, 'PUT',
2429 2433
                 endpoint_filter={'region_name': mock.ANY,
2434
+                                 'interface': 'public',
2430 2435
                                  'service_type': 'placement'},
2431 2436
                 json=expected_payload)
2432 2437
 
@@ -2447,6 +2452,7 @@ class PlacementAPIClientTestCase(base.DietTestCase):
2447 2452
         self.mock_request.assert_called_once_with(
2448 2453
                 expected_url, 'PUT',
2449 2454
                 endpoint_filter={'region_name': mock.ANY,
2455
+                                 'interface': 'public',
2450 2456
                                  'service_type': 'placement'},
2451 2457
                 json=expected_payload,
2452 2458
                 headers={'openstack-api-version': 'placement 1.1'})
@@ -2458,6 +2464,7 @@ class PlacementAPIClientTestCase(base.DietTestCase):
2458 2464
         self.mock_request.assert_called_once_with(
2459 2465
                 expected_url, 'GET',
2460 2466
                 endpoint_filter={'region_name': mock.ANY,
2467
+                                 'interface': 'public',
2461 2468
                                  'service_type': 'placement'},
2462 2469
                 headers={'openstack-api-version': 'placement 1.1'})
2463 2470
 

Loading…
Cancel
Save