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
@ -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"),
|
||||
|
Reference in New Issue
Block a user