Merge "Check port existence before updating it in NB DB"
This commit is contained in:
commit
25a61b07ae
|
@ -554,6 +554,12 @@ class DFMechDriver(driver_api.MechanismDriver):
|
|||
@lock_db.wrap_db_lock(lock_db.RESOURCE_ML2_CORE)
|
||||
def update_port_postcommit(self, context):
|
||||
updated_port = context.current
|
||||
if not self.nb_api.get_logical_port(updated_port['id'],
|
||||
updated_port['tenant_id']):
|
||||
# REVISIT(xiaohhui): Should we unify the check before update nb db?
|
||||
LOG.debug("The port %s has been deleted from dragonflow NB DB, "
|
||||
"by concurrent operation.", updated_port['id'])
|
||||
return
|
||||
|
||||
# If a subnet enabled dhcp, the DFMechDriver will create a dhcp server
|
||||
# port. When delete this subnet, the port should be deleted.
|
||||
|
|
Loading…
Reference in New Issue