samba-tool: moved takes_optiongroups definition to Command base class
authorGiampaolo Lauria <lauria2@yahoo.com>
Fri, 15 Jul 2011 16:07:03 +0000 (12:07 -0400)
committerAndrew Tridgell <tridge@samba.org>
Thu, 21 Jul 2011 00:32:24 +0000 (10:32 +1000)
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 <tridge@samba.org>
19 files changed:
source4/scripting/python/samba/netcmd/__init__.py
source4/scripting/python/samba/netcmd/dbcheck.py
source4/scripting/python/samba/netcmd/delegation.py
source4/scripting/python/samba/netcmd/domain.py
source4/scripting/python/samba/netcmd/drs.py
source4/scripting/python/samba/netcmd/dsacl.py
source4/scripting/python/samba/netcmd/fsmo.py
source4/scripting/python/samba/netcmd/gpo.py
source4/scripting/python/samba/netcmd/group.py
source4/scripting/python/samba/netcmd/ldapcmp.py
source4/scripting/python/samba/netcmd/netacl.py
source4/scripting/python/samba/netcmd/newuser.py
source4/scripting/python/samba/netcmd/ntacl.py
source4/scripting/python/samba/netcmd/rodc.py
source4/scripting/python/samba/netcmd/spn.py
source4/scripting/python/samba/netcmd/testparm.py
source4/scripting/python/samba/netcmd/time.py
source4/scripting/python/samba/netcmd/user.py
source4/scripting/python/samba/netcmd/vampire.py

index 1e032924fca8de2907c7136900cfd2c330e44055..e5c5badb182b6fbbc6fb9d6796524fe423f86287 100644 (file)
@@ -3,6 +3,7 @@
 # Unix SMB/CIFS implementation.
 # Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2009
 # Copyright (C) Theresa Halloran <theresahalloran@gmail.com> 2011
+# Copyright Giampaolo Lauria 2011 <lauria2@yahoo.com>
 #
 # 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)
index 6c47f853468cc4066abb3025cba409265a8a296b..299879b2c642e90906fd738ab66ad51c94374b08 100644 (file)
@@ -3,6 +3,7 @@
 # Samba4 AD database checker
 #
 # Copyright (C) Andrew Tridgell 2011
+# Copyright Giampaolo Lauria 2011 <lauria2@yahoo.com>
 #
 # 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 <DN> [options]"
 
-    takes_optiongroups = {
-        "sambaopts": options.SambaOptions,
-        "versionopts": options.VersionOptions,
-        "credopts": options.CredentialsOptionsDouble,
-    }
-
     takes_args = ["DN?"]
 
     takes_options = [
index 1307c14cda3e99140c9f058d53dd739fda1a0e7b..1980203f9d8200645bc72383def7a4171a1ec624 100644 (file)
@@ -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 <lauria2@yahoo.com>
 #
 # 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 <accountname>"
 
-    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 <accountname> 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 <accountname> 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  <accountname> <principal>"
 
-    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  <accountname> <principal>"
 
-    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):
index f56dd97b811ea3d8ea0fa8bdc1bae2dc73df4d73..110a865373079dea8c7d0cb9b10ac99cf079a465 100644 (file)
@@ -54,12 +54,6 @@ class cmd_domain_dumpkeys(Command):
     """Dumps kerberos keys of the domain into a keytab"""
     synopsis = "%prog domain dumpkeys <keytab>"
 
-    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 <dnsdomain> [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 <options>)"
 
-    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 <accountname>"
 
-    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 <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("--quiet", help="Be quiet", action="store_true"),
index 61717a70e98e7b6698504904f5f0b40bf4c169ea..2cf78cce84b19d676a1f831caf5d9092e25bb173 100644 (file)
@@ -3,6 +3,7 @@
 # implement samba_tool drs commands
 #
 # Copyright Andrew Tridgell 2010
+# Copyright Giampaolo Lauria 2011 <lauria2@yahoo.com>
 #
 # based on C implementation by Kamen Mazdrashki <kamen.mazdrashki@postpath.com>
 #
@@ -94,12 +95,6 @@ class cmd_drs_showrepl(Command):
 
     synopsis = "%prog drs showrepl <DC>"
 
-    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 <DC>"
 
-    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 <DEST_DC> <SOURCE_DC> <NC>"
 
-    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 <DC>"
 
-    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 = [
index 58a35526870982d9e3867942089ff3f278cda4e7..5eee235b41ba772e45efc2fd8f2f6c5af5a37f93 100644 (file)
@@ -3,6 +3,7 @@
 # Manipulate ACLs on directory objects
 #
 # Copyright (C) Nadezhda Ivanova <nivanova@samba.org> 2010
+# Copyright Giampaolo Lauria 2011 <lauria2@yahoo.com>
 #
 # 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),
index 3e9067e7a022e846b5300482c85fb8e8ce7f02df..aaf7d138e6048ab5e8bf9410a36482197fe41578 100644 (file)
@@ -4,6 +4,7 @@
 #
 # Copyright Nadezhda Ivanova 2009
 # Copyright Jelmer Vernooij 2009
+# Copyright Giampaolo Lauria 2011 <lauria2@yahoo.com>
 #
 # 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 <options> | seize <options>)"
 
-    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"),
index fac91670766a532bb0f2352be39822e1f1ac3330..2a6bef0f37f5be96fc01988797c8fbb846eb0658 100644 (file)
@@ -3,6 +3,7 @@
 # implement samba_tool gpo commands
 #
 # Copyright Andrew Tridgell 2010
+# Copyright Giampaolo Lauria 2011 <lauria2@yahoo.com>
 #
 # 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 <username>"
 
-    takes_optiongroups = {
-        "sambaopts": options.SambaOptions,
-        "versionopts": options.VersionOptions,
-        "credopts": options.CredentialsOptions,
-    }
-
     takes_args = [ 'username' ]
 
     takes_options = [
index 95db21adfcf0212c97059880950767c46115ca57..7f3b6cdef9abd47c53cf104e4eb482a0c8f3b44d 100644 (file)
@@ -5,6 +5,7 @@
 #
 # Based on the original in EJS:
 # Copyright Andrew Tridgell 2005
+# Copyright Giampaolo Lauria 2011 <lauria2@yahoo.com>
 #
 # 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] <groupname>"
 
-    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 <groupname>"
 
-    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 <groupname> <listofmembers>"
 
-    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 <groupname> <listofmembers>"
 
-    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),
     ]
index c752d76a7b66b57ebd2dbe1fc1d36c440dedec9b..44badce2e93fb448b5b2ee8803639fbbdc453743 100755 (executable)
@@ -8,6 +8,7 @@
 # above partitions.
 
 # Copyright (C) Zahari Zahariev <zahari.zahariev@postpath.com> 2009, 2010
+# Copyright Giampaolo Lauria 2011 <lauria2@yahoo.com>
 #
 # 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 <domain|configuration|schema> [options]"
 
-    takes_optiongroups = {
-        "sambaopts": options.SambaOptions,
-        "versionopts": options.VersionOptions,
-        "credopts": options.CredentialsOptionsDouble,
-    }
-
     takes_args = ["URL1", "URL2", "context1?", "context2?", "context3?"]
 
     takes_options = [
index 3f68ee756cdec24f19555b1b8ba3a43baba59b2b..a0f4cf33b1d27e6a5e58feabd2334842163e9f49 100644 (file)
@@ -4,6 +4,7 @@
 #
 # Copyright (C) Matthieu Patou <mat@matws.net> 2010
 # Copyright (C) Nadezhda Ivanova <nivanova@samba.org> 2010
+# Copyright Giampaolo Lauria 2011 <lauria2@yahoo.com>
 #
 # 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
index 3581340577b501e79043dff656ebbd07f93fef9f..68a66f6e55fb9449c050d0681a9d5974efc466df 100644 (file)
@@ -5,6 +5,7 @@
 #
 # Based on the original in EJS:
 # Copyright Andrew Tridgell 2005
+# Copyright Giampaolo Lauria 2011 <lauria2@yahoo.com>
 #
 # 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] <username> [<password>]"
 
-    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",
index 49f8fbc77f0118f2dca7fd6b60ac243723e64a6b..d33dc9b9a6d9f898bf53329e0b1421d101ce7a0b 100644 (file)
@@ -3,6 +3,7 @@
 # Manipulate file NT ACLs
 #
 # Copyright Matthieu Patou 2010 <mat@matws.net>
+# Copyright Giampaolo Lauria 2011 <lauria2@yahoo.com>
 #
 # 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 <acl> <file> [--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 <file> [--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)",
index f4daac853d4410ae0b0dfcad4bc8413ef1dbae92..411221e24f7cb7f471c66f446ab220665353f63a 100644 (file)
@@ -3,6 +3,7 @@
 # rodc related commands
 #
 # Copyright Andrew Tridgell 2010
+# Copyright Giampaolo Lauria 2011 <lauria2@yahoo.com>
 #
 # 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 <SID|DN|accountname>"
 
-    takes_optiongroups = {
-        "sambaopts": options.SambaOptions,
-        "versionopts": options.VersionOptions,
-        "credopts": options.CredentialsOptions,
-    }
-
     takes_options = [
         Option("--server", help="DC to use", type=str),
         ]
index 4cfa21fa03f36658bfb72fa1c047adcaf1336413..e81cdce4f309019024e4808d247d12521054af81 100644 (file)
@@ -3,6 +3,7 @@
 # spn management
 #
 # Copyright Matthieu Patou mat@samba.org 2010
+# Copyright Giampaolo Lauria 2011 <lauria2@yahoo.com>
 #
 # 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 <user>"
 
-    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] <name> <user>"
 
-    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 <name> [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):
index ec448588ef902363785eb8a47f1381288aa37834..7a0e538ca295aa5373639eda2d937b69ee488560 100755 (executable)
@@ -4,6 +4,7 @@
 #   Unix SMB/CIFS implementation.
 #   Test validity of smb.conf
 #   Copyright (C) Karl Auer 1993, 1994-1998
+#   Copyright Giampaolo Lauria 2011 <lauria2@yahoo.com>
 #
 #   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"),
index e13d3df96caed4ad7bea9f68e21a31547457cf49..af4e177ed749f1cd765e8b5e3a1f19f51ced6319 100644 (file)
@@ -3,6 +3,7 @@
 # time
 #
 # Copyright Jelmer Vernooij 2010 <jelmer@samba.org>
+# Copyright Giampaolo Lauria 2011 <lauria2@yahoo.com>
 #
 # 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 <server-name>"
 
-    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):
index 237f1b60a092519a341eb3fb902c624cb3f7c1ee..2beb008980f509458a3f87fffae9eb7472031696 100644 (file)
@@ -4,6 +4,7 @@
 #
 # Copyright Jelmer Vernooij 2010 <jelmer@samba.org>
 # Copyright Theresa Halloran 2011 <theresahalloran@gmail.com>
+# Copyright Giampaolo Lauria 2011 <lauria2@yahoo.com>
 #
 # 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 <name> [<password>]"
 
-    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 <name>"
 
-    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 <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),
@@ -122,12 +104,6 @@ class cmd_user_setexpiry(Command):
 
     synopsis = "%prog user setexpiry <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),
@@ -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),
index 4313177ae3e6495e6ebe5688026210a137287e43..8c0c25cd983b1118e43537e267a96b492d1fde47 100644 (file)
@@ -3,6 +3,7 @@
 # Vampire
 #
 # Copyright Jelmer Vernooij 2010 <jelmer@samba.org>
+# Copyright Giampaolo Lauria 2011 <lauria2@yahoo.com>
 #
 # 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] <domain>"
 
-    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),