Ignore fwg which has no ports when restarting l3-agent

When restarting l3 agent, it will detect whether the
router is updated. If the port in the firewall group is
not updated, it will also change its status. This patch
skips updating the status of firewall group which has no ports.

Change-Id: Ife294430409a9fb2944917a28a08323f41c89c0d
Closes-Bug:#1783327
This commit is contained in:
zhanghao2 2019-07-30 09:57:11 -04:00
parent 070068941b
commit a7e85121f7
1 changed files with 3 additions and 0 deletions

View File

@ -271,6 +271,9 @@ class FWaaSL3AgentExtension(l3_extension.L3AgentExtension):
ports_to_process = (set(firewall_group['add-port-ids'] +
firewall_group['del-port-ids']) &
all_router_ports)
# ensure no port in router is associated with the firewall group
if not ports_to_process:
continue
# A port can have at most one firewall group.
port_ids_to_exclude = ports_to_process & processed_ports
if port_ids_to_exclude: