diff options
| author | Tang Chen <chen.tang@easystack.cn> | 2016-03-06 09:01:42 +0800 |
|---|---|---|
| committer | Tang Chen <chen.tang@easystack.cn> | 2016-03-06 09:01:42 +0800 |
| commit | 7ba73845c11b216bf3c634049380784ce767a2a4 (patch) | |
| tree | 41c6fa3f0b7bc9d365d8e6d49be75f84b9b20701 /openstackclient | |
| parent | 0b2c4b1f327dddce0306637e7128bad6eb43fc54 (diff) | |
| download | python-openstackclient-7ba73845c11b216bf3c634049380784ce767a2a4.tar.gz | |
Use _get_columns() to obtain columns in network.py
Objects returned by Network v2 and Compute v2 are different.
When getting columns to display, Network v2 uses obj.keys(),
while Compute v2 uses obj._info.keys(). But both of them could
obtain the keys of the object by _get_columns().
Change-Id: I347815f2d28822a95bd6f57d429b84b7ca96e0ee
Diffstat (limited to 'openstackclient')
| -rw-r--r-- | openstackclient/network/v2/network.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/openstackclient/network/v2/network.py b/openstackclient/network/v2/network.py index 308e0e52..f9b19606 100644 --- a/openstackclient/network/v2/network.py +++ b/openstackclient/network/v2/network.py @@ -162,7 +162,7 @@ class CreateNetwork(common.NetworkAndComputeShowOne): def take_action_compute(self, client, parsed_args): attrs = _get_attrs_compute(self.app.client_manager, parsed_args) obj = client.networks.create(**attrs) - columns = tuple(sorted(obj._info.keys())) + columns = _get_columns(obj._info) data = utils.get_dict_properties(obj._info, columns) return (columns, data) @@ -359,10 +359,10 @@ class ShowNetwork(common.NetworkAndComputeShowOne): return (columns, data) def take_action_compute(self, client, parsed_args): - network = utils.find_resource( + obj = utils.find_resource( client.networks, parsed_args.network, ) - columns = sorted(network._info.keys()) - data = utils.get_dict_properties(network._info, columns) + columns = _get_columns(obj._info) + data = utils.get_dict_properties(obj._info, columns) return (columns, data) |
