|
From: Robert S. <ml-...@ep...> - 2002-08-09 07:39:40
|
Hi!
I do not know if I make something wrong here, but it seems to me that
asynchronous searching does not find referrals in the tree. The example
code as follows:
#!/usr/bin/python
import ldap
l=ldap.initialize('ldap://ldap-hm')
l.set_option(ldap.OPT_PROTOCOL_VERSION,ldap.VERSION3)
l.set_option(ldap.OPT_REFERRALS,0)
result = l.search('o=epigenomics',ldap.SCOPE_ONELEVEL,'(objectClass=*)')
while 1:
result_type, result_data = l.result(result, 0)
if result_type == ldap.RES_SEARCH_ENTRY:
print result_data
elif result_type == ldap.RES_SEARCH_RESULT:
print result_data
break
print
for i in
l.search_s('o=epigenomics',ldap.SCOPE_ONELEVEL,'(objectClass=*)'):
print i
And the output is:
defiant gurubert 43 (/tmp): ./test.py
[('cn=admin,o=epigenomics', {'objectClass': ['person'], 'sn': ['admin'], 'cn': ['admin']})]
[('cn=updated,o=epigenomics', {'objectClass': ['person'], 'sn': ['updated'], 'cn': ['updated']})]
[('cn=readout,o=epigenomics', {'objectClass': ['person'], 'sn': ['readout'], 'cn': ['readout']})]
[('c=de,o=epigenomics', {'c': ['de'], 'objectClass': ['country']})]
[('c=us,o=epigenomics', {'c': ['us'], 'objectClass': ['country']})]
[('ou=groups,o=epigenomics', {'ou': ['groups'], 'objectClass': ['organizationalUnit']})]
[('ou=autofs,o=epigenomics', {'ou': ['autofs'], 'objectClass': ['organizationalUnit']})]
[('cn=gchange,o=epigenomics', {'objectClass': ['person'], 'sn': ['GroupChange'], 'cn': ['gchange']})]
[('ou=testtree,o=epigenomics', {'ou': ['testtree'], 'objectClass': ['organizationalUnit']})]
None
('cn=admin,o=epigenomics', {'objectClass': ['person'], 'sn': ['admin'], 'cn': ['admin']})
('cn=updated,o=epigenomics', {'objectClass': ['person'], 'sn': ['updated'], 'cn': ['updated']})
('cn=readout,o=epigenomics', {'objectClass': ['person'], 'sn': ['readout'], 'cn': ['readout']})
('c=de,o=epigenomics', {'c': ['de'], 'objectClass': ['country']})
('c=us,o=epigenomics', {'c': ['us'], 'objectClass': ['country']})
('ou=groups,o=epigenomics', {'ou': ['groups'], 'objectClass': ['organizationalUnit']})
('ou=autofs,o=epigenomics', {'ou': ['autofs'], 'objectClass': ['organizationalUnit']})
('cn=gchange,o=epigenomics', {'objectClass': ['person'], 'sn': ['GroupChange'], 'cn': ['gchange']})
(None, ['ldap://ldap-hm/ou=Inc,o=epigenomics'])
('ou=testtree,o=epigenomics', {'ou': ['testtree'], 'objectClass': ['organizationalUnit']})
This makes it impossible to use asynchronous searching on a tree with
referrals implemented.
Greetings
--
Robert Sander
Manager
Information Systems www.epigenomics.com Kastanienallee 24
+493024345330 10435 Berlin
|
|
From: <mi...@st...> - 2002-08-09 09:04:20
|
Robert Sander wrote: > > I do not know if I make something wrong here, but it seems to me that > asynchronous searching does not find referrals in the tree. Uuumh, there might be some issues with search continuations. I saw some of my async demos even lock up completely. Which version are you using? But it seems it works for me. web2ldap does make extensive use of async search when browsing (for nice handling of partial results and such). Ciao, Michael. |
|
From: Robert S. <ml-...@ep...> - 2002-08-09 09:08:14
|
On Fri, 9 Aug 2002 09:06:43 +0000 (UTC), Michael Ströder <mi...@st...> wrote: > Uuumh, there might be some issues with search continuations. I saw > some of my async demos even lock up completely. Which version are > you using? It's from the Debian package version 1.9.999.pre04-1 which is python-ldap version 2.0.0-pre04 I think. Greetings -- Robert Sander Manager Information Systems www.epigenomics.com Kastanienallee 24 +493024345330 10435 Berlin |
|
From: <mi...@st...> - 2002-08-09 09:18:53
|
Robert Sander wrote: > On Fri, 9 Aug 2002 09:06:43 +0000 (UTC), > Michael Str=F6der <mi...@st...> wrote: >=20 >>Uuumh, there might be some issues with search continuations. I saw=20 >>some of my async demos even lock up completely. Which version are=20 >>you using? >=20 > It's from the Debian package version 1.9.999.pre04-1 which is > python-ldap version 2.0.0-pre04 I think. There was a fix related to this. You should at least use 2.0.0-pre05. Ciao, Michael. |
|
From: Robert S. <ml-...@ep...> - 2002-08-09 22:20:56
|
On Fri, 9 Aug 2002 09:20:39 +0000 (UTC),
Michael Ströder <mi...@st...> wrote:
> There was a fix related to this. You should at least use 2.0.0-pre05.
I tried 2.0.0-pre05 with the same result:
import ldap
print ldap.__version__
l=ldap.initialize('ldap://ldap-hm')
l.set_option(ldap.OPT_PROTOCOL_VERSION,ldap.VERSION3)
l.set_option(ldap.OPT_REFERRALS,0)
result = l.search('o=epigenomics',ldap.SCOPE_ONELEVEL,'(objectClass=*)')
while 1:
result_type, result_data = l.result(result, 0)
if result_type == ldap.RES_SEARCH_ENTRY:
print result_data
elif result_type == ldap.RES_SEARCH_RESULT:
print result_data
break
print
for i in
l.search_s('o=epigenomics',ldap.SCOPE_ONELEVEL,'(objectClass=*)'):
print i
Output:
2.0.0pre05
[('cn=admin,o=epigenomics', {'objectClass': ['person'], 'sn': ['admin'], 'cn': ['admin']})]
[('cn=updated,o=epigenomics', {'objectClass': ['person'], 'sn': ['updated'], 'cn': ['updated']})]
[('cn=readout,o=epigenomics', {'objectClass': ['person'], 'sn': ['readout'], 'cn': ['readout']})]
[('c=de,o=epigenomics', {'c': ['de'], 'objectClass': ['country']})]
[('c=us,o=epigenomics', {'c': ['us'], 'objectClass': ['country']})]
[('ou=groups,o=epigenomics', {'ou': ['groups'], 'objectClass': ['organizationalUnit']})]
[('ou=autofs,o=epigenomics', {'ou': ['autofs'], 'objectClass': ['organizationalUnit']})]
[('cn=gchange,o=epigenomics', {'objectClass': ['person'], 'sn': ['GroupChange'], 'cn': ['gchange']})]
[('ou=testtree,o=epigenomics', {'ou': ['testtree'], 'objectClass': ['organizationalUnit']})]
[]
('cn=admin,o=epigenomics', {'objectClass': ['person'], 'sn': ['admin'], 'cn': ['admin']})
('cn=updated,o=epigenomics', {'objectClass': ['person'], 'sn': ['updated'], 'cn': ['updated']})
('cn=readout,o=epigenomics', {'objectClass': ['person'], 'sn': ['readout'], 'cn': ['readout']})
('c=de,o=epigenomics', {'c': ['de'], 'objectClass': ['country']})
('c=us,o=epigenomics', {'c': ['us'], 'objectClass': ['country']})
('ou=groups,o=epigenomics', {'ou': ['groups'], 'objectClass': ['organizationalUnit']})
('ou=autofs,o=epigenomics', {'ou': ['autofs'], 'objectClass': ['organizationalUnit']})
('cn=gchange,o=epigenomics', {'objectClass': ['person'], 'sn': ['GroupChange'], 'cn': ['gchange']})
('ou=testtree,o=epigenomics', {'ou': ['testtree'], 'objectClass': ['organizationalUnit']})
(None, ['ldap://ldap-hm/ou=Inc,o=epigenomics'])
Greetings
--
Robert Sander
Manager
Information Systems www.epigenomics.com Kastanienallee 24
+493024345330 10435 Berlin
|
|
From: <mi...@st...> - 2002-08-09 22:36:00
|
Robert Sander wrote: > On Fri, 9 Aug 2002 09:20:39 +0000 (UTC), > Michael Str=F6der <mi...@st...> wrote: >=20 >>There was a fix related to this. You should at least use 2.0.0-pre05. >=20 > I tried 2.0.0-pre05 with the same result: Hmm, not sure when the fix was exactly. Can you please test also=20 the recent CVS version? There's a temporary tar.gz of today's snapshot on http://web2ldap.de/download.html Ciao, Michael. |
|
From: <mi...@st...> - 2002-08-09 22:44:26
|
Robert Sander wrote:
> On Fri, 9 Aug 2002 09:20:39 +0000 (UTC),
> Michael Str=F6der <mi...@st...> wrote:
>=20
>>There was a fix related to this. You should at least use 2.0.0-pre05.
>=20
> I tried 2.0.0-pre05 with the same result:
Sometimes the solutions is too obvious. ;-)
It definitely helps to display the search references. Add this line:
elif result_type =3D=3D ldap.RES_SEARCH_REFERENCE:
print result_data
Also I'd like to suggest to make use of the very handy parameter=20
trace_level:
l=3Dldap.initialize('ldap://ldap.rediris.es',trace_level=3D1)
Ciao, Michael.
|
|
From: <mi...@st...> - 2002-08-09 22:46:25
|
Michael Str=F6der wrote: > Sometimes the solutions is too obvious. ;-) >=20 > It definitely helps to display the search references. Add this line: >=20 > elif result_type =3D=3D ldap.RES_SEARCH_REFERENCE: > print result_data And did I mention ldap.async? That is a convenience module exactly=20 to avoid having to deal with it yourself. Ciao, Michael. |