Commit ed848fd5 authored by Kirk Webb's avatar Kirk Webb

Couple of items:

* Small fix to DBQueryFatal in libdb.py: () is a valid return value,
  don't fail on it(insert/replace); do fail if DBQuery returns None though.

* Fix up libplab.py to not choke on new plab_slices column.
parent c9fc67a6
......@@ -101,6 +101,6 @@ def DBQuery(queryPat, querySub = (), asDict = False):
def DBQueryFatal(*args):
ret = DBQuery(*args)
if ret:
return ret
raise RuntimeError, "DBQueryFatal failed"
if ret == None:
raise RuntimeError, "DBQueryFatal failed"
return ret
......@@ -101,6 +101,6 @@ def DBQuery(queryPat, querySub = (), asDict = False):
def DBQueryFatal(*args):
ret = DBQuery(*args)
if ret:
return ret
raise RuntimeError, "DBQueryFatal failed"
if ret == None:
raise RuntimeError, "DBQueryFatal failed"
return ret
......@@ -742,6 +742,7 @@ class Slice:
self.plab.agent.createSlice(self)
DBQueryFatal("insert into plab_slices"
" (pid, eid, slicename, slicemeta, leaseend)"
" values (%s, %s, %s, %s, FROM_UNIXTIME(%s))",
(self.pid, self.eid, self.slicename,
self.slicemeta, self.leaseend))
......@@ -786,6 +787,7 @@ class Slice:
self.plab.agent.renewSlice(self)
DBQueryFatal("replace into plab_slices"
" (pid, eid, slicename, slicemeta, leaseend)"
" values (%s, %s, %s, %s, FROM_UNIXTIME(%s))",
(self.pid, self.eid, self.slicename,
self.slicemeta, self.leaseend))
......
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