def _exit_code(results):
    for v in results.values():
        # No exception, inspect the next value.
        if v is None:
            continue

        # The value is a dict resulting from calling fabric.tasks.execute.
        # Check the results recursively
        if type(v) is dict:
            exit_code = _exit_code(v)
            if exit_code != 0:
                return exit_code
            continue

        # In any case where things were OK above, we've continued the loop. At
        # this point, we know something failed.
        return 1
    return 0
results from run_tasks take the form of a dict with one or more entries
dataset/ETHPy150Open prestodb/presto-admin/prestoadmin/main.py/_exit_code