Skip to content

Commit

Permalink
Add check for left and right vn
Browse files Browse the repository at this point in the history
left or right vn of a service chain could have been deleted while
schema transformer was down. When it comes back up, it tries to
read these networks. We should add a check for None before accessing
these networks to avoid generating a traceback.

Change-Id: If2d3ffccdc912eaa64a84e17233a2fb3e3a84477
Closes-Bug: 1590278
(cherry picked from commit d8518b1)
  • Loading branch information
Sachin Bansal committed Jun 9, 2016
1 parent d2d1714 commit b9a4e54
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/config/schema-transformer/config_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -1913,6 +1913,10 @@ def import_default_ri_route_target_to_service_ri(self):
return
left_vn = VirtualNetworkST.get(sc.left_vn)
right_vn = VirtualNetworkST.get(sc.right_vn)
if left_vn is None or right_vn is None:
self._logger.debug("left or right vn not found for RI " + self.name)
return

multi_policy_enabled = (
left_vn.multi_policy_service_chains_enabled and
right_vn.multi_policy_service_chains_enabled)
Expand Down

0 comments on commit b9a4e54

Please sign in to comment.