[Freeipa-devel] [PATCH] Improve modlist generation in ldap2. Some code cleanup as bonus.
Jason Gerard DeRose
jderose at redhat.com
Mon Jan 11 19:38:53 UTC 2010
On Tue, 2010-01-05 at 15:01 +0100, Pavel Zuna wrote:
> ldap2._generate_modlist now uses more sophisticated means to decide when to use
> MOD_ADD+MOD_DELETE instead of MOD_REPLACE. Before it did MOD_REPLACE only on
> attributes explicitly specified in ldap2._FORCE_REPLACE_ON_UPDATE_ATTRS. Now it
> does MOD_REPLACE for all single value attributes and never for multi value.
>
> This patch also silently fixes a bug: ldap2 didn't check for the existence of
> attributes that were being deleted by setting them to None.
>
> Pavel
ack. pushed to master.
This patch looks fine and doesn't appear to break anything, but we
*really* need tests for ldap2. It's low in our stack and almost every
plugin uses it, so problems here have a high cost for us time-wise.
So, Pavel, please provide tests in subsequent patch. I think this
modlist functionality should be split out into functions that can be
tested easily without requiring an LDAP connection.
More information about the Freeipa-devel
mailing list