Commit a7f6662e authored by Leigh B. Stoller's avatar Leigh B. Stoller
Browse files

If no matching rows, return () instead of None so that it looks like

a query that succeeded but did not return any matches.
parent f1cff944
# -*- python -*-
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2003 University of Utah and the Flux Group.
# Copyright (c) 2000-2004 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -82,6 +82,9 @@ def DBQuery(queryPat, querySub = (), asDict = False):
if len(rs) > 60:
rs = rs[:60] + "..."
print "Result: %s" % rs
pass
if ret == None:
return ()
return ret
except MySQLdb.MySQLError:
tries -= 1
......
# -*- python -*-
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2003 University of Utah and the Flux Group.
# Copyright (c) 2000-2004 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -82,6 +82,9 @@ def DBQuery(queryPat, querySub = (), asDict = False):
if len(rs) > 60:
rs = rs[:60] + "..."
print "Result: %s" % rs
pass
if ret == None:
return ()
return ret
except MySQLdb.MySQLError:
tries -= 1
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment