netcmd: Extend 'backup restore' command to handle renamed domains
authorTim Beale <timbeale@catalyst.net.nz>
Sun, 10 Jun 2018 23:18:09 +0000 (11:18 +1200)
committerDouglas Bagnall <dbagnall@samba.org>
Thu, 5 Jul 2018 02:01:25 +0000 (04:01 +0200)
commit6681f904aaf0cd9d757572a4f41376bd2e1c01fd
tree389fc14e4eb63e9faeba7a286d7d3c5925a29e78
parentab65647a8b146832eea6e98ee9e1b891f9c36788
netcmd: Extend 'backup restore' command to handle renamed domains

When restoring a renamed domain backup, we need to register the new
realm's DNS zone. We do this in the restore step because we don't know
the new server's IP/hostname in the backup step.

Because we may have removed the old realm's DNS entries in the rename
step, the remove_dc() code may fail to find the expected DNS entries for
the DC's domain (the DCs' dnsHostname still maps to the old DNS realm).
We just needed to adjust remove_dns_references() as it was getting a
slightly different error code.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/netcmd/domain_backup.py
python/samba/provision/sambadns.py
python/samba/remove_dc.py