def _gen_jid(cur):
 jid = salt.utils.jid.gen_jid()
 sql = 'SELECT jid FROM jids WHERE jid = %s'
 cur.execute(sql, (jid,))
 data = cur.fetchall()
 if (not data):
  return jid
 return None

def _gen_jid ( cur ) : jid = salt . utils . jid . gen_jid ( ) sql = 'SELECT jid FROM jids WHERE jid = %s' cur . execute ( sql , ( jid , ) ) data = cur . fetchall ( ) if ( not data ) : return jid return None
generate an unique job id .