one more fix to renewsliver
[sfa.git] / sfa / methods / RenewSliver.py
index 7233d0f..3b965ff 100644 (file)
@@ -3,7 +3,6 @@ from sfa.util.namespace import *
 from sfa.util.method import Method
 from sfa.util.parameter import Parameter
 from sfa.trust.credential import Credential
-from dateutil.parser import parse
 
 class RenewSliver(Method):
     """
@@ -13,7 +12,7 @@ class RenewSliver(Method):
     @param expiration_time (string) requested time of expiration
     
     """
-    interfaces = ['aggregate', 'slicemgr', 'geni_am']
+    interfaces = ['aggregate', 'slicemgr']
     accepts = [
         Parameter(str, "Slice URN"),
         Parameter(type([str]), "List of credentials"),
@@ -31,11 +30,11 @@ class RenewSliver(Method):
 
         # Validate that the time does not go beyond the credential's expiration time
         requested_time = parse(expiration_time)
-        if requested_time > Credential(string=valid_creds[0]).get_lifetime():
+        if requested_time > Credential(string=valid_creds[0]).get_expiration():
             raise InsufficientRights('SliverStatus: Credential expires before requested expiration time')
        
         manager = self.api.get_interface_manager()
-        manager.renew_slice(self.api, xrn, valid_creds, requested_time)    
+        manager.renew_slice(self.api, slice_xrn, valid_creds, expiration_time)    
  
         return 1