def garbage_collect_old_service_chains(desired_chains): current_paasta_chains = { chain for chain in iptables.all_chains() if chain.startswith('PAASTA.') } for chain in current_paasta_chains - set(desired_chains): iptables.delete_chain(chain)
def test_delete_chain(mock_Table, mock_Chain): iptables.delete_chain('PAASTA.service') chain = mock_Chain('filter', 'PAASTA.service') assert chain.flush.called is True assert chain.delete.called is True
def test_delete_chain(mock_Table, mock_Chain): iptables.delete_chain("PAASTA.service") chain = mock_Chain("filter", "PAASTA.service") assert chain.flush.called is True assert chain.delete.called is True