X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FAuth.py;h=3be444bb7a9c5b8298290437499981db0b57b06e;hb=HEAD;hp=5479e25ee00c5e3f6681f0eebef1bc8042205fa0;hpb=f89e0221bc656c465f84aebc48e942f81f9550b2;p=plcapi.git diff --git a/PLC/Auth.py b/PLC/Auth.py index 5479e25..3be444b 100644 --- a/PLC/Auth.py +++ b/PLC/Auth.py @@ -21,6 +21,7 @@ from PLC.Nodes import Node, Nodes from PLC.Interfaces import Interface, Interfaces from PLC.Sessions import Session, Sessions from PLC.Peers import Peer, Peers +from PLC.Keys import Keys from PLC.Boot import notify_owners class Auth(Parameter): @@ -82,10 +83,10 @@ class GPGAuth(Auth): raise PLCAuthenticationFailure, "GPGAuth: Not allowed to call method, missing role" keys = Keys(method.api, {'key_id': person['key_ids'], 'key_type': "gpg", 'peer_id': None}) - gpg_keys = [ key['key'] for key in keys] + gpg_keys = [ key['key'] for key in keys ] - if not keys: - raise PLCAuthenticationFailure, "GPGAuth: No GPG key on record for peer or user '%s'" + if not gpg_keys: + raise PLCAuthenticationFailure, "GPGAuth: No GPG key on record for peer or user '%s'"%auth['name'] for gpg_key in gpg_keys: try: