mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2026-09-03 20:52:56 -05:00
Port ipa-replica-prepare to the admintool framework
Break the script into several smaller methods. Use modern idioms: os.path.join instead of string addition; the with statement for closing files. Add --quiet, --verbose, and --log-file options. Use logging instead of print statements. (http://freeipa.org/page/V3/Logging_and_output) Part of: https://fedorahosted.org/freeipa/ticket/2652 Fixes: https://fedorahosted.org/freeipa/ticket/3285
This commit is contained in:
committed by
Rob Crittenden
parent
55cfd06e3a
commit
26c498736e
@@ -77,12 +77,14 @@ class AdminTool(object):
|
||||
command_name - shown in logs
|
||||
log_file_name - if None, logging is to stderr only
|
||||
usage - text shown in help
|
||||
description - text shown in help
|
||||
|
||||
See the setup_logging method for more info on logging.
|
||||
"""
|
||||
command_name = None
|
||||
log_file_name = None
|
||||
usage = None
|
||||
description = None
|
||||
|
||||
log = None
|
||||
_option_parsers = dict()
|
||||
@@ -91,7 +93,8 @@ class AdminTool(object):
|
||||
def make_parser(cls):
|
||||
"""Create an option parser shared across all instances of this class"""
|
||||
parser = config.IPAOptionParser(version=version.VERSION,
|
||||
usage=cls.usage, formatter=config.IPAFormatter())
|
||||
usage=cls.usage, formatter=config.IPAFormatter(),
|
||||
description=cls.description)
|
||||
cls.option_parser = parser
|
||||
cls.add_options(parser)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user