Merge "Pass 'top' to remove_rule so that rule matching succeeds"

This commit is contained in:
Jenkins 2014-06-20 22:23:00 +00:00 committed by Gerrit Code Review
commit ff26dbb841
2 changed files with 3 additions and 3 deletions

View File

@ -98,7 +98,7 @@ class VPNAgent(l3_agent.L3NATAgentWithStateReport):
if not router_info: if not router_info:
return return
router_info.iptables_manager.ipv4['nat'].remove_rule( router_info.iptables_manager.ipv4['nat'].remove_rule(
chain, rule) chain, rule, top=top)
def iptables_apply(self, router_id): def iptables_apply(self, router_id):
"""Apply IPtables. """Apply IPtables.

View File

@ -127,9 +127,9 @@ class TestVPNAgent(base.BaseTestCase):
iptables = mock.Mock() iptables = mock.Mock()
ri.iptables_manager.ipv4['nat'] = iptables ri.iptables_manager.ipv4['nat'] = iptables
self.agent.router_info = {router_id: ri} self.agent.router_info = {router_id: ri}
self.agent.remove_nat_rule(router_id, 'fake_chain', 'fake_rule') self.agent.remove_nat_rule(router_id, 'fake_chain', 'fake_rule', True)
iptables.remove_rule.assert_called_once_with( iptables.remove_rule.assert_called_once_with(
'fake_chain', 'fake_rule') 'fake_chain', 'fake_rule', top=True)
def test_remove_rule_with_no_router(self): def test_remove_rule_with_no_router(self):
self.agent.router_info = {} self.agent.router_info = {}