[Freeipa-devel] updates and deletes
Karl MacMillan
kmacmill at redhat.com
Wed Aug 15 13:16:17 UTC 2007
On Tue, 2007-08-14 at 10:27 -0400, Rob Crittenden wrote:
> Rob Crittenden wrote:
> > We need to come to some decision on how we're going to handle updates
> > and deletes (or really inactivations).
> >
> > The LDAP API for updates is a list of tuples in the form
> > (mod_op,mod_type,mod_vals), where mod_op is the operation (one of
> > MOD_ADD, MOD_DELETE, or MOD_REPLACE), mod_type is a string indicating
> > the attribute type name, and mod_vals is either a string value or a list
> > of string values to add, delete or replace respectively. With deletes id
> > mod_vals is None then all attributes are deleted (probably something to
> > test for and reject, I doubt we'd ever want this).
>
> You know, reading docs can be highly beneficial. The python-ldap package
> provides a function to generate the modlist given a new entry and the
> original entry. So we have 2 choices:
>
> 1. Have an API where the old and new records are both passed in (not
> very efficient over XML-RPC)
> 2. Have an API where the new record is passed in and I do a search to
> get the original record (not very efficient)
>
> I'm going to start poking at this, using model #1 for starters.
>
If we don't expose the attributes directly but hide them behind methods
we could also track changes to the python object, generate a modlist
from that, and pass only mods to the XML-RPC layer.
Karl
More information about the Freeipa-devel
mailing list