'Checks if the csnat port contains multiple ipv6 prefixes.
If the csnat port contains multiple ipv6 prefixes for the given
network when a router interface is deleted, make sure we don\'t
delete the port when a single subnet is deleted and just update
it with the right fixed_ip.
This function returns true if it is a multiprefix port.'

def _check_for_multiprefix_csnat_port_and_update(self, context, router, network_id, subnet_id):

    if router.gw_port:
        cs_port = self._find_v6_router_port_by_network_and_device_owner(router, network_id, const.DEVICE_OWNER_ROUTER_SNAT)
        if cs_port:
            fixed_ips = [fixedip for fixedip in cs_port['fixed_ips'] if (fixedip['subnet_id'] != subnet_id)]
            if (len(fixed_ips) == len(cs_port['fixed_ips'])):
                return False
            if fixed_ips:
                self.l3plugin._core_plugin.update_port(context.elevated(), cs_port['id'], {'port': {'fixed_ips': fixed_ips}})
                return True
    return False
