From: Michael S. <mi...@st...> - 2009-07-13 09:51:41
|
Michael Ströder wrote: > Thorsten Kampe wrote: >> [4]>>> connection.search_s('ou=system', ldap.SCOPE_SUBTREE, >> filterstr='(cn=*)', attrlist = ['cn'], attrsonly = True) > > Just a wild guess: Could you please try again with attrsonly=1. Note > that this API has its roots in Python 1.x times where there was no > Boolean True/False type. It would be worth handling that gracefully though. Which versions of Python and python-ldap are you using? I've tested it with my local OpenLDAP server with Python 2.6 and python-ldap 2.3.8 built against OpenLDAP RE24 libs: >>> l.search_ext_s('dc=stroeder,dc=de',0,'(objectclass=*)',attrsonly=0) [('dc=stroeder,dc=de', {'description': ['Wurzeleintrag f\xc3\xbcr lokales Adressbuch von Michael Str\xc3\xb6der'], 'labeledURI': ['http://www.stroeder.de', 'http://www.block-floete.de'], 'objectClass': ['domain', 'labeledURIObject', 'domainRelatedObject'], 'associatedDomain': ['stroeder.com'], 'dc': ['stroeder'], 'o': ['Michaels'], 'seeAlso': ['dc=stroeder,dc=com']})] >>> l.search_ext_s('dc=stroeder,dc=de',0,'(objectclass=*)',attrsonly=1) [('dc=stroeder,dc=de', {'description': [], 'labeledURI': [], 'objectClass': [], 'associatedDomain': [], 'dc': [], 'o': [], 'seeAlso': []})] >>> l.search_ext_s('dc=stroeder,dc=de',0,'(objectclass=*)',attrsonly=True) [('dc=stroeder,dc=de', {'description': [], 'labeledURI': [], 'objectClass': [], 'associatedDomain': [], 'dc': [], 'o': [], 'seeAlso': []})] So it seems that it simply works. Ciao, Michael. |