mirror of
https://github.com/samba-team/samba.git
synced 2025-07-27 07:42:04 +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
@ -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 = [
|
||||
|
Reference in New Issue
Block a user