def _router_removed(self, router_id, deconfigure=True):
ri = self.router_info.get(router_id)<EOL>if ri is None:<EOL><INDENT>LOG.warning("<STR_LIT>"<EOL>"<STR_LIT>", router_id)<EOL>return<EOL><DEDENT>ri.router['<STR_LIT>'] = None<EOL>ri.router[bc.constants.INTERFACE_KEY] = []<EOL>ri.router[bc.constants.FLOATINGIP_KEY] = []<EOL>try:<EOL><INDENT>hd = ri.router['<STR_LIT>']<EOL>if (deconfigure and<EOL>self._dev_status.is_hosting_device_reachable(hd)):<EOL><INDENT>self._process_router(ri)<EOL>driver = self.driver_manager.get_driver(router_id)<EOL>driver.router_removed(ri)<EOL>self.driver_manager.remove_driver(router_id)<EOL><DEDENT>del self.router_info[router_id]<EOL>self._del_from_removed_routers_cache(router_id)<EOL><DEDENT>except cfg_exceptions.DriverException:<EOL><INDENT>LOG.warning("<STR_LIT>"<EOL>"<STR_LIT>",<EOL>router_id)<EOL>self._update_removed_routers_cache([router_id])<EOL>self._del_from_updated_routers_cache(router_id)<EOL><DEDENT>except ncc_errors.SessionCloseError as e:<EOL><INDENT>LOG.exception("<STR_LIT>"<EOL>"<STR_LIT>", e)<EOL>if not self._dev_status.is_hosting_device_reachable(hd):<EOL><INDENT>LOG.debug("<STR_LIT>" % hd['<STR_LIT:id>'])<EOL><DEDENT>else:<EOL><INDENT>self._update_removed_routers_cache([router_id])<EOL>LOG.debug("<STR_LIT>"<EOL>"<STR_LIT>" %<EOL>pp.pformat(hd), router_id)<EOL><DEDENT><DEDENT>
Operations when a router is removed.

        Get the RouterInfo object corresponding to the router in the service
        helpers's router_info dict. If deconfigure is set to True,
        remove this router's configuration from the hosting device.
        :param router_id: id of the router
        :param deconfigure: if True, the router's configuration is deleted from
        the hosting device.
        :return: None