Add missing parameters to drs_Replicate in rodc.py
authorMichael Brown <michael@netdirect.ca>
Thu, 21 Nov 2013 15:48:33 +0000 (10:48 -0500)
committerGarming Sam <garming@samba.org>
Thu, 23 Oct 2014 01:05:00 +0000 (03:05 +0200)
* rodc.py: destination_dsa_guid parameter was neglected
  in drs_Replicate call
* rodc.py: cancel the local_samdb transaction on error

Change-Id: I962315a26ec48dc8774bb41db760387a3469c919
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Garming Sam <garming@samba.org>
Autobuild-Date(master): Thu Oct 23 03:05:00 CEST 2014 on sn-devel-104

python/samba/netcmd/rodc.py

index 2dc6112..4404b7b 100644 (file)
@@ -91,11 +91,13 @@ class cmd_rodc_preload(Command):
         destination_dsa_guid = misc.GUID(local_samdb.get_ntds_GUID())
 
         local_samdb.transaction_start()
-        repl = drs_Replicate("ncacn_ip_tcp:%s[seal,print]" % server, lp, creds, local_samdb)
+        repl = drs_Replicate("ncacn_ip_tcp:%s[seal,print]" % server, lp, creds,
+                             local_samdb, destination_dsa_guid)
         try:
             repl.replicate(dn, source_dsa_invocation_id, destination_dsa_guid,
                            exop=drsuapi.DRSUAPI_EXOP_REPL_SECRET, rodc=True)
         except Exception, e:
+            local_samdb.transaction_cancel()
             raise CommandError("Error replicating DN %s" % dn, e)
         local_samdb.transaction_commit()