[python-ldap] Need to detect if syncrepl refresh phase is completed

Michael Ströder michael at stroeder.com
Thu Sep 25 18:32:56 CEST 2014


Petr Spacek wrote:
> On 25.9.2014 16:27, Michael Ströder wrote:
>> Petr Spacek wrote:
>>> On 10.9.2014 14:46, Michael Ströder wrote:
>>>> Martin Basti wrote:
>>>>> I need to detect if syncrepl refresh phase is completed during
>>>>> syncrepl_poll (in refresh&persist mode), is there any way how to do it?
>>>>>
>>>>> I found a patch
>>>>> https://github.com/spacekpe/python-ldap/commit/8b4f935a97759c692637fb9a81e7d353ace27f53
>>>>>
>>>>>
>>>>> is it the right way?
>>>>
>>>> Petr sent his patches to the mailing list in July. Currently they are still
>>>> pending for review. I might have a chance to review and commit them during
>>>> the
>>>> next two weeks.
>>>
>>> I'm very sorry for bothering you. I would like to push latest version of
>>> python-ldap package to Fedora so I would like to know if the patch can be
>>> included or not. (Obviously Fedora don't want to provide non-standard API.)
>>>
>>> The patch or some other alternative for end-of-refresh-phase-detection is
>>> required for further development in the FreeIPA project...
>>
>> Personally I generally dislike callbacks. A better approach should IMO specify
>> just a generic handler method an application can override in a sub-class.
>>
>> Can you develop a patch like this?
> 
> The patch adds method SyncreplConsumer.syncrepl_refreshdone() and this method
> should be overridden in sub-class in the same way as existing method
> syncrepl_entry() and the like.
> 
> I agree that variable name 'callback' is not the best but it actually is not a
> callback, it works in the same way as similar methods in SyncreplConsumer class.

I see. I've committed to CVS. Please test.

Could you please provide better var names instead of 'callback' and
'newvalue'? And a __doc__ string for _syncrepl_update_refreshdone() would also
be appreciated.

Ciao, Michael.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4252 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://mail.python.org/pipermail/python-ldap/attachments/20140925/6a7f46ea/attachment-0001.bin>


More information about the python-ldap mailing list