def ci_destroy():

    destroy_cmd = "terraform destroy -force"
    if 'OS_IP' in os.environ:
        ssh_cmd = '''
ssh -i {keypath} -p {ssh_port}
-o BatchMode=yes -o StrictHostKeyChecking=no
travis@{ssh_ip} /bin/sh -c '
kill -s SIGTERM $SSH_AGENT_PID;
cd mantl/{commit};
{destroy};
cd ..;
rm -fr {commit}'
        '''
        destroy_cmd = ssh_cmd.format(destroy=destroy_cmd,
                keypath='/local/ci',
                ssh_port=os.environ['OS_PRT'],
                ssh_ip=os.environ['OS_IP'],
                commit=os.environ['CI_HEAD_COMMIT'])
        destroy_cmd = " ".join(destroy_cmd.splitlines())
    else:
        logging.info("Destroying cloud provider resources")
        link_or_generate_ssh_keys()
        call("ssh-add")
        link_ci_terraform_file()


    exit(call(split(destroy_cmd)))
Cleanup after ci_build
dataset/ETHPy150Open CiscoCloud/mantl/docker.py/ci_destroy