[python-ldap] syncrepl and FreeIPA (was: Need to detect if syncrepl refresh phase is completed)

Chris Mikkelson cmikk at qwest.net
Thu Sep 25 20:33:59 CEST 2014


On Thu, Sep 25, 2014 at 06:37:50PM +0200, Michael Ströder wrote:
> Petr Spacek wrote:
> > The patch or some other alternative for end-of-refresh-phase-detection is
> > required for further development in the FreeIPA project...
> 
> I'm curious:
> What's the use-case for syncrepl in FreeIPA?

I'm also curious about this.

FWIW, I've detected the end of refresh by watching for the first
syncrepl_set_cookie() call. I do not know if this heuristic relies
on OpenLDAP's implementation, but in order for this not to work, the
server would have to make the rather odd choice to send a cookie
along with an entry in the middle of the refresh phase. 

A separate method is a cleaner approach, though.

It should suffice (and address the style nits) to replace
the two current occurrences of:

	self.__refreshDone = sim.refreshDelete['refreshDone']

with:
	if sim.refreshDelete['refreshDone']:
	    self.__refreshDone = True
	    self.syncrepl_refreshdone()

Patch attached.

-- 
Chris Mikkelson  | Quidquid latine dictum sit, altum viditur
cmikk at qwest.net  | 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: syncrepl-refreshdone.patch
Type: text/x-diff
Size: 2108 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-ldap/attachments/20140925/4efda887/attachment.patch>


More information about the python-ldap mailing list