Hi Michele, Have a look at this http://www.grotan.com/ldap/python-ldap-samples.html I thought it was pretty helpful. It's easier to build the ldif using the modlist.
Ron > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:python-ldap- > [EMAIL PROTECTED] On Behalf Of Michele Petrazzo - Unipex > srl > Sent: Saturday, June 07, 2008 3:09 AM > To: python-ldap-dev@lists.sourceforge.net > Subject: Problem on add > > Hi list, > I'm trying, for the first time, to use python-ldap and I find some > problems on add. I have a code that are, more or less: > > LDAP_BASE_DN = "dc=unipex,dc=it" > > ldif = [('dn', 'cn=A name,ou=People,dc=unipex,dc=it'), ('cn', 'A name'), > ('objectclass', ['top', 'person', 'inetOrgPerson', > 'organizationalPerson', 'mozillaOrgPerson']), ('sn', 'A name'), ('mail', > '[EMAIL PROTECTED]'), ('givenName', 'Michele')] > > > l.add_s(LDAP_BASE_DN, ldif) > > And I receive: > > ldap.UNDEFINED_TYPE: {'info': 'dn: attribute type undefined', 'desc': > 'Undefined attribute type'} > d > > > But if I save the same data into a ldif file and add it with: > ldapadd -xv -D "cn=admin,dc=unipex,dc=it" -f test_entry.ldif -W > > it works! > > What can I try or where look for solve it? > > Thanks, > Michele > > P.s. I trying to add an ldif data into ldap with mozilla scheme > > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://sourceforge.net/services/buy/index.php > _______________________________________________ > Python-LDAP-dev mailing list > Python-LDAP-dev@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/python-ldap-dev ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ Python-LDAP-dev mailing list Python-LDAP-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/python-ldap-dev