NSXV: ensure that binding update does not fail if deleted

A concurrent task may have deleted the router binding.

Change-Id: Icd5a64f7688c0a8389323deed84d7adf7c949006
This commit is contained in:
Gary Kotton 2017-07-12 02:18:43 -07:00
parent 92246b7f19
commit ba81638fcb
1 changed files with 7 additions and 3 deletions

View File

@ -296,9 +296,13 @@ class EdgeManager(object):
def _delete_backup_edges_on_db(self, context, backup_router_bindings):
for binding in backup_router_bindings:
nsxv_db.update_nsxv_router_binding(
context.session, binding['router_id'],
status=constants.PENDING_DELETE)
try:
nsxv_db.update_nsxv_router_binding(
context.session, binding['router_id'],
status=constants.PENDING_DELETE)
except db_base_exc.NoResultFound:
LOG.debug("Router binding %s does not exist.",
binding['router_id'])
def _delete_backup_edges_at_backend(self, context, backup_router_bindings):
for binding in backup_router_bindings: