summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-11-28 20:03:11 +0100
committerStefan Metzmacher <metze@samba.org>2011-11-29 09:21:25 +0100
commit948f091a22a5e2bd348d2840e0fdff1d9c9baca7 (patch)
tree0d7351fe059648a1e1e2986ca23dd8c7ab332de8
parentf8fbc4163b3f3e02bf15fb495b2d2b721a67162b (diff)
downloadsamba-948f091a22a5e2bd348d2840e0fdff1d9c9baca7.tar.gz
samba-948f091a22a5e2bd348d2840e0fdff1d9c9baca7.tar.bz2
samba-948f091a22a5e2bd348d2840e0fdff1d9c9baca7.zip
s4:python/samba/join.py: add optional 'machinepass' parameter to class dc_join
metze
-rw-r--r--source4/scripting/python/samba/join.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/source4/scripting/python/samba/join.py b/source4/scripting/python/samba/join.py
index 3f1abe22eb..bd91e6269e 100644
--- a/source4/scripting/python/samba/join.py
+++ b/source4/scripting/python/samba/join.py
@@ -48,7 +48,8 @@ class dc_join(object):
'''perform a DC join'''
def __init__(ctx, server=None, creds=None, lp=None, site=None,
- netbios_name=None, targetdir=None, domain=None):
+ netbios_name=None, targetdir=None, domain=None,
+ machinepass=None):
ctx.creds = creds
ctx.lp = lp
ctx.site = site
@@ -90,7 +91,10 @@ class dc_join(object):
ctx.dc_dnsHostName = ctx.get_dnsHostName()
ctx.behavior_version = ctx.get_behavior_version()
- ctx.acct_pass = samba.generate_random_password(32, 40)
+ if machinepass is not None:
+ ctx.acct_pass = machinepass
+ else:
+ ctx.acct_pass = samba.generate_random_password(32, 40)
# work out the DNs of all the objects we will be adding
ctx.server_dn = "CN=%s,CN=Servers,CN=%s,CN=Sites,%s" % (ctx.myname, ctx.site, ctx.config_dn)