[python-ldap] [BUG, PATCH] Not all synchronous methods are wrapped in ReconnectLDAPObject
Philipp Hahn
hahn at univention.de
Mon Apr 24 03:00:54 EDT 2017
Hi,
I noticed that not all synchronous methods are wrapped by
ReconnectLDAPObject(), such not doing the re-connect for the
not-overwritten methods of SimpleLDAPObject:
> $ diff -y -t -W 60 <(sed -rne '/^class SimpleLDAPObject/,/^\S/s/\s+def ([a-z][a-z_]+_st?)\(.*\):/\1/p' Lib/ldap/ldapobject.py|sort) <(sed -rne '/^class ReconnectLDAPObject/,/^\S/s/\s+def ([a-z][a-z_]+_st?)\(.*\):/\1/p' Lib/ldap/ldapobject.py|sort)
> add_ext_s add_ext_s
> add_s <
> bind_s bind_s
> cancel_s cancel_s
> compare_ext_s <
> compare_s compare_s
> delete_ext_s delete_ext_s
> delete_s < *** uses delete_ext_s() ***
> extop_s extop_s
> modify_ext_s modify_ext_s
> modify_s <
> modrdn_s < *** uses rename_s() ***
> passwd_s <
> read_s < *** uses search_ext_s() ***
> read_subschemasubentry_s < *** uses read_s() → search_ext_s() ***
> rename_s rename_s
> sasl_interactive_bind_s sasl_interactive_bind_s
> search_ext_s search_ext_s
> search_s < *** uses search_ext_s() ***
> search_st < *** uses search_ext_s() ***
> search_subschemasubentry_s < *** uses search_s → search_ext_s() ***
> simple_bind_s simple_bind_s
> start_tls_s start_tls_s
> unbind_ext_s < *** must not be wrapped ***
> unbind_s < *** must not be wrapped ***
> whoami_s whoami_s
Find attached my patch to add the 4 missing wrappers.
An alternative would be to implement
add_s(...) := add_ext_s(..., None, None)
modify_s(...) := modify_ext_s(..., None, None)
but "compare_ext_s" "and passwd_s" are definitely missing - those are
the modern _ext variants.
Philipp
--
Philipp Hahn
Open Source Software Engineer
Univention GmbH
be open.
Mary-Somerville-Str. 1
D-28359 Bremen
Tel.: +49 421 22232-0
Fax : +49 421 22232-99
hahn at univention.de
http://www.univention.de/
Geschäftsführer: Peter H. Ganten
HRB 20755 Amtsgericht Bremen
Steuer-Nr.: 71-597-02876
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-missing-wrappers-for-synchronous-calls-for-recon.patch
Type: text/x-diff
Size: 2153 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-ldap/attachments/20170424/fd97a546/attachment.patch>
More information about the python-ldap
mailing list