From 321182980d8122a82e5f2a75a693cb527ee7257b Mon Sep 17 00:00:00 2001 From: Miro Tomaska Date: Wed, 19 Jul 2023 13:18:15 -0400 Subject: [PATCH] Follow up on a small nit from patch 875989 [1] Using boolean instead of an integer for one time resync [1] https://review.opendev.org/c/openstack/neutron/+/875989/comment/e2d314d1_3b1ded43/ Change-Id: If4b03e42c5eaedad926e3b8efb8f72ed6872c9b6 --- .../ml2/drivers/ovn/mech_driver/ovsdb/ovn_db_sync.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/ovn_db_sync.py b/neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/ovn_db_sync.py index 249ddc3a6ed..dce6c8490a0 100644 --- a/neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/ovn_db_sync.py +++ b/neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/ovn_db_sync.py @@ -299,7 +299,7 @@ class OvnNbSynchronizer(OvnDbSynchronizer): 'remove': num_acls_to_remove}) if self.mode == SYNC_MODE_REPAIR: - pg_resync_count = 0 + one_time_pg_resync = True while True: try: with self.ovn_api.transaction(check_error=True) as txn: @@ -311,13 +311,13 @@ class OvnNbSynchronizer(OvnDbSynchronizer): **acla, may_exist=True)) except idlutils.RowNotFound as row_err: if row_err.msg.startswith("Cannot find Port_Group"): - if pg_resync_count < 1: + if one_time_pg_resync: LOG.warning('Port group row was not found during ' 'ACLs sync. Will attempt to sync port ' 'groups one more time. The caught ' 'exception is: %s', row_err) self.sync_port_groups(ctx) - pg_resync_count += 1 + one_time_pg_resync = False continue LOG.error('Port group exception during ACL sync ' 'even after one more port group resync. '