'Returns a dict indicating whether or not a subnet is isolated
A subnet is considered non-isolated if there is a port connected to
the subnet, and the port\'s ip address matches that of the subnet\'s
gateway. The port must be owned by a neutron router.'

@classmethod
def get_isolated_subnets(cls, network):

    isolated_subnets = collections.defaultdict((lambda : True))
    all_subnets = cls._get_all_subnets(network)
    subnets = dict(((subnet.id, subnet) for subnet in all_subnets))
    for port in network.ports:
        if (port.device_owner not in constants.ROUTER_INTERFACE_OWNERS):
            continue
        for alloc in port.fixed_ips:
            if ((alloc.subnet_id in subnets) and (subnets[alloc.subnet_id].gateway_ip == alloc.ip_address)):
                isolated_subnets[alloc.subnet_id] = False
    return isolated_subnets
