Skip to content

Commit 3f5805f

Browse files
committed
fixed bug: key['success'] error when schedule return
based on return to judge if the schedule is success execute
1 parent f137a5b commit 3f5805f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

salt/returners/mysql.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ def returner(ret):
112112
sql = '''INSERT INTO `salt_returns`
113113
(`fun`, `jid`, `return`, `id`, `success`, `full_ret` )
114114
VALUES (%s, %s, %s, %s, %s, %s)'''
115+
if len(ret['return']) == str(ret['return']).count("'result': True"):
116+
ret['success'] = True
115117
cur.execute(sql, (ret['fun'], ret['jid'],
116118
str(ret['return']), ret['id'],
117119
ret['success'], json.dumps(ret)))

0 commit comments

Comments
 (0)