def wait_for_command(logs_generator):
    """
    using given generator, wait for it to raise StopIteration, which
    indicates that docker has finished with processing

    :return: list of str, logs
    """
    logger.info("wait_for_command")
    cr = CommandResult()
    while True:
        try:
            item = next(logs_generator)  # py2 & 3 compat
            cr.parse_item(item)
        except __HOLE__:
            logger.info("no more logs")
            break
    return cr
dataset/ETHPy150Open projectatomic/atomic-reactor/atomic_reactor/util.py/wait_for_command