'Get or create task by uuid.'

def get_or_create_task(self, uuid):

    try:
        return (self.tasks[uuid], False)
    except KeyError:
        task = self.tasks[uuid] = self.Task(uuid, cluster_state=self)
        return (task, True)
