Fixed default credential time in credential.py to two weeks
authorJosh Karlin <jkarlin@bbn.com>
Tue, 12 Oct 2010 18:47:30 +0000 (14:47 -0400)
committerJosh Karlin <jkarlin@bbn.com>
Tue, 12 Oct 2010 18:47:30 +0000 (14:47 -0400)
sfa/managers/slice_manager_pl.py
sfa/trust/credential.py

index 45d961c..0c81f37 100644 (file)
@@ -35,10 +35,10 @@ def slice_status(api, slice_xrn, creds ):
     # find out where this slice is currently running
     api.logger.info(hrn)
     slicename = hrn_to_pl_slicename(hrn)
-    
+    api.logger.info("Checking status for %s" % slicename)
     slices = api.plshell.GetSlices(api.plauth, [slicename], ['node_ids','person_ids','name','expires'])
     if len(slices) == 0:        
-        raise Exception("Slice %s not found (used %s as slicename internally)" % slice_xrn, slicename)
+        raise Exception("Slice %s not found (used %s as slicename internally)" % (slice_xrn, slicename))
     slice = slices[0]
     
     nodes = api.plshell.GetNodes(api.plauth, slice['node_ids'],
index c09f1bf..b46a655 100644 (file)
@@ -399,7 +399,7 @@ class Credential(object):
         append_sub(doc, cred, "target_urn", self.gidObject.get_urn())
         append_sub(doc, cred, "uuid", "")
         if not self.expiration:
-            self.set_expiration(datetime.datetime.utcnow() + datetime.timedelta(DEFAULT_CREDENTIAL_LIFETIME))
+            self.set_expiration(datetime.datetime.utcnow() + datetime.timedelta(seconds=DEFAULT_CREDENTIAL_LIFETIME))
         self.expiration = self.expiration.replace(microsecond=0)
         append_sub(doc, cred, "expires", self.expiration.isoformat())
         privileges = doc.createElement("privileges")