Merge "Enable "openstack server unpause" command to take multiple servers."

This commit is contained in:
Jenkins 2015-11-16 02:28:41 +00:00 committed by Gerrit Code Review
commit f177160991
3 changed files with 12 additions and 10 deletions

View File

@ -658,17 +658,17 @@ Unlock server
server unpause server unpause
-------------- --------------
Unpause server Unpause server(s)
.. program:: server unpause .. program:: server unpause
.. code:: bash .. code:: bash
os server unpause os server unpause
<server> <server> [<server> ...]
.. describe:: <server> .. describe:: <server>
Server (name or ID) Server(s) to unpause (name or ID)
server unrescue server unrescue
--------------- ---------------

View File

@ -187,7 +187,7 @@ Those actions with an opposite action are noted in parens if applicable.
* ``stop`` (``start``) - stop one or more servers * ``stop`` (``start``) - stop one or more servers
* ``suspend`` (``resume``) - stop a server and save to disk freeing memory * ``suspend`` (``resume``) - stop a server and save to disk freeing memory
* ``unlock`` (``lock``) - unlock a server * ``unlock`` (``lock``) - unlock a server
* ``unpause`` (``pause``) - return a paused server to running state * ``unpause`` (``pause``) - return one or more paused servers to running state
* ``unrescue`` (``rescue``) - return a server to normal boot mode * ``unrescue`` (``rescue``) - return a server to normal boot mode
* ``unset`` (``set``) - remove an attribute of the object * ``unset`` (``set``) - remove an attribute of the object

View File

@ -1631,7 +1631,7 @@ class UnlockServer(command.Command):
class UnpauseServer(command.Command): class UnpauseServer(command.Command):
"""Unpause server""" """Unpause server(s)"""
log = logging.getLogger(__name__ + '.UnpauseServer') log = logging.getLogger(__name__ + '.UnpauseServer')
@ -1640,7 +1640,8 @@ class UnpauseServer(command.Command):
parser.add_argument( parser.add_argument(
'server', 'server',
metavar='<server>', metavar='<server>',
help=_('Server (name or ID)'), nargs='+',
help=_('Server(s) to unpause (name or ID)'),
) )
return parser return parser
@ -1648,10 +1649,11 @@ class UnpauseServer(command.Command):
def take_action(self, parsed_args): def take_action(self, parsed_args):
compute_client = self.app.client_manager.compute compute_client = self.app.client_manager.compute
utils.find_resource( for server in parsed_args.server:
compute_client.servers, utils.find_resource(
parsed_args.server, compute_client.servers,
).unpause() server,
).unpause()
class UnrescueServer(command.Command): class UnrescueServer(command.Command):