Fix run docker error on the network with host route

Add ROUTE_TYPE definition in constants.py, this is used when kuryr process
host route.

Change-Id: I6f076ea1d8f7dafe8d459b0dc04bf6b290e2ed48
Closes-Bug: #1583692
This commit is contained in:
Liping Mao 2016-05-20 00:39:55 +08:00
parent 0ef39368fe
commit 27106f56e4
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

@ -843,10 +843,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)