def prep_jid(nocache=False, passed_jid=None):
    if passed_jid is None:
        jid = salt.utils.jid.gen_jid()
    else:
        jid = passed_jid

    cb_ = _get_connection()

    try:
        cb_.add(str(jid),
               {'nocache': nocache},
               ttl=_get_ttl(),
               )
    except couchbase.exceptions.KeyExistsError:
        # TODO: some sort of sleep or something? Spinning is generally bad practice
        if passed_jid is None:
            return prep_jid(nocache=nocache)

    return jid
Return a job id and prepare the job id directory
dataset/ETHPy150Open saltstack/salt/salt/returners/couchbase_return.py/prep_jid