Rename parameter "identifier" to "network" in network commands

In other commands, the name or ID of an object is just the name
of the object. For example, name or ID of a server is "server",
router is "router". So, do not use "identifier" in network commands.

Also, the parameter in doc file network.rst is not "identifier",
but "network".

Change-Id: I1ec3beefbb878a207bca280b994ca176ef04ee2d
This commit is contained in:
Tang Chen 2016-02-14 18:57:34 +08:00
parent d8abec33ad
commit 324e026f57
2 changed files with 8 additions and 8 deletions
openstackclient
network/v2
tests/network/v2

@ -238,7 +238,7 @@ class SetNetwork(command.Command):
def get_parser(self, prog_name):
parser = super(SetNetwork, self).get_parser(prog_name)
parser.add_argument(
'identifier',
'network',
metavar="<network>",
help=("Network to modify (name or ID)")
)
@ -279,7 +279,7 @@ class SetNetwork(command.Command):
def take_action(self, parsed_args):
client = self.app.client_manager.network
obj = client.find_network(parsed_args.identifier, ignore_missing=False)
obj = client.find_network(parsed_args.network, ignore_missing=False)
attrs = _get_attrs(self.app.client_manager, parsed_args)
if attrs == {}:
@ -296,7 +296,7 @@ class ShowNetwork(command.ShowOne):
def get_parser(self, prog_name):
parser = super(ShowNetwork, self).get_parser(prog_name)
parser.add_argument(
'identifier',
'network',
metavar="<network>",
help=("Network to display (name or ID)")
)
@ -304,7 +304,7 @@ class ShowNetwork(command.ShowOne):
def take_action(self, parsed_args):
client = self.app.client_manager.network
obj = client.find_network(parsed_args.identifier, ignore_missing=False)
obj = client.find_network(parsed_args.network, ignore_missing=False)
columns = _get_columns(obj)
data = utils.get_item_properties(obj, columns, formatters=_formatters)
return (columns, data)

@ -453,7 +453,7 @@ class TestSetNetwork(TestNetwork):
'--share',
]
verifylist = [
('identifier', self._network.name),
('network', self._network.name),
('admin_state', True),
('name', 'noob'),
('shared', True),
@ -477,7 +477,7 @@ class TestSetNetwork(TestNetwork):
'--no-share',
]
verifylist = [
('identifier', self._network.name),
('network', self._network.name),
('admin_state', False),
('shared', False),
]
@ -494,7 +494,7 @@ class TestSetNetwork(TestNetwork):
def test_set_nothing(self):
arglist = [self._network.name, ]
verifylist = [('identifier', self._network.name), ]
verifylist = [('network', self._network.name), ]
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
self.assertRaises(exceptions.CommandError, self.cmd.take_action,
@ -553,7 +553,7 @@ class TestShowNetwork(TestNetwork):
self._network.name,
]
verifylist = [
('identifier', self._network.name),
('network', self._network.name),
]
parsed_args = self.check_parser(self.cmd, arglist, verifylist)