From: Tony Mack Date: Sat, 21 Aug 2010 01:04:41 +0000 (+0000) Subject: getDelegatedCred returns a single credential or None, not a list of credentials. X-Git-Tag: sfa-1.0-0~27 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=873a81f31f87c8273548764f3964ee1fa2b45cc7;p=sfa.git getDelegatedCred returns a single credential or None, not a list of credentials. --- diff --git a/sfa/plc/api.py b/sfa/plc/api.py index 380ca6b4..25df830a 100644 --- a/sfa/plc/api.py +++ b/sfa/plc/api.py @@ -137,8 +137,12 @@ class SfaAPI(BaseAPI): Attempt to find a credential delegated to us in the specified list of creds. """ - if creds and not isinstance(creds, list): creds = [creds] - return filter_creds_by_caller(creds,self.hrn) + if creds and not isinstance(creds, list): + creds = [creds] + delegated_creds = filter_creds_by_caller(creds,self.hrn) + if not delegated_creds: + return None + return delegated_creds[0] def getCredentialFromRegistry(self): """