Skip to content

Commit

Permalink
Same type(tuple) is returned by the _get_routing_instance_from_route
Browse files Browse the repository at this point in the history
method during early returns in case of failure.
Removing next_hop from si_dict if it is not in the route target list.

Closes-Bug: 1579177

Change-Id: Ifb3e127a398b02503193859b5b49a958d6d5348e
  • Loading branch information
cijohnson committed May 9, 2016
1 parent 9e7e19b commit 1e743ff
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/config/schema-transformer/to_bgp.py
Expand Up @@ -690,10 +690,10 @@ def _get_routing_instance_from_route(self, next_hop):
si = _vnc_lib.service_instance_read(fq_name_str=next_hop)
si_props = si.get_service_instance_properties()
if si_props is None:
return None
return (None, None)
except NoIdError:
_sandesh._logger.error("Cannot read service instance %s", next_hop)
return None
return (None, None)
left_vn_str, _ = get_si_vns(si, si_props)
if not left_vn_str:
_sandesh._logger.error("%s: route table next hop service instance "
Expand Down Expand Up @@ -1146,7 +1146,7 @@ def set_routes(self, routes=[]):
rt_list = [route.next_hop for route in routes]
for route in self.routes or []:
if route.next_hop not in rt_list:
self._si_dict.discard(route.next_hop)
del _si_dict[route.next_hop]
self.routes = routes
for route in self.routes or []:
self._si_dict[route.next_hop] = self
Expand Down

0 comments on commit 1e743ff

Please sign in to comment.