Fetch one result when expecting one result

This commit is contained in:
David Boucha 2012-11-21 14:28:27 -07:00
parent 1a5127d68b
commit 1e3f75aa0c

View File

@ -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: