drs_utils: use a given highwatermark and uptodateness_vector in replicate()
authorBob Campbell <bobcampbell@catalyst.net.nz>
Thu, 26 Jan 2017 21:40:19 +0000 (10:40 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 14 Feb 2017 20:28:25 +0000 (21:28 +0100)
Signed-off-by: Bob Campbell <bobcampbell@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Pair-programmed-with: Andrew Bartlett <abartlet@samba.org>

python/samba/drs_utils.py

index 0c14a6300ca9c65c8eafbbc376cca4a61f31fb4c..e91a20b04b1557485b0164db087505c19949221f 100644 (file)
@@ -198,7 +198,7 @@ class drs_Replicate(object):
 
     def replicate(self, dn, source_dsa_invocation_id, destination_dsa_guid,
                   schema=False, exop=drsuapi.DRSUAPI_EXOP_NONE, rodc=False,
-                  replica_flags=None):
+                  replica_flags=None, highwatermark=None, udv=None):
         '''replicate a single DN'''
 
         # setup for a GetNCChanges call
@@ -208,11 +208,16 @@ class drs_Replicate(object):
         req8.source_dsa_invocation_id = source_dsa_invocation_id
         req8.naming_context = drsuapi.DsReplicaObjectIdentifier()
         req8.naming_context.dn = dn
-        req8.highwatermark = drsuapi.DsReplicaHighWaterMark()
-        req8.highwatermark.tmp_highest_usn = 0
-        req8.highwatermark.reserved_usn = 0
-        req8.highwatermark.highest_usn = 0
-        req8.uptodateness_vector = None
+
+        if highwatermark is not None:
+            req8.highwatermark = highwatermark
+        else:
+            req8.highwatermark = drsuapi.DsReplicaHighWaterMark()
+            req8.highwatermark.tmp_highest_usn = 0
+            req8.highwatermark.reserved_usn = 0
+            req8.highwatermark.highest_usn = 0
+
+        req8.uptodateness_vector = udv
 
         if replica_flags is not None:
             req8.replica_flags = replica_flags