devel-script: add options for RODC and partial replica for replicate flags
authorMatthieu Patou <mat@matws.net>
Tue, 30 Oct 2012 05:12:33 +0000 (22:12 -0700)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 21 Jan 2013 23:12:17 +0000 (00:12 +0100)
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Jan 22 00:12:17 CET 2013 on sn-devel-104

source4/scripting/devel/getncchanges

index eac4de606354571ac74b121d46f479a89406cc46..37ec18b22481e62c476cfcbdceaa7bc315aba7f3 100755 (executable)
@@ -101,9 +101,13 @@ if __name__ == "__main__":
     parser.add_option("", "--dn", dest="dn", help="DN to replicate",)
     parser.add_option("", "--exop", dest="exop", help="extended operation",)
     parser.add_option("", "--pas", dest="use_pas", action='store_true', default=False,
     parser.add_option("", "--dn", dest="dn", help="DN to replicate",)
     parser.add_option("", "--exop", dest="exop", help="extended operation",)
     parser.add_option("", "--pas", dest="use_pas", action='store_true', default=False,
-                      help="send partial attribute set",)
+                      help="send partial attribute set (for RODC)")
     parser.add_option("", "--nb-iter", type='int', help="Number of getncchange iterations")
     parser.add_option("", "--dest-dsa", type='str', help="destination DSA GUID")
     parser.add_option("", "--nb-iter", type='int', help="Number of getncchange iterations")
     parser.add_option("", "--dest-dsa", type='str', help="destination DSA GUID")
+    parser.add_option("", "--rodc", action='store_true', default=False,
+                      help='use RODC replica flags')
+    parser.add_option("", "--partial-rw", action='store_true', default=False,
+                      help='use RW partial replica flags, not be confused with --pas')
     parser.add_option("", "--replica-flags", type='int',
                       default=drsuapi.DRSUAPI_DRS_INIT_SYNC |
                       drsuapi.DRSUAPI_DRS_PER_SYNC |
     parser.add_option("", "--replica-flags", type='int',
                       default=drsuapi.DRSUAPI_DRS_INIT_SYNC |
                       drsuapi.DRSUAPI_DRS_PER_SYNC |
@@ -113,6 +117,19 @@ if __name__ == "__main__":
                       help='replica flags')
 
     (opts, args) = parser.parse_args()
                       help='replica flags')
 
     (opts, args) = parser.parse_args()
+    if opts.rodc:
+        opts.replica_flags = drsuapi.DRSUAPI_DRS_INIT_SYNC |\
+                             drsuapi.DRSUAPI_DRS_PER_SYNC |\
+                             drsuapi.DRSUAPI_DRS_GET_ANC |\
+                             drsuapi.DRSUAPI_DRS_NEVER_SYNCED |\
+                             drsuapi.DRSUAPI_DRS_SPECIAL_SECRET_PROCESSING |\
+                             drsuapi.DRSUAPI_DRS_GET_ALL_GROUP_MEMBERSHIP
+
+    if opts.partial_rw:
+        opts.replica_flags = drsuapi.DRSUAPI_DRS_INIT_SYNC |\
+                             drsuapi.DRSUAPI_DRS_PER_SYNC |\
+                             drsuapi.DRSUAPI_DRS_GET_ANC |\
+                             drsuapi.DRSUAPI_DRS_NEVER_SYNCED
 
     lp = sambaopts.get_loadparm()
     creds = credopts.get_credentials(lp)
 
     lp = sambaopts.get_loadparm()
     creds = credopts.get_credentials(lp)
@@ -123,6 +140,9 @@ if __name__ == "__main__":
     if creds.is_anonymous():
         parser.error("You must supply credentials")
 
     if creds.is_anonymous():
         parser.error("You must supply credentials")
 
+    if opts.partial_rw and opts.rodc:
+        parser.error("Can't specify --partial-rw and --rodc")
+
     server = args[0]
 
     binding_str = "ncacn_ip_tcp:%s[seal,print]" % server
     server = args[0]
 
     binding_str = "ncacn_ip_tcp:%s[seal,print]" % server