From b9f75c8f1a1b28f7a6ae8ab36e970a0e120f1cb6 Mon Sep 17 00:00:00 2001 From: Douglas Bagnall Date: Thu, 2 Apr 2015 15:11:12 +1300 Subject: [PATCH] KCC: don't create duplicate DSA objects load_site() returns the canonical site even if it didn't make it Signed-off-by: Douglas Bagnall Reviewed-by: Garming Sam Reviewed-by: Andrew Bartlett --- source4/scripting/bin/samba_kcc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/source4/scripting/bin/samba_kcc b/source4/scripting/bin/samba_kcc index 69205dcdae0..14bf13f1a9d 100755 --- a/source4/scripting/bin/samba_kcc +++ b/source4/scripting/bin/samba_kcc @@ -172,12 +172,11 @@ class KCC(object): guid = str(site.site_guid) if guid not in self.site_table: self.site_table[guid] = site + self.dsa_by_dnstr.update(site.dsa_table) + self.dsa_by_guid.update((str(x.dsa_guid), x) + for x in site.dsa_table.values()) - self.dsa_by_dnstr.update(site.dsa_table) - self.dsa_by_guid.update((str(x.dsa_guid), x) - for x in site.dsa_table.values()) - - return site + return self.site_table[guid] def load_my_site(self): """Loads the Site class for the local DSA