Browse Source

Merge "Avoid port group creation race" into stable/queens

changes/10/692610/1 queens-em
Zuul 2 years ago
committed by Gerrit Code Review
parent
commit
f5d20263a5
  1. 4
      networking_ovn/common/ovn_client.py

4
networking_ovn/common/ovn_client.py

@ -1707,11 +1707,11 @@ class OVNClient(object):
with self._nb_idl.transaction(check_error=True) as txn:
if not self._nb_idl.get_port_group(pg_name):
# If drop Port Group doesn't exist yet, create it.
txn.add(self._nb_idl.pg_add(pg_name, acls=[]))
txn.add(self._nb_idl.pg_add(pg_name, acls=[], may_exist=True))
# Add ACLs to this Port Group so that all traffic is dropped.
acls = ovn_acl.add_acls_for_drop_port_group(pg_name)
for acl in acls:
txn.add(self._nb_idl.pg_acl_add(**acl))
txn.add(self._nb_idl.pg_acl_add(may_exist=True, **acl))
if ports:
ports_ids = [port['id'] for port in ports]

Loading…
Cancel
Save