|
|
a6f08b |
diff -up python-ldap-2.4.15/Demo/pyasn1/syncrepl.py.syncrepl-refreshdone python-ldap-2.4.15/Demo/pyasn1/syncrepl.py
|
|
|
a6f08b |
--- python-ldap-2.4.15/Demo/pyasn1/syncrepl.py.syncrepl-refreshdone 2014-03-07 15:01:11.000000000 -0500
|
|
|
a6f08b |
+++ python-ldap-2.4.15/Demo/pyasn1/syncrepl.py 2014-09-26 10:31:42.360101157 -0400
|
|
|
a6f08b |
@@ -93,6 +93,9 @@ class SyncReplConsumer(ReconnectLDAPObje
|
|
|
a6f08b |
for uuid in uuids:
|
|
|
a6f08b |
self.__presentUUIDs[uuid] = True
|
|
|
a6f08b |
|
|
|
a6f08b |
+ def syncrepl_refreshdone(self):
|
|
|
a6f08b |
+ print 'Initial synchronization is now done, persist phase begins'
|
|
|
a6f08b |
+
|
|
|
a6f08b |
def perform_application_sync(self,dn,attributes,previous_attributes):
|
|
|
a6f08b |
print 'Performing application sync for:', dn
|
|
|
a6f08b |
return True
|
|
|
a6f08b |
diff -up python-ldap-2.4.15/Lib/ldap/syncrepl.py.syncrepl-refreshdone python-ldap-2.4.15/Lib/ldap/syncrepl.py
|
|
|
a6f08b |
--- python-ldap-2.4.15/Lib/ldap/syncrepl.py.syncrepl-refreshdone 2014-03-07 15:01:12.000000000 -0500
|
|
|
a6f08b |
+++ python-ldap-2.4.15/Lib/ldap/syncrepl.py 2014-09-26 10:32:29.503115251 -0400
|
|
|
a6f08b |
@@ -330,7 +330,6 @@ class SyncreplConsumer:
|
|
|
a6f08b |
self.__refreshDone = False
|
|
|
a6f08b |
return self.search_ext(base, scope, **search_args)
|
|
|
a6f08b |
|
|
|
a6f08b |
-
|
|
|
a6f08b |
def syncrepl_poll(self, msgid=-1, timeout=None, all=0):
|
|
|
a6f08b |
"""
|
|
|
a6f08b |
polls for and processes responses to the syncrepl_search() operation.
|
|
|
a6f08b |
@@ -394,12 +393,16 @@ class SyncreplConsumer:
|
|
|
a6f08b |
self.syncrepl_present(None, refreshDeletes=False)
|
|
|
a6f08b |
if 'cookie' in sim.refreshPresent:
|
|
|
a6f08b |
self.syncrepl_set_cookie(sim.refreshPresent['cookie'])
|
|
|
a6f08b |
- self.__refreshDone=sim.refreshPresent['refreshDone']
|
|
|
a6f08b |
+ if sim.refreshPresent['refreshDone']:
|
|
|
a6f08b |
+ self.__refreshDone = True
|
|
|
a6f08b |
+ self.syncrepl_refreshdone()
|
|
|
a6f08b |
elif sim.refreshDelete is not None:
|
|
|
a6f08b |
self.syncrepl_present(None, refreshDeletes=True)
|
|
|
a6f08b |
if 'cookie' in sim.refreshDelete:
|
|
|
a6f08b |
self.syncrepl_set_cookie(sim.refreshDelete['cookie'])
|
|
|
a6f08b |
- self.__refreshDone=sim.refreshDelete['refreshDone']
|
|
|
a6f08b |
+ if sim.refreshDelete['refreshDone']:
|
|
|
a6f08b |
+ self.__refreshDone = True
|
|
|
a6f08b |
+ self.syncrepl_refreshdone()
|
|
|
a6f08b |
elif sim.syncIdSet is not None:
|
|
|
a6f08b |
if sim.syncIdSet['refreshDeletes'] is True:
|
|
|
a6f08b |
self.syncrepl_delete(sim.syncIdSet['syncUUIDs'])
|
|
|
a6f08b |
@@ -467,3 +470,12 @@ class SyncreplConsumer:
|
|
|
a6f08b |
|
|
|
a6f08b |
"""
|
|
|
a6f08b |
pass
|
|
|
a6f08b |
+
|
|
|
a6f08b |
+ def syncrepl_refreshdone(self):
|
|
|
a6f08b |
+ """
|
|
|
a6f08b |
+ Called by syncrepl_poll() between refresh and persist phase.
|
|
|
a6f08b |
+
|
|
|
a6f08b |
+ It indicates that initial synchronization is done and persist phase
|
|
|
a6f08b |
+ follows.
|
|
|
a6f08b |
+ """
|
|
|
a6f08b |
+ pass
|