

def returner(ret):
    '\n    Return data to a mysql server\n    '
    try:
        with _get_serv(ret, commit=True) as cur:
            sql = 'INSERT INTO `salt_returns`\n                    (`fun`, `jid`, `return`, `id`, `success`, `full_ret` )\n                    VALUES (%s, %s, %s, %s, %s, %s)'
            cur.execute(sql, (ret['fun'], ret['jid'], json.dumps(ret['return']), ret['id'], ret.get('success', False), json.dumps(ret)))
    except salt.exceptions.SaltMasterError as exc:
        log.critical(exc)
        log.critical('Could not store return with MySQL returner. MySQL server unavailable.')

dataset/ETHPy150Open saltstack/salt/salt/returners/mysql.py returner/original