'Returns info about which routers should be removed
In case dvr serviceable port was deleted we need to check
if any dvr routers should be removed from l3 agent on port\'s host'

def get_dvr_routers_to_remove(self, context, deleted_port):

    if (not n_utils.is_dvr_serviced(deleted_port['device_owner'])):
        return []
    admin_context = context.elevated()
    port_host = deleted_port[portbindings.HOST_ID]
    subnet_ids = [ip['subnet_id'] for ip in deleted_port['fixed_ips']]
    router_ids = self.get_dvr_routers_by_subnet_ids(admin_context, subnet_ids)
    if (not router_ids):
        LOG.debug('No    DVR    routers    for    this    DVR    port    %(port)s    on    host    %(host)s', {'port': deleted_port['id'], 'host': port_host})
        return []
    agent = self._get_agent_by_type_and_host(context, n_const.AGENT_TYPE_L3, port_host)
    removed_router_info = []
    for router_id in router_ids:
        if rb_obj.RouterL3AgentBinding.objects_exist(context, router_id=router_id, l3_agent_id=agent.id):
            continue
        subnet_ids = self.get_subnet_ids_on_router(admin_context, router_id)
        if self._check_dvr_serviceable_ports_on_host(admin_context, port_host, subnet_ids):
            continue
        filter_rtr = {'device_id': [router_id], 'device_owner': [n_const.DEVICE_OWNER_DVR_INTERFACE]}
        int_ports = self._core_plugin.get_ports(admin_context, filters=filter_rtr)
        for port in int_ports:
            dvr_binding = ml2_db.get_distributed_port_binding_by_host(context, port['id'], port_host)
            if dvr_binding:
                dvr_binding['router_id'] = None
                dvr_binding.update(dvr_binding)
        info = {'router_id': router_id, 'host': port_host, 'agent_id': str(agent.id)}
        removed_router_info.append(info)
        LOG.debug('Router    %(router_id)s    on    host    %(host)s    to    be    deleted', info)
    return removed_router_info
