Browse Source

Work around potential double row.delete() call

The update_acls code can potentially iterate over the same ACL
twice. This temporary workaround silently ignores an attempt to
delete the same row twice in the same transaction, since that
should be safe. Ultimately, refactoring the ACL code to use sets
and possibly handle the fact that an ACL could be referenced from
multiple rows should be done.

Change-Id: I259c92116f7d3186ae5af45f1407052eb57ac0ba
Related-bug: #1857016
(cherry-picked from Neutron I895eaf4006583fedc2657a4eb527df1ff992c5bc)
changes/65/700065/2
Terry Wilson 2 years ago
parent
commit
dce03899e3
  1. 6
      networking_ovn/ovsdb/commands.py

6
networking_ovn/ovsdb/commands.py

@ -617,7 +617,11 @@ class UpdateACLsCommand(command.BaseCommand):
# Delete old ACLs.
if acl_del_objs:
for acl_del_obj in acl_del_objs:
acl_del_obj.delete()
try:
acl_del_obj.delete()
except AssertionError:
# If we try to delete a row twice, just continue
pass
# Add new ACLs.
acl_add_objs = None

Loading…
Cancel
Save