Commit 2240b14e authored by Kirk Webb's avatar Kirk Webb
Browse files

A couple of minor fixups:

* the python mysql client returns a datetime object rather than a string
  sequence - must convert it to string

* PLAB moved the URL to their programmatic API - adjusted on our end.

* PLAB changed format of expiration time in listSlices() RPC from a
  datetime string to seconds since the epoch in UTC.

There is still an outstanding issue that I have mailed plab support about:
The listSlices() RPC is only returning the first entry in the list of slices
we have allocated at PLC (the same call used to grab all slice entries).
This is causing us to fail on renewal for the unlisted slices.
parent 5895ccf2
......@@ -760,7 +760,7 @@ class Slice:
assert (len(res) == 1), \
"Multiple slices found for %s-%s" % (self.pid, self.eid)
((self.slicename, self.slicemeta, self.leaseend), ) = res
self.leaseend = calendar.timegm(time.strptime(self.leaseend,
self.leaseend = calendar.timegm(time.strptime(str(self.leaseend),
"%Y-%m-%d %H:%M:%S"))
return
......
......@@ -25,7 +25,7 @@ debug = 0
#
# PLC constants
#
DEF_PLC_URI = "https://www.planet-lab.org/db/slices/dynamicprog.php"
DEF_PLC_URI = "https://www.planet-lab.org/PLCAPI/"
DEF_PLC_USER = "lepreau@cs.utah.edu"
DEF_PLC_PASS = "phurds" # XXX: hardcoded, cleartext passwds bad.
......@@ -358,8 +358,8 @@ class mod_PLC:
print "Slice %s unknown to PLC" % slicename
return None
exptime = self.__sliceexpdict[slicename]['expires']
leaseend = calendar.timegm(time.strptime(exptime, "%Y-%m-%d %H:%M:%S"))
leaseend = self.__sliceexpdict[slicename]['expires']
# leaseend = calendar.timegm(time.strptime(exptime, "%Y-%m-%d %H:%M:%S"))
return 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