From f6fa8684896b8f3f9f8b7bd3742c99906973274c Mon Sep 17 00:00:00 2001 From: Giampaolo Lauria Date: Fri, 15 Jul 2011 12:07:03 -0400 Subject: samba-tool: moved takes_optiongroups definition to Command base class The option groups should be defined at the Command base class level as they are in common across all samba-tool commands. Major move advantages: 1. more OOP approach 2. enforcing consistency across commands 3. avoiding the need of declaring for every new command Signed-off-by: Andrew Tridgell --- source4/scripting/python/samba/netcmd/__init__.py | 7 ++++- source4/scripting/python/samba/netcmd/dbcheck.py | 7 +---- .../scripting/python/samba/netcmd/delegation.py | 31 +-------------------- source4/scripting/python/samba/netcmd/domain.py | 30 -------------------- source4/scripting/python/samba/netcmd/drs.py | 31 +-------------------- source4/scripting/python/samba/netcmd/dsacl.py | 7 +---- source4/scripting/python/samba/netcmd/fsmo.py | 7 +---- source4/scripting/python/samba/netcmd/gpo.py | 13 +-------- source4/scripting/python/samba/netcmd/group.py | 25 +---------------- source4/scripting/python/samba/netcmd/ldapcmp.py | 7 +---- source4/scripting/python/samba/netcmd/netacl.py | 1 + source4/scripting/python/samba/netcmd/newuser.py | 7 +---- source4/scripting/python/samba/netcmd/ntacl.py | 13 +-------- source4/scripting/python/samba/netcmd/rodc.py | 7 +---- source4/scripting/python/samba/netcmd/spn.py | 18 +----------- source4/scripting/python/samba/netcmd/testparm.py | 6 +--- source4/scripting/python/samba/netcmd/time.py | 7 +---- source4/scripting/python/samba/netcmd/user.py | 32 +--------------------- source4/scripting/python/samba/netcmd/vampire.py | 7 +---- 19 files changed, 23 insertions(+), 240 deletions(-) (limited to 'source4') diff --git a/source4/scripting/python/samba/netcmd/__init__.py b/source4/scripting/python/samba/netcmd/__init__.py index 1e032924fc..e5c5badb18 100644 --- a/source4/scripting/python/samba/netcmd/__init__.py +++ b/source4/scripting/python/samba/netcmd/__init__.py @@ -3,6 +3,7 @@ # Unix SMB/CIFS implementation. # Copyright (C) Jelmer Vernooij 2009 # Copyright (C) Theresa Halloran 2011 +# Copyright Giampaolo Lauria 2011 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -94,7 +95,11 @@ class Command(object): takes_args = [] takes_options = [] - takes_optiongroups = {} + takes_optiongroups = { + "sambaopts": options.SambaOptions, + "credopts": options.CredentialsOptions, + "versionopts": options.VersionOptions, + } def _create_parser(self): parser = optparse.OptionParser(self.synopsis) diff --git a/source4/scripting/python/samba/netcmd/dbcheck.py b/source4/scripting/python/samba/netcmd/dbcheck.py index 6c47f85346..299879b2c6 100644 --- a/source4/scripting/python/samba/netcmd/dbcheck.py +++ b/source4/scripting/python/samba/netcmd/dbcheck.py @@ -3,6 +3,7 @@ # Samba4 AD database checker # # Copyright (C) Andrew Tridgell 2011 +# Copyright Giampaolo Lauria 2011 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -34,12 +35,6 @@ class cmd_dbcheck(Command): """check local AD database for errors""" synopsis = "dbcheck [options]" - takes_optiongroups = { - "sambaopts": options.SambaOptions, - "versionopts": options.VersionOptions, - "credopts": options.CredentialsOptionsDouble, - } - takes_args = ["DN?"] takes_options = [ diff --git a/source4/scripting/python/samba/netcmd/delegation.py b/source4/scripting/python/samba/netcmd/delegation.py index 1307c14cda..1980203f9d 100644 --- a/source4/scripting/python/samba/netcmd/delegation.py +++ b/source4/scripting/python/samba/netcmd/delegation.py @@ -5,6 +5,7 @@ # Copyright Matthieu Patou mat@samba.org 2010 # Copyright Stefan Metzmacher metze@samba.org 2011 # Copyright Bjoern Baumbach bb@sernet.de 2011 +# Copyright Giampaolo Lauria 2011 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -59,12 +60,6 @@ class cmd_delegation_show(Command): """Show the delegation setting of an account.""" synopsis = "%prog delegation show " - takes_optiongroups = { - "sambaopts": options.SambaOptions, - "credopts": options.CredentialsOptions, - "versionopts": options.VersionOptions, - } - takes_args = ["accountname"] def run(self, accountname, credopts=None, sambaopts=None, versionopts=None): @@ -106,12 +101,6 @@ class cmd_delegation_for_any_service(Command): """Set/unset UF_TRUSTED_FOR_DELEGATION for an account.""" synopsis = "%prog delegation for-any-service on|off" - takes_optiongroups = { - "sambaopts": options.SambaOptions, - "credopts": options.CredentialsOptions, - "versionopts": options.VersionOptions, - } - takes_args = ["accountname", "onoff"] def run(self, accountname, onoff, credopts=None, sambaopts=None, versionopts=None): @@ -144,12 +133,6 @@ class cmd_delegation_for_any_protocol(Command): """Set/unset UF_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION (S4U2Proxy) for an account.""" synopsis = "%prog delegation for-any-protocol on|off" - takes_optiongroups = { - "sambaopts": options.SambaOptions, - "credopts": options.CredentialsOptions, - "versionopts": options.VersionOptions, - } - takes_args = ["accountname", "onoff"] def run(self, accountname, onoff, credopts=None, sambaopts=None, versionopts=None): @@ -182,12 +165,6 @@ class cmd_delegation_add_service(Command): """Add a service principal as msDS-AllowedToDelegateTo""" synopsis = "%prog delegation add-service " - takes_optiongroups = { - "sambaopts": options.SambaOptions, - "credopts": options.CredentialsOptions, - "versionopts": options.VersionOptions, - } - takes_args = ["accountname", "principal"] def run(self, accountname, principal, credopts=None, sambaopts=None, versionopts=None): @@ -221,12 +198,6 @@ class cmd_delegation_del_service(Command): """Add a service principal as msDS-AllowedToDelegateTo""" synopsis = "%prog delegation del-service " - takes_optiongroups = { - "sambaopts": options.SambaOptions, - "credopts": options.CredentialsOptions, - "versionopts": options.VersionOptions, - } - takes_args = ["accountname", "principal"] def run(self, accountname, principal, credopts=None, sambaopts=None, versionopts=None): diff --git a/source4/scripting/python/samba/netcmd/domain.py b/source4/scripting/python/samba/netcmd/domain.py index f56dd97b81..110a865373 100644 --- a/source4/scripting/python/samba/netcmd/domain.py +++ b/source4/scripting/python/samba/netcmd/domain.py @@ -54,12 +54,6 @@ class cmd_domain_dumpkeys(Command): """Dumps kerberos keys of the domain into a keytab""" synopsis = "%prog domain dumpkeys " - takes_optiongroups = { - "sambaopts": options.SambaOptions, - "credopts": options.CredentialsOptions, - "versionopts": options.VersionOptions, - } - takes_options = [ ] @@ -77,12 +71,6 @@ class cmd_domain_join(Command): synopsis = "%prog domain join [DC | RODC | MEMBER] [options]" - takes_optiongroups = { - "sambaopts": options.SambaOptions, - "versionopts": options.VersionOptions, - "credopts": options.CredentialsOptions, - } - takes_options = [ Option("--server", help="DC to join", type=str), Option("--site", help="site to join", type=str), @@ -130,12 +118,6 @@ class cmd_domain_level(Command): synopsis = "%prog domain level (show | raise )" - takes_optiongroups = { - "sambaopts": options.SambaOptions, - "credopts": options.CredentialsOptions, - "versionopts": options.VersionOptions, - } - takes_options = [ Option("-H", help="LDB URL for database or target server", type=str), Option("--quiet", help="Be quiet", action="store_true"), @@ -321,12 +303,6 @@ class cmd_domain_machinepassword(Command): synopsis = "%prog domain machinepassword " - takes_optiongroups = { - "sambaopts": options.SambaOptions, - "versionopts": options.VersionOptions, - "credopts": options.CredentialsOptions, - } - takes_args = ["secret"] def run(self, secret, sambaopts=None, credopts=None, versionopts=None): @@ -358,12 +334,6 @@ class cmd_domain_passwordsettings(Command): synopsis = "%prog domain passwordsettings (show | set )" - takes_optiongroups = { - "sambaopts": options.SambaOptions, - "versionopts": options.VersionOptions, - "credopts": options.CredentialsOptions, - } - takes_options = [ Option("-H", help="LDB URL for database or target server", type=str), Option("--quiet", help="Be quiet", action="store_true"), diff --git a/source4/scripting/python/samba/netcmd/drs.py b/source4/scripting/python/samba/netcmd/drs.py index 61717a70e9..2cf78cce84 100644 --- a/source4/scripting/python/samba/netcmd/drs.py +++ b/source4/scripting/python/samba/netcmd/drs.py @@ -3,6 +3,7 @@ # implement samba_tool drs commands # # Copyright Andrew Tridgell 2010 +# Copyright Giampaolo Lauria 2011 # # based on C implementation by Kamen Mazdrashki # @@ -94,12 +95,6 @@ class cmd_drs_showrepl(Command): synopsis = "%prog drs showrepl " - takes_optiongroups = { - "sambaopts": options.SambaOptions, - "versionopts": options.VersionOptions, - "credopts": options.CredentialsOptions, - } - takes_args = ["DC?"] def print_neighbour(self, n): @@ -205,12 +200,6 @@ class cmd_drs_kcc(Command): synopsis = "%prog drs kcc " - takes_optiongroups = { - "sambaopts": options.SambaOptions, - "versionopts": options.VersionOptions, - "credopts": options.CredentialsOptions, - } - takes_args = ["DC?"] def run(self, DC=None, sambaopts=None, @@ -272,12 +261,6 @@ class cmd_drs_replicate(Command): synopsis = "%prog drs replicate " - takes_optiongroups = { - "sambaopts": options.SambaOptions, - "versionopts": options.VersionOptions, - "credopts": options.CredentialsOptions, - } - takes_args = ["DEST_DC", "SOURCE_DC", "NC"] takes_options = [ @@ -346,12 +329,6 @@ class cmd_drs_bind(Command): synopsis = "%prog drs bind " - takes_optiongroups = { - "sambaopts": options.SambaOptions, - "versionopts": options.VersionOptions, - "credopts": options.CredentialsOptions, - } - takes_args = ["DC?"] def run(self, DC=None, sambaopts=None, @@ -447,12 +424,6 @@ class cmd_drs_options(Command): " [--dsa-option={+|-}IS_GC | {+|-}DISABLE_INBOUND_REPL" " |{+|-}DISABLE_OUTBOUND_REPL | {+|-}DISABLE_NTDSCONN_XLATE]") - takes_optiongroups = { - "sambaopts": options.SambaOptions, - "versionopts": options.VersionOptions, - "credopts": options.CredentialsOptions, - } - takes_args = ["DC?"] takes_options = [ diff --git a/source4/scripting/python/samba/netcmd/dsacl.py b/source4/scripting/python/samba/netcmd/dsacl.py index 58a3552687..5eee235b41 100644 --- a/source4/scripting/python/samba/netcmd/dsacl.py +++ b/source4/scripting/python/samba/netcmd/dsacl.py @@ -3,6 +3,7 @@ # Manipulate ACLs on directory objects # # Copyright (C) Nadezhda Ivanova 2010 +# Copyright Giampaolo Lauria 2011 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -50,12 +51,6 @@ class cmd_ds_acl_set(Command): synopsis = "set --objectdn=objectdn --car=control right --action=[deny|allow] --trusteedn=trustee-dn" car_help = """ The access control right to allow or deny """ - takes_optiongroups = { - "sambaopts": options.SambaOptions, - "credopts": options.CredentialsOptions, - "versionopts": options.VersionOptions, - } - takes_options = [ Option("--host", help="LDB URL for database or target server", type=str), diff --git a/source4/scripting/python/samba/netcmd/fsmo.py b/source4/scripting/python/samba/netcmd/fsmo.py index 3e9067e7a0..aaf7d138e6 100644 --- a/source4/scripting/python/samba/netcmd/fsmo.py +++ b/source4/scripting/python/samba/netcmd/fsmo.py @@ -4,6 +4,7 @@ # # Copyright Nadezhda Ivanova 2009 # Copyright Jelmer Vernooij 2009 +# Copyright Giampaolo Lauria 2011 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -36,12 +37,6 @@ class cmd_fsmo(Command): synopsis = "(show | transfer | seize )" - takes_optiongroups = { - "sambaopts": options.SambaOptions, - "credopts": options.CredentialsOptions, - "versionopts": options.VersionOptions, - } - takes_options = [ Option("--url", help="LDB URL for database or target server", type=str), Option("--force", help="Force seizing of the role without attempting to transfer first.", action="store_true"), diff --git a/source4/scripting/python/samba/netcmd/gpo.py b/source4/scripting/python/samba/netcmd/gpo.py index fac9167076..2a6bef0f37 100644 --- a/source4/scripting/python/samba/netcmd/gpo.py +++ b/source4/scripting/python/samba/netcmd/gpo.py @@ -3,6 +3,7 @@ # implement samba_tool gpo commands # # Copyright Andrew Tridgell 2010 +# Copyright Giampaolo Lauria 2011 # # based on C implementation by Guenther Deschner and Wilco Baan Hofman # @@ -88,12 +89,6 @@ class cmd_listall(Command): synopsis = "%prog gpo listall" - takes_optiongroups = { - "sambaopts": options.SambaOptions, - "versionopts": options.VersionOptions, - "credopts": options.CredentialsOptions, - } - takes_options = [ Option("-H", help="LDB URL for database or target server", type=str) ] @@ -136,12 +131,6 @@ class cmd_list(Command): synopsis = "%prog gpo list " - takes_optiongroups = { - "sambaopts": options.SambaOptions, - "versionopts": options.VersionOptions, - "credopts": options.CredentialsOptions, - } - takes_args = [ 'username' ] takes_options = [ diff --git a/source4/scripting/python/samba/netcmd/group.py b/source4/scripting/python/samba/netcmd/group.py index 95db21adfc..7f3b6cdef9 100644 --- a/source4/scripting/python/samba/netcmd/group.py +++ b/source4/scripting/python/samba/netcmd/group.py @@ -5,6 +5,7 @@ # # Based on the original in EJS: # Copyright Andrew Tridgell 2005 +# Copyright Giampaolo Lauria 2011 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -44,12 +45,6 @@ class cmd_group_add(Command): synopsis = "%prog group add [options] " - takes_optiongroups = { - "sambaopts": options.SambaOptions, - "versionopts": options.VersionOptions, - "credopts": options.CredentialsOptions, - } - takes_options = [ Option("-H", help="LDB URL for database or target server", type=str), Option("--groupou", @@ -93,12 +88,6 @@ class cmd_group_delete(Command): synopsis = "%prog group delete " - takes_optiongroups = { - "sambaopts": options.SambaOptions, - "versionopts": options.VersionOptions, - "credopts": options.CredentialsOptions, - } - takes_options = [ Option("-H", help="LDB URL for database or target server", type=str), ] @@ -124,12 +113,6 @@ class cmd_group_add_members(Command): synopsis = "%prog group addmembers " - takes_optiongroups = { - "sambaopts": options.SambaOptions, - "versionopts": options.VersionOptions, - "credopts": options.CredentialsOptions, - } - takes_options = [ Option("-H", help="LDB URL for database or target server", type=str), ] @@ -156,12 +139,6 @@ class cmd_group_remove_members(Command): synopsis = "%prog group removemembers " - takes_optiongroups = { - "sambaopts": options.SambaOptions, - "versionopts": options.VersionOptions, - "credopts": options.CredentialsOptions, - } - takes_options = [ Option("-H", help="LDB URL for database or target server", type=str), ] diff --git a/source4/scripting/python/samba/netcmd/ldapcmp.py b/source4/scripting/python/samba/netcmd/ldapcmp.py index c752d76a7b..44badce2e9 100755 --- a/source4/scripting/python/samba/netcmd/ldapcmp.py +++ b/source4/scripting/python/samba/netcmd/ldapcmp.py @@ -8,6 +8,7 @@ # above partitions. # Copyright (C) Zahari Zahariev 2009, 2010 +# Copyright Giampaolo Lauria 2011 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -841,12 +842,6 @@ class cmd_ldapcmp(Command): """compare two ldap databases""" synopsis = "ldapcmp URL1 URL2 [options]" - takes_optiongroups = { - "sambaopts": options.SambaOptions, - "versionopts": options.VersionOptions, - "credopts": options.CredentialsOptionsDouble, - } - takes_args = ["URL1", "URL2", "context1?", "context2?", "context3?"] takes_options = [ diff --git a/source4/scripting/python/samba/netcmd/netacl.py b/source4/scripting/python/samba/netcmd/netacl.py index 3f68ee756c..a0f4cf33b1 100644 --- a/source4/scripting/python/samba/netcmd/netacl.py +++ b/source4/scripting/python/samba/netcmd/netacl.py @@ -4,6 +4,7 @@ # # Copyright (C) Matthieu Patou 2010 # Copyright (C) Nadezhda Ivanova 2010 +# Copyright Giampaolo Lauria 2011 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/source4/scripting/python/samba/netcmd/newuser.py b/source4/scripting/python/samba/netcmd/newuser.py index 3581340577..68a66f6e55 100644 --- a/source4/scripting/python/samba/netcmd/newuser.py +++ b/source4/scripting/python/samba/netcmd/newuser.py @@ -5,6 +5,7 @@ # # Based on the original in EJS: # Copyright Andrew Tridgell 2005 +# Copyright Giampaolo Lauria 2011 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -32,12 +33,6 @@ class cmd_newuser(Command): synopsis = "newuser [options] []" - takes_optiongroups = { - "sambaopts": options.SambaOptions, - "versionopts": options.VersionOptions, - "credopts": options.CredentialsOptions, - } - takes_options = [ Option("-H", help="LDB URL for database or target server", type=str), Option("--must-change-at-next-login", diff --git a/source4/scripting/python/samba/netcmd/ntacl.py b/source4/scripting/python/samba/netcmd/ntacl.py index 49f8fbc77f..d33dc9b9a6 100644 --- a/source4/scripting/python/samba/netcmd/ntacl.py +++ b/source4/scripting/python/samba/netcmd/ntacl.py @@ -3,6 +3,7 @@ # Manipulate file NT ACLs # # Copyright Matthieu Patou 2010 +# Copyright Giampaolo Lauria 2011 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -40,12 +41,6 @@ class cmd_acl_set(Command): """Set ACLs on a file""" synopsis = "%prog set [--xattr-backend=native|tdb] [--eadb-file=file] [options]" - takes_optiongroups = { - "sambaopts": options.SambaOptions, - "credopts": options.CredentialsOptions, - "versionopts": options.VersionOptions, - } - takes_options = [ Option("--quiet", help="Be quiet", action="store_true"), Option("--xattr-backend", type="choice", help="xattr backend type (native fs or tdb)", @@ -83,12 +78,6 @@ class cmd_acl_get(Command): """Set ACLs on a file""" synopsis = "%prog get [--as-sddl] [--xattr-backend=native|tdb] [--eadb-file=file] [options]" - takes_optiongroups = { - "sambaopts": options.SambaOptions, - "credopts": options.CredentialsOptions, - "versionopts": options.VersionOptions, - } - takes_options = [ Option("--as-sddl", help="Output ACL in the SDDL format", action="store_true"), Option("--xattr-backend", type="choice", help="xattr backend type (native fs or tdb)", diff --git a/source4/scripting/python/samba/netcmd/rodc.py b/source4/scripting/python/samba/netcmd/rodc.py index f4daac853d..411221e24f 100644 --- a/source4/scripting/python/samba/netcmd/rodc.py +++ b/source4/scripting/python/samba/netcmd/rodc.py @@ -3,6 +3,7 @@ # rodc related commands # # Copyright Andrew Tridgell 2010 +# Copyright Giampaolo Lauria 2011 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -32,12 +33,6 @@ class cmd_rodc_preload(Command): synopsis = "%prog rodc preload " - takes_optiongroups = { - "sambaopts": options.SambaOptions, - "versionopts": options.VersionOptions, - "credopts": options.CredentialsOptions, - } - takes_options = [ Option("--server", help="DC to use", type=str), ] diff --git a/source4/scripting/python/samba/netcmd/spn.py b/source4/scripting/python/samba/netcmd/spn.py index 4cfa21fa03..e81cdce4f3 100644 --- a/source4/scripting/python/samba/netcmd/spn.py +++ b/source4/scripting/python/samba/netcmd/spn.py @@ -3,6 +3,7 @@ # spn management # # Copyright Matthieu Patou mat@samba.org 2010 +# Copyright Giampaolo Lauria 2011 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -56,12 +57,6 @@ class cmd_spn_list(Command): """List spns of a given user.""" synopsis = "%prog spn list " - takes_optiongroups = { - "sambaopts": options.SambaOptions, - "credopts": options.CredentialsOptions, - "versionopts": options.VersionOptions, - } - takes_args = ["user"] def run(self, user, credopts=None, sambaopts=None, versionopts=None): @@ -95,11 +90,6 @@ class cmd_spn_add(Command): """Create a new spn.""" synopsis = "%prog spn add [--force] " - takes_optiongroups = { - "sambaopts": options.SambaOptions, - "credopts": options.CredentialsOptions, - "versionopts": options.VersionOptions, - } takes_options = [ Option("--force", help="Force the addition of the spn"\ " even it exists already", action="store_true"), @@ -153,12 +143,6 @@ class cmd_spn_delete(Command): """Delete a spn.""" synopsis = "%prog spn delete [user]" - takes_optiongroups = { - "sambaopts": options.SambaOptions, - "credopts": options.CredentialsOptions, - "versionopts": options.VersionOptions, - } - takes_args = ["name", "user?"] def run(self, name, user=None, credopts=None, sambaopts=None, versionopts=None): diff --git a/source4/scripting/python/samba/netcmd/testparm.py b/source4/scripting/python/samba/netcmd/testparm.py index ec448588ef..7a0e538ca2 100755 --- a/source4/scripting/python/samba/netcmd/testparm.py +++ b/source4/scripting/python/samba/netcmd/testparm.py @@ -4,6 +4,7 @@ # Unix SMB/CIFS implementation. # Test validity of smb.conf # Copyright (C) Karl Auer 1993, 1994-1998 +# Copyright Giampaolo Lauria 2011 # # Extensively modified by Andrew Tridgell, 1995 # Converted to popt by Jelmer Vernooij (jelmer@nl.linux.org), 2002 @@ -45,11 +46,6 @@ class cmd_testparm(Command): synopsis = "" - takes_optiongroups = { - "sambaopts": options.SambaOptions, - "versionopts": options.VersionOptions - } - takes_options = [ Option("--section-name", type=str, help="Limit testparm to a named section"), diff --git a/source4/scripting/python/samba/netcmd/time.py b/source4/scripting/python/samba/netcmd/time.py index e13d3df96c..af4e177ed7 100644 --- a/source4/scripting/python/samba/netcmd/time.py +++ b/source4/scripting/python/samba/netcmd/time.py @@ -3,6 +3,7 @@ # time # # Copyright Jelmer Vernooij 2010 +# Copyright Giampaolo Lauria 2011 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -30,12 +31,6 @@ class cmd_time(Command): """Retrieve the time on a remote server [server connection needed]""" synopsis = "%prog time " - takes_optiongroups = { - "sambaopts": options.SambaOptions, - "credopts": options.CredentialsOptions, - "versionopts": options.VersionOptions, - } - takes_args = ["server_name?"] def run(self, server_name=None, credopts=None, sambaopts=None, versionopts=None): diff --git a/source4/scripting/python/samba/netcmd/user.py b/source4/scripting/python/samba/netcmd/user.py index 237f1b60a0..2beb008980 100644 --- a/source4/scripting/python/samba/netcmd/user.py +++ b/source4/scripting/python/samba/netcmd/user.py @@ -4,6 +4,7 @@ # # Copyright Jelmer Vernooij 2010 # Copyright Theresa Halloran 2011 +# Copyright Giampaolo Lauria 2011 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -39,12 +40,6 @@ class cmd_user_add(Command): """Create a new user.""" synopsis = "%prog user add []" - takes_optiongroups = { - "sambaopts": options.SambaOptions, - "credopts": options.CredentialsOptions, - "versionopts": options.VersionOptions, - } - takes_args = ["name", "password?"] def run(self, name, password=None, credopts=None, sambaopts=None, versionopts=None): @@ -60,12 +55,6 @@ class cmd_user_delete(Command): """Delete a user.""" synopsis = "%prog user delete " - takes_optiongroups = { - "sambaopts": options.SambaOptions, - "credopts": options.CredentialsOptions, - "versionopts": options.VersionOptions, - } - takes_args = ["name"] def run(self, name, credopts=None, sambaopts=None, versionopts=None): @@ -83,13 +72,6 @@ class cmd_user_enable(Command): synopsis = "%prog user enable [options]" - - takes_optiongroups = { - "sambaopts": options.SambaOptions, - "versionopts": options.VersionOptions, - "credopts": options.CredentialsOptions, - } - takes_options = [ Option("-H", help="LDB URL for database or target server", type=str), Option("--filter", help="LDAP Filter to set password on", type=str), @@ -122,12 +104,6 @@ class cmd_user_setexpiry(Command): synopsis = "%prog user setexpiry [options]" - takes_optiongroups = { - "sambaopts": options.SambaOptions, - "versionopts": options.VersionOptions, - "credopts": options.CredentialsOptions, - } - takes_options = [ Option("-H", help="LDB URL for database or target server", type=str), Option("--filter", help="LDAP Filter to set password on", type=str), @@ -165,12 +141,6 @@ class cmd_user_setpassword(Command): synopsis = "%prog user setpassword [username] [options]" - takes_optiongroups = { - "sambaopts": options.SambaOptions, - "versionopts": options.VersionOptions, - "credopts": options.CredentialsOptions, - } - takes_options = [ Option("-H", help="LDB URL for database or target server", type=str), Option("--filter", help="LDAP Filter to set password on", type=str), diff --git a/source4/scripting/python/samba/netcmd/vampire.py b/source4/scripting/python/samba/netcmd/vampire.py index 4313177ae3..8c0c25cd98 100644 --- a/source4/scripting/python/samba/netcmd/vampire.py +++ b/source4/scripting/python/samba/netcmd/vampire.py @@ -3,6 +3,7 @@ # Vampire # # Copyright Jelmer Vernooij 2010 +# Copyright Giampaolo Lauria 2011 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -33,12 +34,6 @@ class cmd_vampire(Command): """Join and synchronise a remote AD domain to the local server [server connection needed]""" synopsis = "%prog vampire [options] " - takes_optiongroups = { - "sambaopts": options.SambaOptions, - "credopts": options.CredentialsOptions, - "versionopts": options.VersionOptions, - } - takes_options = [ Option("--target-dir", help="Target directory.", type=str), Option("--force", help="force run", action='store_true', default=False), -- cgit