[python-ldap] LDAP Sync (RFC 4533) support
Chris Mikkelson
cmikk at qwest.net
Tue Aug 2 16:24:04 CEST 2011
On Tue, Aug 02, 2011 at 09:29:02AM +0200, Michael Str?der wrote:
> Chris Mikkelson wrote:
> > The attached patch against python-ldap 2.4.3 adds a new
> > sub-module 'ldap.syncrepl' which implements an RFC 4533
> > replication client.
>
> I'm currently reviewing this. Well done.
>
> I have some questions/remarks though:
>
> 1. Do you have a sample script demonstrating usage of ldap.syncrepl? I'd like
> to add one under Demo/ in the source distribution.
I'll throw one together, hopefully in the next few days.
> 2. I will add a comment that this implements a syncrepl-consumer not a
> provider. That's right?
That is correct.
> 3. Which minimum Python version does your code need? Currently there's no
> minimum Python version specified for python-ldap (see my other posting). This
> affects use of sets etc.
I'm new to python (as evidenced by your next few
comments :-). I'm personally using 2.7, but I didn't
intentionally use any 2.7-specific features.
> 4. {} is an empty dictionary not an empty set as you might have intended.
>
> 5. Using mutable types as defaults for key-word arguments causes unpredictable
> side-effects (uuids={} sets empty dict). I'd also argue that the various
> methods should not have key-word arguments if the arguments aren't truly optional.
OK. I've made the following API changes to my local copy. The
methods are now:
syncrepl_present(self, uuids, refreshDeletes=False)
syncrepl_delete(self, uuids)
and the uuids parameters are either a list of uuid strings
or None. I'll test my changes while writing a demo script,
and send out the patch along with the demo script.
--
Chris Mikkelson | It has been said that man is a rational animal.
cmikk at qwest.net | All my life I have been searching for evidence
| which could support this. -- Bertrand Russell
More information about the python-ldap
mailing list