summaryrefslogtreecommitdiff
path: root/source4/scripting/python
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-09-15 18:52:11 +1000
committerAndrew Tridgell <tridge@samba.org>2010-09-16 07:24:01 +1000
commitaabd89d8f7d80d614c941111d7a049f9f35b943b (patch)
tree27fbc4aa8d4514ef9a9bf67e503dbe7fe6ee179d /source4/scripting/python
parent2edbf74f35a49e5793ee2621061856e1167b41a0 (diff)
downloadsamba-aabd89d8f7d80d614c941111d7a049f9f35b943b.tar.gz
samba-aabd89d8f7d80d614c941111d7a049f9f35b943b.tar.bz2
samba-aabd89d8f7d80d614c941111d7a049f9f35b943b.zip
s4-pyjoin: use new pynet finddc interface
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/scripting/python')
-rw-r--r--source4/scripting/python/samba/join.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/source4/scripting/python/samba/join.py b/source4/scripting/python/samba/join.py
index 36732d692d..2cb1e3da0b 100644
--- a/source4/scripting/python/samba/join.py
+++ b/source4/scripting/python/samba/join.py
@@ -68,7 +68,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'''
- return ctx.net.finddc(domain, nbt.NBT_SERVER_LDAP | nbt.NBT_SERVER_DS | nbt.NBT_SERVER_WRITABLE)
+ ctx.cldap_ret = ctx.net.finddc(domain, nbt.NBT_SERVER_LDAP | nbt.NBT_SERVER_DS | nbt.NBT_SERVER_WRITABLE)
+ return ctx.cldap_ret.pdc_dns_name;
def get_dsServiceName(samdb):
@@ -309,6 +310,8 @@ def join_rodc(server=None, creds=None, lp=None, site=None, netbios_name=None,
ctx.domsid = ctx.samdb.get_domain_sid()
ctx.domain_name = get_domain_name(ctx.samdb)
+ lp.set("realm", ctx.domain_name)
+
ctx.dc_ntds_dn = get_dsServiceName(ctx.samdb)
ctx.dc_dnsHostName = get_dnsHostName(ctx.samdb)
ctx.acct_pass = samba.generate_random_password(12, 32)