mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Fetch one result when expecting one result
This commit is contained in:
parent
1a5127d68b
commit
1e3f75aa0c
@ -93,7 +93,7 @@ def get_load(jid):
|
||||
WHERE `jid` = '%s';'''
|
||||
|
||||
cur.execute(sql, (jid,))
|
||||
data = cur.fetchall()
|
||||
data = cur.fetchone()
|
||||
if data:
|
||||
return json.loads(data)
|
||||
return {}
|
||||
@ -111,7 +111,7 @@ def get_jid(jid):
|
||||
WHERE `jid` = '%s';'''
|
||||
|
||||
cur.execute(sql, (jid,))
|
||||
data = cur.fetchall()
|
||||
data = cur.fetchone()
|
||||
ret = {}
|
||||
if data:
|
||||
for minion, full_ret in data:
|
||||
|
Loading…
Reference in New Issue
Block a user