mirror of
https://github.com/samba-team/samba.git
synced 2025-08-31 22:02:58 +03:00
s4-scripting: allow to specify the number max of iteration around getNcChanges
This commit is contained in:
@ -101,6 +101,7 @@ if __name__ == "__main__":
|
|||||||
parser.add_option("", "--exop", dest="exop", help="extended operation",)
|
parser.add_option("", "--exop", dest="exop", help="extended operation",)
|
||||||
parser.add_option("", "--pas", dest="use_pas", action='store_true', default=False,
|
parser.add_option("", "--pas", dest="use_pas", action='store_true', default=False,
|
||||||
help="send partial attribute set",)
|
help="send partial attribute set",)
|
||||||
|
parser.add_option("", "--nb-iter", type='int', help="Number of getncchange iterations")
|
||||||
parser.add_option("", "--dest-dsa", type='str',
|
parser.add_option("", "--dest-dsa", type='str',
|
||||||
default='"9c637462-5b8c-4467-aef2-bdb1f57bc4ef"', help="destination DSA GUID")
|
default='"9c637462-5b8c-4467-aef2-bdb1f57bc4ef"', help="destination DSA GUID")
|
||||||
parser.add_option("", "--replica-flags", type='int',
|
parser.add_option("", "--replica-flags", type='int',
|
||||||
@ -170,8 +171,10 @@ if __name__ == "__main__":
|
|||||||
req8.mapping_ctr.num_mappings = 0
|
req8.mapping_ctr.num_mappings = 0
|
||||||
req8.mapping_ctr.mappings = None
|
req8.mapping_ctr.mappings = None
|
||||||
|
|
||||||
|
nb_iter = 0
|
||||||
while True:
|
while True:
|
||||||
(level, ctr) = drs.DsGetNCChanges(drs_handle, 8, req8)
|
(level, ctr) = drs.DsGetNCChanges(drs_handle, 8, req8)
|
||||||
if ctr.more_data == 0:
|
nb_iter += 1
|
||||||
|
if ctr.more_data == 0 or opts.nb_iter == nb_iter:
|
||||||
break
|
break
|
||||||
req8.highwatermark.tmp_highest_usn = ctr.new_highwatermark.tmp_highest_usn
|
req8.highwatermark.tmp_highest_usn = ctr.new_highwatermark.tmp_highest_usn
|
||||||
|
Reference in New Issue
Block a user