summaryrefslogtreecommitdiffstats
path: root/ipapython/admintool.py
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2012-12-18 07:42:18 -0500
committerRob Crittenden <rcritten@redhat.com>2013-02-01 13:44:59 -0500
commit26c498736ec8eabb8dafbc090811c92c79a8c318 (patch)
treef4c2187920025a5f98b26e699179e3fdcd9d7b62 /ipapython/admintool.py
parent55cfd06e3a9cb730220836b07207f4e650de3a03 (diff)
downloadfreeipa-26c498736ec8eabb8dafbc090811c92c79a8c318.tar.gz
freeipa-26c498736ec8eabb8dafbc090811c92c79a8c318.tar.xz
freeipa-26c498736ec8eabb8dafbc090811c92c79a8c318.zip
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
Diffstat (limited to 'ipapython/admintool.py')
-rw-r--r--ipapython/admintool.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/ipapython/admintool.py b/ipapython/admintool.py
index 5bc215165..5beed4a85 100644
--- a/ipapython/admintool.py
+++ b/ipapython/admintool.py
@@ -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)