Pushes 'Global' routers to the end of the router list, so that
        deleting default route occurs before deletion of external nw subintf
324653
def _adjust_router_list_for_global_router(self, routers):
        
        #ToDo(Hareesh): Simplify if possible
        for r in routers:
            if r[ROUTER_ROLE_ATTR] == c_constants.ROUTER_ROLE_GLOBAL:
                LOG.debug("Global router:%s found. Moved to the end of list "
                          "for processing", r['id'])
                routers.remove(r)
                routers.append(r)
1281476
def _remove_redundancy_router_interfaces(self, context, router_id,
                                             old_port):
        
        ha_settings = self._get_ha_settings_by_router_id(context, router_id)
        if ha_settings is None or old_port is None:
            return
        e_context = context.elevated()
        rr_ids = self._get_redundancy_router_ids(e_context, router_id)
        port_info_list = self._core_plugin.get_ports(
            e_context, filters={'device_id': rr_ids,
                                'network_id': [old_port['network_id']]},
            fields=['device_id', 'fixed_ips', 'id'])
        subnet_id = old_port['fixed_ips'][0]['subnet_id']
        for port_info in port_info_list:
            if port_info['fixed_ips'][0]['subnet_id'] == subnet_id:
                interface_info = {'port_id': port_info['id']}
                self.remove_router_interface(e_context, port_info['device_id'],
                                             interface_info)
        self._delete_ha_group(e_context, old_port['id'])
964215
def delete_router_by_name(self, rtr_name, tenant_id):
        
        try:
            routers = self.neutronclient.list_routers()
            rtr_list = routers.get('routers')
            for rtr in rtr_list:
                if rtr_name == rtr['name']:
                    self.neutronclient.delete_router(rtr['id'])
        except Exception as exc:
            LOG.error("Failed to get and delete router by name %(name)s, "
                      "Exc %(exc)s",
                      {'name': rtr_name, 'exc': str(exc)})
            return False
        return True
1169904
async def clear_default_gateways(self):
        """"""
        self._data = await self._handler.clear_default_gateways(
            system_id=self.system_id)
        return self
246565
function() {
			var baseUrl = context.getGlobal('location').pathname;

			routerService = context.getService('router');
			routerService.init([
				baseUrl,
				baseUrl + 'active',
				baseUrl + 'completed'
			]);
		}
1289691
function RouterState(root, snapshot) {
        _super.call(this, root);
        this.snapshot = snapshot;
        setRouterStateSnapshot(this, root);
    }
371687
def _remove_redundancy_routers(self, context, router_ids, ports,
                                   delete_ha_groups=False):
        
        subnets_info = [{'subnet_id': port['fixed_ips'][0]['subnet_id']}
                        for port in ports]
        for r_id in router_ids:
            for i in range(len(subnets_info)):
                self.remove_router_interface(context, r_id, subnets_info[i])
                LOG.debug("Removed interface on %(s_id)s to redundancy router "
                          "with %(r_id)s",
                          {'s_id': ports[i]['network_id'], 'r_id': r_id})
                # There is only one ha group per network so only delete once
                if delete_ha_groups and r_id == router_ids[0]:
                    self._delete_ha_group(context, ports[i]['id'])
            self.delete_router(context, r_id)
            LOG.debug("Deleted redundancy router %s", r_id)
257779
def clean_stale_routes(self, peer, route_family=None):
        

        if route_family is not None:
            if route_family not in SUPPORTED_GLOBAL_RF:
                raise ValueError('Given route family %s is not supported.' %
                                 route_family)

            tables = [self._global_tables.get(route_family)]
        else:
            tables = self._global_tables.values()
        for table in tables:
            table.cleanup_paths_for_peer(peer)
800485
private function moveDefaultRoute()
    {
        $defaultRoute = $this->get('default');
        if (null !== $defaultRoute) {
            $this->remove('default');
            $this->add('default', $defaultRoute);
        }
    }
401359
public final void removeChildRouter(@NonNull Router childRouter) {
        if ((childRouter instanceof ControllerHostedRouter) && childRouters.remove(childRouter)) {
            childRouter.destroy(true);
        }
    }
44097
def remove_gateway_router(self, router):
        '''
        
        '''
        router_id = self._find_router_id(router)
        return self.network_conn.remove_gateway_router(router=router_id)
