Merge "ipam: don't commit IPAllocation while IpamAllocation is rolled back"

This commit is contained in:
Zuul 2017-12-21 20:56:32 +00:00 committed by Gerrit Code Review
commit 6cdd079f8f
1 changed files with 4 additions and 3 deletions

View File

@ -474,9 +474,10 @@ class IpamPluggableBackend(ipam_backend_mixin.IpamBackendMixin):
# Do the insertion of each IP allocation entry within
# the context of a nested transaction, so that the entry
# is rolled back independently of other entries whenever
# the corresponding port has been deleted.
with db_api.context_manager.writer.using(context):
allocated.create()
# the corresponding port has been deleted; since OVO
# already opens a nested transaction, we don't need to do
# it explicitly here.
allocated.create()
updated_ports.append(port['id'])
except db_exc.DBReferenceError:
LOG.debug("Port %s was deleted while updating it with an "