'Wait until a task is finished'

def _wait_task_end(self, tid):

    timeout = 0
    while (self.remote.get_task_status(tid)[2] != EVENT_COMPLETE):
        print ('task    %s    status:    %s' % (tid, self.remote.get_task_status(tid)))
        time.sleep(5)
        timeout += 5
        if (timeout == 60):
            raise Exception
