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 6a78a6b..3dbe2fb 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")