Merge "ovn: Don't use dict.remove() for filtering dhcp ports in db-sync" into stable/ussuri

This commit is contained in:
Zuul 2021-06-22 21:07:45 +00:00 committed by Gerrit Code Review
commit 10077b2288
1 changed files with 8 additions and 8 deletions

View File

@ -745,14 +745,14 @@ class OvnNbSynchronizer(OvnDbSynchronizer):
return
LOG.debug('OVN sync metadata ports started')
for net in self.core_plugin.get_networks(ctx):
dhcp_ports = self.core_plugin.get_ports(ctx, filters=dict(
network_id=[net['id']],
device_owner=[constants.DEVICE_OWNER_DHCP]))
for port in dhcp_ports:
# Do not touch the Neutron DHCP agents ports
if utils.is_neutron_dhcp_agent_port(port):
dhcp_ports.remove(port)
# Get only DHCP ports that don't belong to agent, it should return
# only OVN metadata ports
dhcp_ports = [
p for p in self.core_plugin.get_ports(
ctx, filters=dict(
network_id=[net['id']],
device_owner=[constants.DEVICE_OWNER_DHCP]))
if not utils.is_neutron_dhcp_agent_port(p)]
if not dhcp_ports:
LOG.warning('Missing metadata port found in Neutron for '