ich habe folgendes Konstrukt:
Code: Alles auswählen
[...]('uid=xyz', {'apple-generateduid': ['xyz'], 'loginShell': ['xyz'], 'uid': ['xyz'], 'cn': ['xyz']})
('uid=xyz', {'apple-generateduid': ['xyz'], 'loginShell': ['xyz'], 'telephoneNumber': ['157'], 'uid': ['xyz'], 'cn': ['xyz']})[...]
Code: Alles auswählen
for result in results:
(a, b) = result
name = b['cn'][0]
uid = b['uid'][0]
guid = b['apple-generateduid'][0]
tel = b['telephoneNumber'][0]
shell = b['loginShell'][0]
Code: Alles auswählen
[...]
tel = b['telephoneNumber'][0]
KeyError: 'telephoneNumber'