[Freeipa-devel] Splitting out ipaldap

Petr Viktorin pviktori at redhat.com
Tue Apr 14 14:38:24 UTC 2015


Hello!

As some of you know, I'm looking to help porting FreeIPA to Python 3.
One of the major dependencies holding this back is python-ldap, which 
hasn't been ported yet. Some preliminary porting patches by Raphaël 
Barrois [0] are ready and have been sent to the python-ldap list. The 
python-ldap upstream has been very quiet about reviewing them so far, 
but they're something for me to test against, and maybe improve.

To make the testing easier, I'd like to split out "ipaldap" to a 
stand-alone package, and port it to Python 3 first.
This split will make it easier to test (since I don't have to port all 
of IPA), and being able to use our generic LDAP wrappers in non-IPA 
projects could maybe also invite some community participation. Also, 
ipaldap unit tests are somewhat lacking, so I'll help with that.
Packaging-wise, I want "ipaldap" to be on the same level as "ipapython" 
or "ipaserver"; additionally I want to release it on PyPI [1].


My general plan is:
- Move ipapython.dn -> ipaldap.dn (keeping ipapython.dn importable for 
old scripts/plugins)
- Move CIDict to ipaldap.cidict. For Python 3, I'd really like to 
replace this with something based on collections.MutableMapping, since 
the semantics of subclassing "dict" aren't very well defined.
- Create a new module for ipaldap-specific exceptions. IPA will use a 
hook to swap out this module for its own set of exceptions. (Yes, this 
is a hack, but I'd like to keep ipaldap clean of IPA dependencies. A 
proper solution will be quite involved, given translatable error 
messages and XML-RPC numbers.)
- Split ipapython.ipaldap into ipaldap.entry, ipaldap.client, 
ipaldap.schema_cache; but keep some IPA-specific logic in 
ipapython.ipaldap (and again keeping all the old names importable).

I'll port everything to Python 3 as I move it, but I won't add a py3 run 
to IPA's test suite, at least until the dependencies are ported. Any 
breakage on py3 will be mine to fix, for the time being.
Speaking of dependencies, one of my goals for this effort is to 
determine whether replacing python-ldap  by another library, ldap3, 
would be worth it.


Let me know if you disagree with this direction.

-- 
Petr Viktorin


[0] https://github.com/rbarrois/python-ldap/compare/py3
[1] https://pypi.python.org/pypi




More information about the Freeipa-devel mailing list