Skip to content

Commit

Permalink
Merge "svc-monitor: Avoid NoneType Error in snat_agent.py" into R3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Feb 26, 2016
2 parents 3552309 + 9ddfbf0 commit f8ec3f4
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/config/svc-monitor/svc_monitor/snat_agent.py
Expand Up @@ -279,14 +279,17 @@ def cleanup_snat_instance(self, lr_id, si_id):
return

# Get route table for default route it it exists
rt_name = 'rt_' + lr_id
rt_fq_name = si_obj.get_fq_name()[0:2] + [rt_name]
try:
rt_obj = self._vnc_lib.route_table_read(
fq_name=rt_fq_name,
fields=['virtual_network_back_refs'])
except vnc_exc.NoIdError:
if lr_id is None:
rt_obj = None
else:
rt_name = 'rt_' + lr_id
rt_fq_name = si_obj.get_fq_name()[0:2] + [rt_name]
try:
rt_obj = self._vnc_lib.route_table_read(
fq_name=rt_fq_name,
fields=['virtual_network_back_refs'])
except vnc_exc.NoIdError:
rt_obj = None

# Delete route table
if rt_obj:
Expand Down

0 comments on commit f8ec3f4

Please sign in to comment.