drs_utils: Add infrastructure to support 'clone with rename'
authorTim Beale <timbeale@catalyst.net.nz>
Tue, 5 Jun 2018 22:04:29 +0000 (10:04 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 3 Jul 2018 08:39:14 +0000 (10:39 +0200)
commit417fe47a910f2b8aa3c5e1121a55d8ebace0012b
treebe1fca1c39c04d1380135057fc48d187ea896ea2
parent00d22122e5c0eb0c4e45c40b6a292628ab023f2d
drs_utils: Add infrastructure to support 'clone with rename'

Our end goal is to create a backup clone of a DB, but rename the
domain/realm so we can startup the backup DC without interferring with
the existing Samba network. The basic strategy to do this is to leverage
DRS replication - by renaming the first object in the partition, all
subsequent objects will automatically be renamed.

This patch adds the infrastructure to do this. I've used object
inheritance to handle the special case of renaming the partition
objects. This means the domain-rename special case doesn't really
pollute the existing DRS replication code. All it needs is a small
refactor to create a new 'process_chunk()' function that the new
sub-class can then override.

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