示例#1
0
def task_by_id(object_id):
    result = generic.object_by_id(object_type, object_id)

    if flask.request.method == "PUT":
        api = api_from_models()
        task = api.task_get_by_id(object_id)
        if "node_id" in task:
            flask.current_app.logger.debug("Task: %s" % task)
            task_semaphore = "task-for-%s" % task["node_id"]
            flask.current_app.logger.debug("notifying event %s" % task_semaphore)
            utility.notify(task_semaphore)

    return result
示例#2
0
def task_by_id(object_id):
    result = generic.object_by_id(object_type, object_id)

    if flask.request.method == 'PUT':
        api = api_from_models()
        task = api.task_get_by_id(object_id)
        if 'node_id' in task:
            flask.current_app.logger.debug('Task: %s' % task)
            task_semaphore = 'task-for-%s' % task['node_id']
            flask.current_app.logger.debug('notifying event %s' %
                                           task_semaphore)
            utility.notify(task_semaphore)

    return result
示例#3
0
def by_id(object_id):
    return generic.object_by_id(object_type, object_id)