473,569 Members | 2,692 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.
Aug 26 '08 #1
2 6475
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.
Aug 26 '08 #2
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.
Aug 26 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2100
by: Micha³ Kurowski | last post by:
Hi, I'd like to ask you whether anyone have built python-ldap against Sun ONE Directory v5.2 on a Solaris 9. Seems developers do not support such config, but many places on the web suggest it *is* possible and I would be a major pitta if I had to kick out my Ldap server now ... I've got python-ldap-2.0.0pre20 and use gcc 3.3.1. It...
1
2185
by: Brian Beck | last post by:
As far as I can tell, both maintainers of the Windows builds of Python-LDAP haven't updated in about a year. This doesn't exactly make the builds ancient or obsolete, but it would be nice to start fresh with the latest version. I've tried without success in building it myself. The hardest part is simply that Python-LDAP is dependent on at...
1
1505
by: rcmn | last post by:
i'm running around in circle trying to to use python/ldap/ on win32(WinXP). I want to write a script that read SQL data(no pbm) and insert member in a AD group(pbm).I used the module Active_Directory(very easy to use).but it read only AD. So i have been try to install python-ldap on a win32/python2.4 install.But each time i try ...
5
2176
by: Melissa Evans | last post by:
Hi. I'm new to Python. :) I've modified grappy.py, http://www.stacken.kth.se/~mattiasa/projects/grappy/, a postfix policy daemon for greylisting. to use LDAP as a backend instead of SQL (with python-ldap.) The daemon runs fine when testing but when I put it under load it core dumps quickly. What little analysis I know how to do shows...
1
4834
by: Nico Grubert | last post by:
Hi there, on a linux machine I am running this ldapsearch from the command line: ldapsearch -x -h myldaphost.mydomain.com \ -D "CN=ldapuser,CN=Users,DC=mydomain,DC=com" -w "secret" \ -b "CN=ANYCOMPUTER,CN=Computers,DC=mydomain,DC=com" How can I do this with python-ldap?
0
1719
by: sbartz | last post by:
Greetings, My ldap application relies on user input for a ldap server uri, so I am looking for a way to use the ldap api to determine whether the ldap server is up or not. All the docs have to say is this: initialize(uri) Opens a new connection with an LDAP server, and return an LDAP object (see 1.1.4) used to perform operations on that...
10
2151
by: Benedict Verheyen | last post by:
Hi, i found python-ldap for version Python 2.4. Is there i place i can find a version for 2.5? If not, how can i build it myself for Windows? Thanks, Benedict
6
7768
by: hotani | last post by:
I am attempting to pull info from an LDAP server (Active Directory), but cannot specify an OU. In other words, I need to search users in all OU's, not a specific one. Here is what works: con = ldap.initialize("ldap://server.local") con.simple_bind_s('user@domain', pass) result = con.search_ext_s( 'OU=some office, DC=server, DC=local',
1
5433
by: Erick Perez - Quadrian Enterprises, S.A. | last post by:
Hi, I have a MS Windows AD domain, and have one OU with more tan 1000 users objects. When I try to read it, I hit the 1000 limit of AD while returning objects, so I'm asking for advice as to how to read them. Here is my actual code, it is not the cleanest as I am learning python. Suggestions are welcomed :) Runnig this script on RedHat 5.x...
0
7698
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8122
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7970
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5513
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1213
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
937
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.