s4-rodc: override client site from cldap response
authorAndrew Tridgell <tridge@samba.org>
Sun, 19 Sep 2010 20:20:33 +0000 (13:20 -0700)
committerAndrew Tridgell <tridge@samba.org>
Sun, 19 Sep 2010 20:36:02 +0000 (13:36 -0700)
source4/scripting/python/samba/join.py

index 2cb1e3da0b0015a400093c2d3972800346e80d91..679dc5bf999cd9b01af8db27b32fbec48b895acb 100644 (file)
@@ -69,6 +69,8 @@ def join_rodc(server=None, creds=None, lp=None, site=None, netbios_name=None,
     def find_dc(ctx, domain):
         '''find a writeable DC for the given domain'''
         ctx.cldap_ret = ctx.net.finddc(domain, nbt.NBT_SERVER_LDAP | nbt.NBT_SERVER_DS | nbt.NBT_SERVER_WRITABLE)
+        if ctx.cldap_ret.client_site is not None and ctx.cldap_ret.client_site != "":
+            ctx.site = ctx.cldap_ret.client_site
         return ctx.cldap_ret.pdc_dns_name;