if record['first_name'] != record['last_name']:
req_ldapdict['cn'] = str(record['first_name'])+" "\
+ str(record['last_name'])
+ if 'uid' in record:
+ req_ldapdict['uid'] = record['uid']
if 'email' in record:
req_ldapdict['mail'] = record['email']
if 'mail' in record:
#then the login is different from the one found in its hrn
if tmpname != hrn.split('.')[1]:
hrn = None
+ else:
+ hrn = None
+
+ if hrn is None:
results = {
'type': 'user',
'pkey': ldapentry['sshPublicKey'],
'authority': parent_hrn,
'peer_authority': peer_authority,
'pointer': -1,
- 'hrn': hrn,
}
else:
#hrn = None
'authority': parent_hrn,
'peer_authority': peer_authority,
'pointer': -1,
+ 'hrn': hrn,
}
return results