@app.route('/delete', methods=['POST'])
def delete():
    data = request.get_json()
    source_ip = data['source_ip']
    destination_host = data['destination_host']

    logger.debug('Deleting sniffer (source_ip : {}, destination_host: {})...'.format(source_ip, destination_host))

    # Get the sniffer object and its source_ip and destination_host, if exists
    try:
        sniffer = sniffers[(source_ip, destination_host)]
    except KeyError:
        msg = '(get_sniff) 404 Not found: Sniffer (source_ip : {}, destination_host: {})'.format(source_ip, destination_host)
        logger.warning(msg)
        return msg, 404

    # Stop the sniffer capture and wait for the thread to join
    sniffer.stop()
    sniffer.join()

    # Delete the sniffer entries from both dictionaries
    del sniffers[(source_ip, destination_host)]

    msg = '(get_sniff) Sniffer (source_ip : {}, destination_host: {}) was deleted.'.format(source_ip, destination_host)
    logger.debug(msg)

    return msg, 200
Launch python script with 'this' interpreter
dataset/ETHPy150Open dionyziz/rupture/sniffer/sniff.py/delete--crossover with--dataset/ETHPy150Open ipython/ipython-py3k/IPython/quarantine/ipy_rehashdir.py/selflaunch