lowercase attributes in dn of LDIF sources

This commit is contained in:
Benjamin Dauvergne 2016-02-19 16:29:38 +01:00
parent 7feabe70e7
commit 3f7c3376b0
1 changed files with 5 additions and 1 deletions

View File

@ -1,7 +1,8 @@
import ldap
import ldif
from ldap.dn import dn2str
from ldaptools.utils import idict
from ldaptools.utils import idict, str2dn
class ListLDIFParser(ldif.LDIFParser):
@ -10,6 +11,9 @@ class ListLDIFParser(ldif.LDIFParser):
ldif.LDIFParser.__init__(self, *args, **kwargs)
def handle(self, dn, entry):
dn = str2dn(dn)
dn = [[(part[0].lower(),) + part[1:] for part in rdn] for rdn in dn]
dn = dn2str(dn)
self.entries.append((dn, entry))
def add(self, conn):