kcc_utils: Prevent multiple sites attached to a sitelink covering a site
authorGarming Sam <garming@catalyst.net.nz>
Tue, 13 Mar 2018 01:41:23 +0000 (14:41 +1300)
committerDouglas Bagnall <dbagnall@samba.org>
Wed, 21 Mar 2018 03:36:22 +0000 (04:36 +0100)
commitf342d7e0256eda8f6702c0f2c7752fbcf459ba8f
treeafb3c1c784a94d76a0fd37ea4b40c9b321a42eeb
parent96340e1ad2b15ab513e20e5a4317b90811c06bba
kcc_utils: Prevent multiple sites attached to a sitelink covering a site

This avoids trivial duplicates in a similar manner as mentioned in:

https://blogs.technet.microsoft.com/askds/2011/04/29/sites-sites-everywhere/

It prefers the largest sites then the earliest alphabetically, so that
only a single site ever covers an uncovered site (within a site link).
Note that this isn't applicable over multiple site links (like Windows
presumably) and is only a simple mechanism to avoid excessive
registering.  DCs within the site will also still register for each.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
python/samba/kcc/kcc_utils.py