Browse Source

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

changes/00/679200/1
Zuul 2 weeks ago
parent
commit
1482a8e44c

+ 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

@@ -2167,6 +2167,7 @@ class PlacementAPIClientTestCase(base.DietTestCase):
2167 2167
         self.mock_request.assert_called_once_with(
2168 2168
                 expected_url, 'POST',
2169 2169
                 endpoint_filter={'region_name': mock.ANY,
2170
+                                 'interface': 'public',
2170 2171
                                  'service_type': 'placement'},
2171 2172
                 json=expected_payload)
2172 2173
 
@@ -2177,6 +2178,7 @@ class PlacementAPIClientTestCase(base.DietTestCase):
2177 2178
         self.mock_request.assert_called_once_with(
2178 2179
                 expected_url, 'DELETE',
2179 2180
                 endpoint_filter={'region_name': mock.ANY,
2181
+                                 'interface': 'public',
2180 2182
                                  'service_type': 'placement'})
2181 2183
 
2182 2184
     def test_create_inventory(self):
@@ -2187,6 +2189,7 @@ class PlacementAPIClientTestCase(base.DietTestCase):
2187 2189
         self.mock_request.assert_called_once_with(
2188 2190
                 expected_url, 'POST',
2189 2191
                 endpoint_filter={'region_name': mock.ANY,
2192
+                                 'interface': 'public',
2190 2193
                                  'service_type': 'placement'},
2191 2194
                 json=expected_payload)
2192 2195
 
@@ -2199,6 +2202,7 @@ class PlacementAPIClientTestCase(base.DietTestCase):
2199 2202
         self.mock_request.assert_called_once_with(
2200 2203
                 expected_url, 'GET',
2201 2204
                 endpoint_filter={'region_name': mock.ANY,
2205
+                                 'interface': 'public',
2202 2206
                                  'service_type': 'placement'})
2203 2207
 
2204 2208
     def _test_get_inventory_not_found(self, details, expected_exception):
@@ -2230,6 +2234,7 @@ class PlacementAPIClientTestCase(base.DietTestCase):
2230 2234
         self.mock_request.assert_called_once_with(
2231 2235
                 expected_url, 'PUT',
2232 2236
                 endpoint_filter={'region_name': mock.ANY,
2237
+                                 'interface': 'public',
2233 2238
                                  'service_type': 'placement'},
2234 2239
                 json=expected_payload)
2235 2240
 
@@ -2250,6 +2255,7 @@ class PlacementAPIClientTestCase(base.DietTestCase):
2250 2255
         self.mock_request.assert_called_once_with(
2251 2256
                 expected_url, 'PUT',
2252 2257
                 endpoint_filter={'region_name': mock.ANY,
2258
+                                 'interface': 'public',
2253 2259
                                  'service_type': 'placement'},
2254 2260
                 json=expected_payload,
2255 2261
                 headers={'openstack-api-version': 'placement 1.1'})
@@ -2261,6 +2267,7 @@ class PlacementAPIClientTestCase(base.DietTestCase):
2261 2267
         self.mock_request.assert_called_once_with(
2262 2268
                 expected_url, 'GET',
2263 2269
                 endpoint_filter={'region_name': mock.ANY,
2270
+                                 'interface': 'public',
2264 2271
                                  'service_type': 'placement'},
2265 2272
                 headers={'openstack-api-version': 'placement 1.1'})
2266 2273
 

Loading…
Cancel
Save