samba-tool: fix replication after dns partition fsmo role transfer
authorStefan Metzmacher <metze@samba.org>
Tue, 28 May 2019 12:53:09 +0000 (14:53 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 30 May 2019 07:12:11 +0000 (07:12 +0000)
The new role owner need to replicate from the old role owner.

Before we told the old role owner to replicate from itself.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13973

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/netcmd/fsmo.py
selftest/knownfail.d/fsmo [deleted file]

index b916f9c97b825c68dd618fb9ba251928b541bfeb..c5c697944091404a84765c33929be2c4edc13af8 100644 (file)
@@ -65,6 +65,8 @@ def transfer_dns_role(outf, sambaopts, credopts, role, samdb):
         forest_dn = samba.dn_from_dns_name(samdb.forest_dns_name())
         role_object = "CN=Infrastructure,DC=ForestDnsZones," + forest_dn
 
+    new_host_dns_name = samdb.host_dns_name()
+
     res = samdb.search(role_object,
                        attrs=["fSMORoleOwner"],
                        scope=ldb.SCOPE_BASE,
@@ -129,7 +131,7 @@ def transfer_dns_role(outf, sambaopts, credopts, role, samdb):
             raise CommandError("Failed to add role '%s': %s" % (role, msg))
 
         try:
-            connection = samba.drs_utils.drsuapi_connect(samdb.host_dns_name(),
+            connection = samba.drs_utils.drsuapi_connect(new_host_dns_name,
                                                          lp, creds)
         except samba.drs_utils.drsException as e:
             raise CommandError("Drsuapi Connect failed", e)
diff --git a/selftest/knownfail.d/fsmo b/selftest/knownfail.d/fsmo
deleted file mode 100644 (file)
index da665d2..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-^samba4.drs.fsmo.python.*.fsmo.DrsFsmoTestCase.test_DomainDnsZonesMasterTransfer
-^samba4.drs.fsmo.python.*.fsmo.DrsFsmoTestCase.test_ForestDnsZonesMasterTransfer