Trivial: Do not use plural format in command parameter in "network delete"
Since "network delete" could delete more than one network, add a (s) to the doc. And also, rename the parameter "networks" to "network". The naming style is not using plural format in parameter. Change-Id: Id434ea905af34457f84ea6bcb18addef5800429a
This commit is contained in:
parent
f65f82e435
commit
2caf7b19e2
@ -62,7 +62,7 @@ Delete network(s)
|
||||
.. _network_delete-project:
|
||||
.. describe:: <network>
|
||||
|
||||
Network to delete (name or ID)
|
||||
Network(s) to delete (name or ID)
|
||||
|
||||
network list
|
||||
------------
|
||||
|
@ -119,17 +119,17 @@ class DeleteNetwork(command.Command):
|
||||
def get_parser(self, prog_name):
|
||||
parser = super(DeleteNetwork, self).get_parser(prog_name)
|
||||
parser.add_argument(
|
||||
'networks',
|
||||
'network',
|
||||
metavar="<network>",
|
||||
nargs="+",
|
||||
help=("Network to delete (name or ID)")
|
||||
help=("Network(s) to delete (name or ID)")
|
||||
)
|
||||
return parser
|
||||
|
||||
def take_action(self, parsed_args):
|
||||
self.log.debug('take_action(%s)' % parsed_args)
|
||||
client = self.app.client_manager.network
|
||||
for network in parsed_args.networks:
|
||||
for network in parsed_args.network:
|
||||
obj = client.find_network(network)
|
||||
client.delete_network(obj)
|
||||
return
|
||||
|
@ -284,7 +284,7 @@ class TestDeleteNetwork(TestNetwork):
|
||||
self._network.name,
|
||||
]
|
||||
verifylist = [
|
||||
('networks', [self._network.name]),
|
||||
('network', [self._network.name]),
|
||||
]
|
||||
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
|
Loading…
Reference in New Issue
Block a user