Browse Source

draft for CALookup item getter

master
Edoardo Putti 8 years ago
parent
commit
8d0ad7db5f
1 changed files with 6 additions and 11 deletions
  1. +6
    -11
      lookup.py

+ 6
- 11
lookup.py View File

@ -43,17 +43,12 @@ class CALookup:
def __getitem__(self, ca_id):
if SSHAuthority(ca_id):
return SSHAuthority(ca_id)
elif SSLAuthority(ca_id):
return SSLAuthority(ca_id)
else:
raise IndexError('Unknown CA "%s"' % ca_id)
for authority_type in self.allowed_auth:
try:
ca = authority_type.get(authority_type.ca_id == ca_id)
return ca
except authority_type.DoesNotExist:
continue
class RequestLookup:
"""


Loading…
Cancel
Save