@staticmethod
def _enqueue_output(stream, queue):
    """
        Add chunks of data from a stream to a queue until the stream is empty.
        """
    for line in iter(lambda : stream.read(4096), b''):
        queue.put(line)
    stream.close()
