lowercase attributes in dn of LDIF sources
This commit is contained in:
parent
7feabe70e7
commit
3f7c3376b0
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue