Merge "Fix run docker error on the network with host route"

This commit is contained in:
Jenkins 2016-06-08 20:40:35 +00:00 committed by Gerrit Code Review
commit 9824d94055
2 changed files with 9 additions and 2 deletions

View File

@ -18,6 +18,13 @@ SCHEMA = {
"SUCCESS": {}
}
# Routes are either given a RouteType of 0 and a value for NextHop;
# or, a RouteType of 1 and no value for NextHop, meaning a connected route.
ROUTE_TYPE = {
"NEXTHOP": 0,
"CONNECTED": 1
}
DEVICE_OWNER = 'kuryr:container'
NIC_NAME_LEN = 14
VETH_PREFIX = 'tap'

View File

@ -851,10 +851,10 @@ def network_driver_join():
'Destination': host_route['destination']
}
if host_route.get('nexthop', None):
static_route['RouteType'] = const.TYPES['NEXTHOP']
static_route['RouteType'] = const.ROUTE_TYPE['NEXTHOP']
static_route['NextHop'] = host_route['nexthop']
else:
static_route['RouteType'] = const.TYPES['CONNECTED']
static_route['RouteType'] = const.ROUTE_TYPE['CONNECTED']
join_response['StaticRoutes'].append(static_route)
return flask.jsonify(join_response)