Python LDAP

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Juan

    Python LDAP

    Hi

    I am trying to make a simple Python script using LDAP. The module is
    imported OK, but when I call the function open or initialize, I get
    this error:

    Traceback (most recent call last):
    File "/home/juan/workspace/amquare/src/nutum/amquare/amquare.py",
    line 122, in <module>
    conn.connect()
    File "/home/juan/workspace/amquare/src/nutum/amquare/ldap_util.py",
    line 39, in connect
    self.conn = ldap.initialize (self.host, self.port)
    File "/usr/lib/python2.5/site-packages/ldap/functions.py", line 87,
    in initialize
    return LDAPObject(uri, trace_level,tra ce_file,trace_s tack_limit)
    File "/usr/lib/python2.5/site-packages/ldap/ldapobject.py", line 70,
    in __init__
    self._l = ldap.functions. _ldap_function_ call(_ldap.init ialize,uri)
    File "/usr/lib/python2.5/site-packages/ldap/functions.py", line 59,
    in _ldap_function_ call
    result = func(*args,**kw args)
    LDAPError: (2, 'No such file or directory')

    What file is not found? I have lots of searches but don't get any
    answer. Anyone know how to solve this?

    Thanks in advance.
  • =?ISO-8859-1?Q?Michael_Str=F6der?=

    #2
    Re: Python LDAP

    Juan wrote:
    self.conn = ldap.initialize (self.host, self.port)
    [..]
    LDAPError: (2, 'No such file or directory')
    You have to pass in a LDAP URI as documented here:


    Use of compability function ldap.open() is deprecated and might vanish
    in future versions of python-ldap.

    See also Demo/initialize.py in python-ldap's source distribution.

    Ciao, Michael.

    Comment

    • Juan

      #3
      Re: Python LDAP

      On 26 ago, 13:42, Michael Ströder <mich...@stroed er.comwrote:
      Juan wrote:
          self.conn = ldap.initialize (self.host, self.port)
       [..]
      LDAPError: (2, 'No such file or directory')
      >
      You have to pass in a LDAP URI as documented here:http://python-ldap.sourceforge.net/d...dap.initialize
      >
      Use of compability function ldap.open() is deprecated and might vanish
      in future versions of python-ldap.
      >
      See also Demo/initialize.py in python-ldap's source distribution.
      >
      Ciao, Michael.
      Perfect! Thank you very much.

      Comment

      Working...