From 68573c2fe3da8ca5f598997c72bcb83e46af50b8 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Wed, 14 Dec 2016 23:39:47 +0900 Subject: [PATCH] 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 --- neutron/db/extraroute_db.py | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/neutron/db/extraroute_db.py b/neutron/db/extraroute_db.py index d49f8ae9ffe..4a781e2cea8 100644 --- a/neutron/db/extraroute_db.py +++ b/neutron/db/extraroute_db.py @@ -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,