Comment 5 for bug 1443483

Revision history for this message
jichenjc (jichenjc) wrote :

I don't have an env to run the test, but from code analysis and a local test on the logic
I think you should not have 200 ids to be transfered to neutron client in latest release
I will leave it 'incomplete' , if you can reproduce in Juno or Kilo or master, then we can continue the analysis, thanks

294 def _get_ports_from_server_list(self, servers, neutron):
295 """Returns a list of ports used by the servers."""
296
297 def _chunk_by_ids(servers, limit):
298 ids = []
299 for server in servers:
300 ids.append(server['id'])
301 if len(ids) >= limit:
302 yield ids
303 ids = []
304 if ids:
305 yield ids
306
307 # Note: Have to split the query up as the search criteria
308 # form part of the URL, which has a fixed max size
309 ports = []
310 for ids in _chunk_by_ids(servers, MAX_SEARCH_IDS): ----> it's 150 constant
311 search_opts = {'device_id': ids}
312 ports.extend(neutron.list_ports(**search_opts).get('ports'))