netcmd/domain: remove dns records after DC demote
authorJoe Guo <joeg@catalyst.net.nz>
Tue, 5 Jun 2018 22:38:11 +0000 (10:38 +1200)
committerDouglas Bagnall <dbagnall@samba.org>
Wed, 6 Jun 2018 23:46:25 +0000 (01:46 +0200)
Call `remove_dc.remove_dns_references()` at the end of demote cmd.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
python/samba/netcmd/domain.py

index 6a78a6b630b359ae8d1c9b78242f737751ce1289..3dbe2fba9e9721e7b712ba98e3a5858933e160a8 100644 (file)
@@ -1028,6 +1028,10 @@ class cmd_domain_demote(Command):
             except ldb.LdbError as l:
                 pass
 
+        # get dns host name for target server to demote, remove dns references
+        remove_dc.remove_dns_references(remote_samdb, logger, samdb.host_dns_name(),
+                                        ignore_no_name=True)
+
         self.errf.write("Demote successful\n")