Convert ldap account entries to inetOrgPerson
The snippet can be accessed without any authentication.
Authored by
meskio
Edited
parser.py 476 B
#!/usr/bin/python
import sys
uid = ""
for line in sys.stdin:
line = line[:-1]
items = line.split(": ", 1)
if len(items) != 2:
print(line)
continue
if items[0] == "uid":
uid = items[1]
if items[1] == "account":
print("%s: %s" % (items[0], "inetOrgPerson"))
if items[0] == "structuralObjectClass":
print("sn: %s" % uid)
print("mail: %s@sindominio.net" % uid)
else:
print(line)
Please register or sign in to comment