Skip to content

Commit

Permalink
Merge "Fixes for crashes in schema transformer"
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed May 28, 2015
2 parents 942515f + 7c08fa7 commit 1be41c2
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/config/schema-transformer/to_bgp.py
Expand Up @@ -275,12 +275,13 @@ def __init__(self, name, obj=None, acl_dict=None, ri_dict=None):
self._default_ri_name = self.obj.name
ri_obj = self.locate_routing_instance(self._default_ri_name, None,
ri_dict)
# if primary RI is connected to another primary RI, we need to
# also create connection between the VNs
for connection in ri_obj.connections:
remote_ri_fq_name = connection.split(':')
if remote_ri_fq_name[-1] == remote_ri_fq_name[-2]:
self.connections.add(':'.join(remote_ri_fq_name[0:-1] ))
if ri_obj is not None:
# if primary RI is connected to another primary RI, we need to
# also create connection between the VNs
for connection in ri_obj.connections:
remote_ri_fq_name = connection.split(':')
if remote_ri_fq_name[-1] == remote_ri_fq_name[-2]:
self.connections.add(':'.join(remote_ri_fq_name[0:-1] ))

for ri in self.obj.get_routing_instances() or []:
ri_name = ri['to'][-1]
Expand Down Expand Up @@ -847,6 +848,8 @@ def delete_route(self, prefix):
import_export="import")
update = False
static_route_entries = left_ri.obj.get_static_route_entries()
if static_route_entries is None:
return
for static_route in static_route_entries.get_route() or []:
if static_route.prefix != prefix:
continue
Expand Down Expand Up @@ -2697,7 +2700,7 @@ def reinit(self):
if ri.parent_uuid not in vn_id_list:
delete = True
else:
ri_name = ri.get_fq_name_str()
ri_name = ri.get_fq_name()[-1]
# if the RI was for a service chain and service chain no
# longer exists, delete the RI
sc_id = VirtualNetworkST._get_service_id_from_ri(ri_name)
Expand Down

0 comments on commit 1be41c2

Please sign in to comment.