def returner(load):
    cb_ = _get_connection()
    try:
        jid_doc = cb_.get(load['jid'])
        if jid_doc.value['nocache'] is True:
            return
    except couchbase.exceptions.NotFoundError:
        log.error(
            'An inconsistency occurred, a job was received with a job id '
            'that is not present in the local cache: {jid}'.format(**load)
        )
        return False

    hn_key = '{0}/{1}'.format(load['jid'], load['id'])
    try:
        ret_doc = {'return': load['return']}
        if 'out' in load:
            ret_doc['out'] = load['out']

        cb_.add(hn_key,
               ret_doc,
               ttl=_get_ttl(),
               )
    except couchbase.exceptions.KeyExistsError:
        log.error(
            'An extra return was detected from minion {0}, please verify '
            'the minion, this could be a replay attack'.format(
                load['id']
            )
        )
        return False
Return data to the local job cache
dataset/ETHPy150Open saltstack/salt/salt/returners/couchbase_return.py/returner