summaryrefslogtreecommitdiff
path: root/source4/scripting/python
diff options
context:
space:
mode:
authorMatthieu Patou <mat@matws.net>2011-03-21 18:03:50 +0300
committerMatthieu Patou <mat@samba.org>2011-05-05 02:04:13 +0200
commit7f36f3effa200709df021789786f6e7555aef33c (patch)
tree9a542b982e45a9a05476430fa3820773041bb747 /source4/scripting/python
parent1c714850d5068864b1f04a4211223dec11a30d67 (diff)
downloadsamba-7f36f3effa200709df021789786f6e7555aef33c.tar.gz
samba-7f36f3effa200709df021789786f6e7555aef33c.tar.bz2
samba-7f36f3effa200709df021789786f6e7555aef33c.zip
s4-samba-tool: allow specification of targetdir when joining as (RO)DC
Autobuild-User: Matthieu Patou <mat@samba.org> Autobuild-Date: Thu May 5 02:04:13 CEST 2011 on sn-devel-104
Diffstat (limited to 'source4/scripting/python')
-rw-r--r--source4/scripting/python/samba/netcmd/join.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/source4/scripting/python/samba/netcmd/join.py b/source4/scripting/python/samba/netcmd/join.py
index 507253ab81..70b750191a 100644
--- a/source4/scripting/python/samba/netcmd/join.py
+++ b/source4/scripting/python/samba/netcmd/join.py
@@ -22,7 +22,7 @@ import samba.getopt as options
from samba.net import Net, LIBNET_JOIN_AUTOMATIC
from samba.netcmd import Command, CommandError, Option
-from samba.dcerpc.misc import SEC_CHAN_WKSTA, SEC_CHAN_BDC
+from samba.dcerpc.misc import SEC_CHAN_WKSTA
from samba.join import join_RODC, join_DC
class cmd_join(Command):
@@ -39,12 +39,13 @@ class cmd_join(Command):
takes_options = [
Option("--server", help="DC to join", type=str),
Option("--site", help="site to join", type=str),
+ Option("--targetdir", help="where to store provision", type=str),
]
takes_args = ["domain", "role?"]
def run(self, domain, role=None, sambaopts=None, credopts=None,
- versionopts=None, server=None, site=None):
+ versionopts=None, server=None, site=None, targetdir=None):
lp = sambaopts.get_loadparm()
creds = credopts.get_credentials(lp)
net = Net(creds, lp, server=credopts.ipaddress)
@@ -61,11 +62,11 @@ class cmd_join(Command):
secure_channel_type = SEC_CHAN_WKSTA
elif role == "DC":
join_DC(server=server, creds=creds, lp=lp, domain=domain,
- site=site, netbios_name=netbios_name)
+ site=site, netbios_name=netbios_name, targetdir=targetdir)
return
elif role == "RODC":
join_RODC(server=server, creds=creds, lp=lp, domain=domain,
- site=site, netbios_name=netbios_name)
+ site=site, netbios_name=netbios_name, targetdir=targetdir)
return
else:
raise CommandError("Invalid role %s (possible values: MEMBER, BDC, RODC)" % role)