When deleting a vpn-site-connection, deleting the nat rule would
fail because it was created with top=True, but top defaults to
'false' in remove_rule and was not being passed. This caused the
rule matching to fail and the rule to not be deleted.
Change-Id: I51012a783314c97e85b31fc8a73be4cbb8ee7dc5
Closes-Bug: #
1331839
if not router_info:
return
router_info.iptables_manager.ipv4['nat'].remove_rule(
- chain, rule)
+ chain, rule, top=top)
def iptables_apply(self, router_id):
"""Apply IPtables.
iptables = mock.Mock()
ri.iptables_manager.ipv4['nat'] = iptables
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(
- 'fake_chain', 'fake_rule')
+ 'fake_chain', 'fake_rule', top=True)
def test_remove_rule_with_no_router(self):
self.agent.router_info = {}