extraroute_db: Remove _get_extra_routes_dict_by_router_id

It isn't necessary after the recent OVO change. [1]

[1] I2439116abf051d0e19821ba53895fa0c724f6a96

Change-Id: Ia815d6c597730bd5cb49455e7409ca747a4cc22c
This commit is contained in:
YAMAMOTO Takashi 2016-12-14 23:39:47 +09:00
parent 0cda3b56aa
commit 68573c2fe3
1 changed files with 3 additions and 16 deletions

View File

@ -104,12 +104,9 @@ class ExtraRoute_dbonly_mixin(l3_db.L3_NAT_dbonly_mixin):
cidrs, ips, routes, route['nexthop'])
def _update_extra_routes(self, context, router, routes):
self._validate_routes(context, router['id'],
routes)
old_routes, routes_dict = self._get_extra_routes_dict_by_router_id(
context, router['id'])
added, removed = helpers.diff_list_of_dict(old_routes,
routes)
self._validate_routes(context, router['id'], routes)
old_routes = self._get_extra_routes_by_router_id(context, router['id'])
added, removed = helpers.diff_list_of_dict(old_routes, routes)
LOG.debug('Added routes are %s', added)
for route in added:
l3_obj.RouterRoute(
@ -137,16 +134,6 @@ class ExtraRoute_dbonly_mixin(l3_db.L3_NAT_dbonly_mixin):
router_objs = l3_obj.RouterRoute.get_objects(context, router_id=id)
return self._make_extra_route_list(router_objs)
def _get_extra_routes_dict_by_router_id(self, context, id):
router_objs = l3_obj.RouterRoute.get_objects(context, router_id=id)
routes = []
routes_dict = {}
for route in router_objs:
routes.append({'destination': route.destination,
'nexthop': route.nexthop})
routes_dict[(route.destination, route.nexthop)] = route
return routes, routes_dict
def _confirm_router_interface_not_in_use(self, context, router_id,
subnet_id):
super(ExtraRoute_dbonly_mixin,