'Returns a list of ports used by the servers.'

def _get_ports_from_server_list(self, servers, neutron):

    def _chunk_by_ids(servers, limit):
        ids = []
        for server in servers:
            ids.append(server['id'])
            if (len(ids) >= limit):
                (yield ids)
                ids = []
        if ids:
            (yield ids)
    ports = []
    for ids in _chunk_by_ids(servers, MAX_SEARCH_IDS):
        search_opts = {'device_id': ids}
        ports.extend(neutron.list_ports(**search_opts).get('ports'))
    return ports
