From: Alfredo Deza Date: Wed, 18 Sep 2013 19:47:25 +0000 (-0400) Subject: add better help for mon subcommands X-Git-Tag: v1.2.7~16^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2ef1651f457d23848d83bea7aa7b52be83e51a40;p=ceph-deploy.git add better help for mon subcommands Signed-off-by: Alfredo Deza --- diff --git a/ceph_deploy/mon.py b/ceph_deploy/mon.py index d718d66..852a2e7 100644 --- a/ceph_deploy/mon.py +++ b/ceph_deploy/mon.py @@ -1,8 +1,10 @@ +import argparse import ConfigParser import json import logging import re import subprocess +from textwrap import dedent import time from . import conf @@ -318,21 +320,41 @@ def make(parser): """ Deploy ceph monitor on remote hosts. """ + sub_command_help = dedent(""" + Subcommands: + + create-initial + Will deploy for monitors defined in `mon initial members`, wait until + they form quorum and then gatherkeys, reporting the monitor status along + the process. If monitors don't form quorum the command will eventually + time out. + + create + Deploy monitors by specifying them like: + + ceph-deploy mon create node1 node2 node3 + + If no hosts are passed it will default to use the `mon initial members` + defined in the configuration. + + destroy + Completely remove monitors on a remote host. Requires hostname(s) as + arguments. + """) + parser.formatter_class = argparse.RawDescriptionHelpFormatter + parser.description = sub_command_help + parser.add_argument( 'subcommand', - metavar='SUBCOMMAND', choices=[ 'create', 'create-initial', 'destroy', ], - help='create or destroy', ) parser.add_argument( 'mon', - metavar='HOST', nargs='*', - help='host to deploy on', ) parser.set_defaults( func=mon,