@staticmethod
    def _extract_subnets(network):
        subnet_v4 = {
            'network_id': network.uuid,
            'cidr': network.cidr,
            'gateway': network.gateway,
            'dhcp_server': getattr(network, 'dhcp_server'),
            'broadcast': network.broadcast,
            'netmask': network.netmask,
            'version': 4,
            'dns1': network.dns1,
            'dns2': network.dns2}
        # TODO(tr3buchet): I'm noticing we've assumed here that all dns is v4.
        #                  this is probably bad as there is no way to add v6
        #                  dns to nova
        subnet_v6 = {
            'network_id': network.uuid,
            'cidr': network.cidr_v6,
            'gateway': network.gateway_v6,
            'dhcp_server': None,
            'broadcast': None,
            'netmask': network.netmask_v6,
            'version': 6,
            'dns1': None,
            'dns2': None}

        def ips_to_strs(net):
            for key, value in net.items():
                if isinstance(value, netaddr.ip.BaseIP):
                    net[key] = str(value)
            return net

        return [ips_to_strs(subnet_v4), ips_to_strs(subnet_v6)]
Returns information about the IPv4 and IPv6 subnets
dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/network/manager.py/NetworkManager._extract_subnets