NSXv: Don't remove default static routes on edge
Current code will assume static routes are managed by the extraroute extension, and may override default static routes (for ECMP) in specific scenarios. This patch fix that, if router doesn't have a specific gateway, we will assume default routes are being used. Change-Id: If2cc468d9faae10c45e9f8fafef35b0c08e7518d
This commit is contained in:
parent
afec7c5649
commit
c3bb30922c
|
@ -692,6 +692,15 @@ class EdgeApplianceDriver(object):
|
|||
"description": "default-gateway",
|
||||
"gatewayAddress": gateway
|
||||
}
|
||||
else:
|
||||
# If external subnet has no gateway, then assume using ECMP with
|
||||
# multipule default static routes. Retain them.
|
||||
h, curr_routes = self.vcns.get_routes(edge_id)
|
||||
curr_routes = curr_routes.get('staticRoutes',
|
||||
{}).get('staticRoutes', [])
|
||||
default_routes = [r for r in curr_routes
|
||||
if r['network'] != '0.0.0.0/0']
|
||||
static_routes.extend(default_routes)
|
||||
try:
|
||||
self.vcns.update_routes(edge_id, request)
|
||||
return True
|
||||
|
|
Loading…
Reference in New Issue