Merge "Improve swift-init usage statement"

This commit is contained in:
Jenkins 2015-11-26 01:43:28 +00:00 committed by Gerrit Code Review
commit b37205fe2d
2 changed files with 22 additions and 5 deletions

View File

@ -20,7 +20,21 @@ from optparse import OptionParser
from swift.common.manager import Manager, UnknownCommandError, \
KILL_WAIT, RUN_DIR
USAGE = """%prog <server>[.config] [<server>[.config] ...] <command> [options]
USAGE = \
"""%prog <server>[.<config>] [<server>[.<config>] ...] <command> [options]
where:
<server> is the name of a swift service e.g. proxy-server.
The '-server' part of the name may be omitted.
<config> is an explicit configuration filename without the
.conf extension. If <config> is specified then <server> should
refer to a directory containing the configuration file, e.g.:
swift-init object.1 start
will start an object-server using the configuration file
/etc/swift/object-server/1.conf
<command> is a command from the list below.
Commands:
""" + '\n'.join(["%16s: %s" % x for x in Manager.list_commands()])
@ -53,13 +67,13 @@ def main():
# Changing behaviour if missing config
parser.add_option('--strict', dest='strict', action='store_true',
help="Return non-zero status code if some config is "
"missing. Default mode if server is explicitly "
"named.")
"missing. Default mode if all servers are "
"explicitly named.")
# a negative option for strict
parser.add_option('--non-strict', dest='strict', action='store_false',
help="Return zero status code even if some config is "
"missing. Default mode if server is one of aliases "
"`all`, `main` or `rest`.")
"missing. Default mode if any server is a glob or "
"one of aliases `all`, `main` or `rest`.")
options, args = parser.parse_args()

View File

@ -2038,6 +2038,9 @@ def search_tree(root, glob_match, ext='', exts=None, dir_ext=None):
:param glob_match: glob to match in root, matching dirs are traversed with
os.walk
:param ext: only files that end in ext will be returned
:param exts: a list of file extensions; only files that end in one of these
extensions will be returned; if set this list overrides any
extension specified using the 'ext' param.
:param dir_ext: if present directories that end with dir_ext will not be
traversed and instead will be returned as a matched path