]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Switch to dictionary for iptables find
authorKevin Benton <blak111@gmail.com>
Sat, 16 May 2015 00:10:15 +0000 (17:10 -0700)
committerKevin Benton <blak111@gmail.com>
Thu, 28 May 2015 00:51:31 +0000 (17:51 -0700)
commit7a3934d982ef29d8851450b5586319201baa0122
treeb83c3c6b9001ee02bbbd52b71c53faeeefe987b4
parent5689c090b376d3dd4b0876f60c5265bfa3b050ab
Switch to dictionary for iptables find

The code to find the matching entry was scanning through a
list of all rules for every rule. This became extremely slow
as the number of rules became large, leading to long delays
waiting for firewall rules to be applied.

This patch switches to the use of a dictionary so the cost
becomes a hash lookup instead of a list scan.

Closes-Bug: #1453264
Closes-Bug: #1455675
Change-Id: I1e6fe5e50b9c13066c966c252cadc8ed1d08f686
neutron/agent/linux/iptables_manager.py
neutron/tests/unit/agent/linux/test_iptables_manager.py