1228516
def network_delete_notif(self, tenant_id, tenant_name, network_id):
        
        router_id = self.get_router_id(tenant_id, tenant_name)
        if router_id is None:
            LOG.error("Rout ID not present for tenant")
            return False
        ret = self._program_dcnm_static_route(tenant_id, tenant_name)
        if not ret:
            LOG.error("Program DCNM with static routes failed for "
                      "router %s", router_id)
            return False

        # Program router namespace to have this network to be routed
        # to IN service network
        in_ip_dict = self.get_in_ip_addr(tenant_id)
        in_gw = in_ip_dict.get('gateway')
        in_ip = in_ip_dict.get('subnet')
        if in_gw is None:
            LOG.error("No FW service GW present")
            return False
        out_ip_dict = self.get_out_ip_addr(tenant_id)
        out_ip = out_ip_dict.get('subnet')
        excl_list = []
        excl_list.append(in_ip)
        excl_list.append(out_ip)
        subnet_lst = self.os_helper.get_subnet_nwk_excl(tenant_id, excl_list,
                                                        excl_part=True)
        ret = self.os_helper.remove_rtr_nwk_next_hop(router_id, in_gw,
                                                     subnet_lst, excl_list)
        if not ret:
            LOG.error("Unable to program default router next hop %s",
                      router_id)
            return False
        return True
702497
def remove_routes(self, item, routes):
        """"""
        for route in routes:
            items = self._routes.get(route)
            try:
                items.remove(item)
                LOG.debug('removed item from route %s', route)
            except ValueError:
                pass
            if not items:
                self._routes.pop(route)
                LOG.debug('removed route %s', route)
419536
def update_dcnm_partition_static_route(self, tenant_id, arg_dict):
        
        ip_list = self.os_helper.get_subnet_nwk_excl(tenant_id,
                                                     arg_dict.get('excl_list'))
        srvc_node_ip = self.get_out_srvc_node_ip_addr(tenant_id)
        ret = self.dcnm_obj.update_partition_static_route(
            arg_dict.get('tenant_name'), fw_const.SERV_PART_NAME, ip_list,
            vrf_prof=self.cfg.firewall.fw_service_part_vrf_profile,
            service_node_ip=srvc_node_ip)
        if not ret:
            LOG.error("Unable to update DCNM ext profile with static "
                      "route %s", arg_dict.get('router_id'))
            self.delete_intf_router(tenant_id, arg_dict.get('tenant_name'),
                                    arg_dict.get('router_id'))
            return False
        return True
1159556
def set_ipv6_default_next_hop
      str = config_get('route_map', 'set_ipv6_default_next_hop', @get_args)
      return if str.nil?
      if str.empty?
        val = default_set_ipv6_default_next_hop
      else
        val = str.split
        val.delete('load-share')
      end
      val
    end
1191652
function () {
				if (this.bIsDestroyed) {
					return this;
				}

				EventProvider.prototype.destroy.apply(this);

				// destroy the view cache
				if (this._oViews) {
					this._oViews.destroy();
					this._oViews = null;
				}

				if (!this._bIsInitialized) {
					Log.info("Router is not initialized, but got destroyed.", this);
				}

				if (this.fnHashChanged) {
					this.oHashChanger.detachEvent("hashChanged", this.fnHashChanged);
				}

				if (this.fnHashReplaced) {
					this.oHashChanger.detachEvent("hashReplaced", this.fnHashReplaced);
				}

				//will remove all the signals attached to the routes - all the routes will not be useable anymore
				this._oRouter.removeAllRoutes();
				this._oRouter = null;

				jQuery.each(this._oRoutes, function(iRouteIndex, oRoute) {
					oRoute.destroy();
				});
				this._oRoutes = null;
				this._oConfig = null;

				if (this._oTargets) {
					this._oTargets.destroy();
					this._oTargets = null;
				}

				delete this._bIsInitialized;
				this.bIsDestroyed = true;

				return this;
			}
194148
def remove_router_from_hosting_device(self, client, hosting_device_id,
                                          router_id):
        """"""
        res_path = hostingdevice.HostingDevice.resource_path
        return client.delete((res_path + DEVICE_L3_ROUTERS + "/%s") % (
            hosting_device_id, router_id))