Merge "Allow to start/stop multiple servers"

This commit is contained in:
Jenkins 2014-11-13 16:34:15 +00:00 committed by Gerrit Code Review
commit 252cd0819a

View File

@ -1435,16 +1435,26 @@ def do_unpause(cs, args):
_find_server(cs, args.server).unpause() _find_server(cs, args.server).unpause()
@utils.arg('server', metavar='<server>', help=_('Name or ID of server.')) @utils.arg('server', metavar='<server>', nargs='+',
help=_('Name or ID of server(s).'))
def do_stop(cs, args): def do_stop(cs, args):
"""Stop a server.""" """Stop the server(s)."""
_find_server(cs, args.server).stop() utils.do_action_on_many(
lambda s: _find_server(cs, s).stop(),
args.server,
_("Request to stop server %s has been accepted."),
_("Unable to stop the specified server(s)."))
@utils.arg('server', metavar='<server>', help=_('Name or ID of server.')) @utils.arg('server', metavar='<server>', nargs='+',
help=_('Name or ID of server(s).'))
def do_start(cs, args): def do_start(cs, args):
"""Start a server.""" """Start the server(s)."""
_find_server(cs, args.server).start() utils.do_action_on_many(
lambda s: _find_server(cs, s).start(),
args.server,
_("Request to start server %s has been accepted."),
_("Unable to start the specified server(s)."))
@utils.arg('server', metavar='<server>', help=_('Name or ID of server.')) @utils.arg('server', metavar='<server>', help=_('Name or ID of server.'))