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)