creds may be a single cred or list of creds
authorTony Mack <tmack@paris.CS.Princeton.EDU>
Wed, 24 Nov 2010 21:50:41 +0000 (16:50 -0500)
committerTony Mack <tmack@paris.CS.Princeton.EDU>
Wed, 24 Nov 2010 21:50:41 +0000 (16:50 -0500)
sfa/managers/slice_manager_pl.py

index a888521..756800c 100644 (file)
@@ -351,7 +351,10 @@ def get_rspec(api, creds, options):
     # get hrn of the original caller
     origin_hrn = options.get('origin_hrn', None)
     if not origin_hrn:
-        origin_hrn = Credential(string=creds[0]).get_gid_caller().get_hrn()
+        if isinstance(creds, list):
+            origin_hrn = Credential(string=creds[0]).get_gid_caller().get_hrn()
+        else:
+            origin_hrn = Credential(string=creds).get_gid_caller().get_hrn()
     
     # look in cache first 
     if api.cache and not xrn: