mirror of
https://github.com/samba-team/samba.git
synced 2025-07-25 00:59:11 +03:00
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 <tridge@samba.org>
This commit is contained in:
committed by
Andrew Tridgell
parent
1dfcb019d2
commit
f6fa868489
@ -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):
|
||||
|
Reference in New Issue
Block a user