[Freeipa-devel] [PATCH] 326 Improve compatibility of LDAP rename_s call
Rob Crittenden
rcritten at redhat.com
Wed Oct 24 18:47:55 UTC 2012
Martin Kosek wrote:
> python-ldap of version 2.3.10 and lower does not support serverctrls
> and clientctrls options. This makes every rename operation in IPA
> to crash with Internal Error.
>
> Make sure that we respect the difference between both versions in
> our LDAP module and do not pass serverctrls and clientctrls when
> they are not supported. NotImplementedException is raised when the
> options are used with this version.
>
> https://fedorahosted.org/freeipa/ticket/3199
This may be overkill, but would it be better to use introspection to
determine if the arguments are supported?
import ldap
import inspect
signature = inspect.getargspec(ldap.ldapobject.LDAPObject.rename_s)
if 'serverctrls' in signature.args:
_EXTENDED_RENAME_S = True
else:
_EXTENDED_RENAME_S = False
rob
More information about the Freeipa-devel
mailing list