示例#1
0
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)
示例#2
0
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
示例#3
0
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