[python-ldap] 'Missing' OPT_X_TLS_NEVER

Aaron C. de Bruyn aaron at heyaaron.com
Fri Mar 6 03:03:50 CET 2015


I've been beating my head against the wall for about 24 hours.

The short problem: Deploying an app I wrote to one particular machine
has problems because the ldap module does not have OPT_X_TLS_NEVER
(AttributeError: 'module' object has no attribute 'OPT_X_TLS_NEVER').

My guess is that python-ldap doesn't compile in TLS support if there's
a particular TLS library unavailable.


The long problem:  I have three identical machines.  My development
laptop running Ubuntu 14.04, a stanging/test machine running Ubuntu
14.04, and a production server running Ubuntu 14.04.

The production server is of course the one that's failing.

All three machines have Dokku installed.  (If you've never heard about
it, it's basically an open source version of Heroku.  You 'git push'
your code, it creates a container, and it runs your code.)

Every box I push to should have the same build process.  A docker
container is built that resembles the heroku cedar stack, python-ldap
(and other libraries) are installed, and the application is deployed.

The python-ldap build/install from the production machine is here:
http://dpaste.com/2SBT39J

Once the application container is deployed, I can connect in to it,
fire up a python shell, and run:
>>> import ldap
>>> ldap.__version__
'2.4.18'
>>> ldap.OPT_X_TLS_REQUIRE_CERT
24582
>>>

...just not on the production box.  I get:

    ldap.OPT_X_TLS_REQUIRE_CERT: ldap.OPT_X_TLS_NEVER,
AttributeError: 'module' object has no attribute 'OPT_X_TLS_NEVER'

I know this isn't really an issue with python-ldap itself, I'm just
hoping there might be someone here who might be familiar with the
technologies involved and can give me a shove in the right direction.

Thanks,

-A


More information about the python-ldap mailing list