one more fix to renewsliver
[sfa.git] / sfa / managers / aggregate_manager_pl.py
index eca0c77..0b027e6 100644 (file)
@@ -21,6 +21,7 @@ import sfa.plc.peers as peers
 from sfa.plc.network import *
 from sfa.plc.api import SfaAPI
 from sfa.plc.slices import *
+from dateutil.parser import parse
 
 
 def __get_registry_objects(slice_xrn, creds, users):
@@ -189,8 +190,9 @@ def renew_slice(api, xrn, creds, expiration_time):
     if not slices:
         raise RecordNotFound(hrn)
     slice = slices[0]
-    slice['expires'] = expiration_time
-    api.plshell.UpdateSlice(api.plauth, slice['slice_id'], slice)
+    requested_time = parse(expiration_time)
+    record = {'expires': int(time.mktime(requested_time.timetuple()))}
+    api.plshell.UpdateSlice(api.plauth, slice['slice_id'], record)
     return 1         
 
 def start_slice(api, xrn, creds):