From 3f5805f7b38fc867a3d12b8c36efd023b4957792 Mon Sep 17 00:00:00 2001 From: halfss Date: Sat, 1 Jun 2013 14:08:20 +0800 Subject: [PATCH] fixed bug: key['success'] error when schedule return based on return to judge if the schedule is success execute --- salt/returners/mysql.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/salt/returners/mysql.py b/salt/returners/mysql.py index 4efb119fc9af..4ed50ce0515b 100644 --- a/salt/returners/mysql.py +++ b/salt/returners/mysql.py @@ -112,6 +112,8 @@ def returner(ret): sql = '''INSERT INTO `salt_returns` (`fun`, `jid`, `return`, `id`, `success`, `full_ret` ) VALUES (%s, %s, %s, %s, %s, %s)''' + if len(ret['return']) == str(ret['return']).count("'result': True"): + ret['success'] = True cur.execute(sql, (ret['fun'], ret['jid'], str(ret['return']), ret['id'], ret['success'], json.dumps(ret)))