From 0ee5527fa52b219b49082d61d95d84f4b948c02f Mon Sep 17 00:00:00 2001 From: Tang Chen Date: Sat, 24 Oct 2015 11:44:40 +0800 Subject: [PATCH] Trivial clean up: do not use plural form in command arguments. It is a general rule that we don't use plural form for the name of command arguments. But class DeleteServer() is still using "servers". So use "server instead". Change-Id: I2d76de14ec34b88547b9f728b41e9bd93b2a22c5 --- openstackclient/compute/v2/server.py | 4 ++-- openstackclient/tests/compute/v2/test_server.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/openstackclient/compute/v2/server.py b/openstackclient/compute/v2/server.py index 661ce84783..ac71740570 100644 --- a/openstackclient/compute/v2/server.py +++ b/openstackclient/compute/v2/server.py @@ -607,7 +607,7 @@ class DeleteServer(command.Command): def get_parser(self, prog_name): parser = super(DeleteServer, self).get_parser(prog_name) parser.add_argument( - 'servers', + 'server', metavar='', nargs="+", help=_('Server(s) to delete (name or ID)'), @@ -622,7 +622,7 @@ class DeleteServer(command.Command): @utils.log_method(log) def take_action(self, parsed_args): compute_client = self.app.client_manager.compute - for server in parsed_args.servers: + for server in parsed_args.server: server_obj = utils.find_resource( compute_client.servers, server) compute_client.servers.delete(server_obj.id) diff --git a/openstackclient/tests/compute/v2/test_server.py b/openstackclient/tests/compute/v2/test_server.py index 1e99bcd0ba..4f5bdd5b6a 100644 --- a/openstackclient/tests/compute/v2/test_server.py +++ b/openstackclient/tests/compute/v2/test_server.py @@ -311,7 +311,7 @@ class TestServerDelete(TestServer): compute_fakes.server_id, ] verifylist = [ - ('servers', [compute_fakes.server_id]), + ('server', [compute_fakes.server_id]), ] parsed_args = self.check_parser(self.cmd, arglist, verifylist) @@ -328,7 +328,7 @@ class TestServerDelete(TestServer): compute_fakes.server_id, '--wait' ] verifylist = [ - ('servers', [compute_fakes.server_id]), + ('server', [compute_fakes.server_id]), ] parsed_args = self.check_parser(self.cmd, arglist, verifylist) @@ -351,7 +351,7 @@ class TestServerDelete(TestServer): compute_fakes.server_id, '--wait' ] verifylist = [ - ('servers', [compute_fakes.server_id]), + ('server', [compute_fakes.server_id]), ] parsed_args = self.check_parser(self.cmd, arglist, verifylist)