From 7c8476b434a9e305ecb90712d800e6560b45200f Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 6 Feb 2012 22:06:09 +0100 Subject: samba-tool: Add optiongroups, necessary for 'samba-tool domain ...' --- source4/scripting/python/samba/netcmd/domain.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/source4/scripting/python/samba/netcmd/domain.py b/source4/scripting/python/samba/netcmd/domain.py index 664db18f5b..1f2c7de957 100644 --- a/source4/scripting/python/samba/netcmd/domain.py +++ b/source4/scripting/python/samba/netcmd/domain.py @@ -93,6 +93,7 @@ class cmd_domain_export_keytab(Command): net = Net(None, lp) net.export_keytab(keytab=keytab, principal=principal) + class cmd_domain_info(Command): """Print basic info about a domain and the DC passed as parameter""" @@ -101,6 +102,12 @@ class cmd_domain_info(Command): takes_options = [ ] + takes_optiongroups = { + "sambaopts": options.SambaOptions, + "credopts": options.CredentialsOptions, + "versionopts": options.VersionOptions, + } + takes_args = ["address"] def run(self, address, credopts=None, sambaopts=None, versionopts=None): @@ -118,7 +125,6 @@ class cmd_domain_info(Command): raise CommandError("Invalid IP address '" + address + "'!") - class cmd_domain_join(Command): """Joins domain as either member or backup domain controller""" @@ -202,6 +208,11 @@ class cmd_domain_demote(Command): Option("--targetdir", help="where provision is stored", type=str), ] + takes_optiongroups = { + "sambaopts": options.SambaOptions, + "credopts": options.CredentialsOptions, + "versionopts": options.VersionOptions, + } def run(self, sambaopts=None, credopts=None, versionopts=None, server=None, targetdir=None): @@ -244,9 +255,6 @@ class cmd_domain_demote(Command): print "Using %s as partner server for the demotion" % server (drsuapiBind, drsuapi_handle, supportedExtensions) = drsuapi_connect(server, lp, creds) - - - print "Desactivating inbound replication" nmsg = ldb.Message() @@ -422,7 +430,6 @@ class cmd_domain_demote(Command): self.outf.write("Demote successfull\n") - class cmd_domain_level(Command): """Raises domain and forest function levels""" @@ -837,7 +844,7 @@ class cmd_domain_samba3upgrade(Command): if not os.path.exists(smbconf): raise CommandError("File %s does not exist" % smbconf) - + if testparm and not os.path.exists(testparm): raise CommandError("Testparm utility %s does not exist" % testparm) -- cgit