git://git.onelab.eu
/
sfa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b896ad8
)
filter_creds_by_caller() supports list args
author
Tony Mack
<tmack@paris.CS.Princeton.EDU>
Mon, 17 Oct 2011 02:16:32 +0000
(22:16 -0400)
committer
Tony Mack
<tmack@paris.CS.Princeton.EDU>
Mon, 17 Oct 2011 02:16:32 +0000
(22:16 -0400)
sfa/trust/credential.py
patch
|
blob
|
history
diff --git
a/sfa/trust/credential.py
b/sfa/trust/credential.py
index
575911b
..
a18019d
100644
(file)
--- a/
sfa/trust/credential.py
+++ b/
sfa/trust/credential.py
@@
-209,17
+209,19
@@
class Signature(object):
# not be changed else the signature is no longer valid. So, once
\r
# you have loaded an existing signed credential, do not call encode() or sign() on it.
\r
\r
# not be changed else the signature is no longer valid. So, once
\r
# you have loaded an existing signed credential, do not call encode() or sign() on it.
\r
\r
-def filter_creds_by_caller(creds, caller_hrn):
\r
+def filter_creds_by_caller(creds, caller_hrn
_list
):
\r
"""
\r
Returns a list of creds who's gid caller matches the
\r
specified caller hrn
\r
"""
\r
if not isinstance(creds, list): creds = [creds]
\r
"""
\r
Returns a list of creds who's gid caller matches the
\r
specified caller hrn
\r
"""
\r
if not isinstance(creds, list): creds = [creds]
\r
+ if not isinstance(caller_hrn_list, list):
\r
+ caller_hrn_list = [caller_hrn_list]
\r
caller_creds = []
\r
for cred in creds:
\r
try:
\r
tmp_cred = Credential(string=cred)
\r
caller_creds = []
\r
for cred in creds:
\r
try:
\r
tmp_cred = Credential(string=cred)
\r
- if tmp_cred.get_gid_caller().get_hrn()
== caller_hrn
:
\r
+ if tmp_cred.get_gid_caller().get_hrn()
in caller_hrn_list
:
\r
caller_creds.append(cred)
\r
except: pass
\r
return caller_creds
\r
caller_creds.append(cred)
\r
except: pass
\r
return caller_creds
\r