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
--------------
Unpause server
Unpause server(s)
.. program:: server unpause
.. code:: bash
os server unpause
<server>
<server> [<server> ...]
.. describe:: <server>
Server (name or ID)
Server(s) to unpause (name or ID)
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
* ``suspend`` (``resume``) - stop a server and save to disk freeing memory
* ``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
* ``unset`` (``set``) - remove an attribute of the object

View File

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