Hi All,
I'm seeing a weird problem using python-ldap under solaris with
webware as the app-server.
The python-ldap modules works fine under Solaris and linux if run from
the command line, and fine as a .cgi under apache. When running under
webware on Solaris, I'm getting a can't connect to ldap server error.
I've run this same code under webware on linux, and it works fine.
One of my first thoughts is solaris's linker, but I've added the
openldap lib dir to LD_LIBRARY_PATH and restarted webware...to the
same result.
Has anyone run into this?
I've tried solaris 8, solaris 10, and suse 9, all with the same
results. Works under linux under webware, pukes on the bind under
solaris.
The traceback is:
File "/usr/local/lib/python2.2/site-packages/ldap/ldapobject.py", line
183, in bind
return self.simple_bind(who,cred)
File "/usr/local/lib/python2.2/site-packages/ldap/ldapobject.py",
line 169, in simple_bind
return self._ldap_call(self._l.simple_bind,who,cred,serverctrls,clientctrls)
File "/usr/local/lib/python2.2/site-packages/ldap/ldapobject.py",
line 94, in _ldap_call
result = func(*args,**kwargs)
SERVER_DOWN: {'desc': "Can't contact LDAP server"}
The servlet code is:
#------------------------------------------------------------------
from ExamplePage import ExamplePage
from time import *
import ldap
class ShowTime(ExamplePage):
def __init__( self ):
ExamplePage.__init__( self )
self.searchScope = ldap.SCOPE_SUBTREE
self.baseDN_people = "ou=people,ou=global,dc=mycompany,dc=com"
def awake( self, trans ):
ExamplePage.awake( self, trans )
self.l = ldap.open( 'MYHOST.mydomain.com', 389 )
self.l.bind( "", "" )
def writeContent(self):
l = self.l
rattrs = None
resid = None
searchFilter = "(&(cn=jpasko))"
resid = l.search( self.baseDN_people,
self.searchScope, searchFilter, rattrs )
res = []
while 1:
result_type, result_data = l.result( resid, 0 )
if (result_data == []):
break
else:
res.append( result_data )
self.write( res )
def sleep( self, trans ):
self.l.unbind()
All help appreciated,
Joe.
|