]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Improve iptables_manager _modify_rules() method
authorSudhakar <sudhakar.gariganti@gmail.com>
Mon, 3 Mar 2014 10:05:20 +0000 (15:35 +0530)
committerBrian Haley <brian.haley@hp.com>
Mon, 2 Jun 2014 20:24:56 +0000 (16:24 -0400)
commit0c202ab3e453e38c09f04978e4fce30d6ee6350c
treecbdd9a65adf0a0d5bfdc50fbaa0818d6dd6d2b57
parentd720cb5cf640e66dde9c5fa3993288a57a6714ee
Improve iptables_manager _modify_rules() method

As the number of ports per default security group increases, the
number of iptables entries on the Compute Node grows.  Because of
this, there is a gradual increase in the time taken to apply chains
and rules.

Currently we are using list comprehensions to find if a new chain or
rule matches an existing one.  Instead, walk through the list in
reverse to find a matching entry.

Added a new method, _find_last_entry(), to return the entry we are
searching for.

Change-Id: I3585479ffa00be556b8b21dc9dbd6b36ad37f4de
Closes-Bug: #1302272
Related-Bug: #1253993
neutron/agent/linux/iptables_manager.py
neutron/tests/unit/test_iptables_manager.py