

def _get_expected_addresses(self, server, no_fip_expected=True):
    server_ports = self.ports.filter(device_id=server.id)
    addresses = collections.defaultdict(list)
    for p in server_ports:
        net_name = self.networks.get(id=p['network_id']).name
        for ip in p.fixed_ips:
            addresses[net_name].append({
                'version': 4,
                'addr': ip['ip_address'],
                'OS-EXT-IPS-MAC:mac_addr': p.mac_address,
                'OS-EXT-IPS:type': 'fixed',
            })
            if no_fip_expected:
                continue
            fips = self.q_floating_ips.filter(port_id=p['id'])
            if (not fips):
                continue
            fip = fips[0]
            addresses[net_name].append({
                'version': 4,
                'addr': fip.floating_ip_address,
                'OS-EXT-IPS-MAC:mac_addr': p.mac_address,
                'OS-EXT-IPS:type': 'floating',
            })
    return addresses

dataset/ETHPy150Open CiscoSystems/avos/openstack_dashboard/test/api_tests/network_tests.py NetworkApiNeutronTests._get_expected_addresses/original