diff options
| author | jiahui.qiang <jiahui.qiang@easystack.cn> | 2017-01-17 17:42:15 +0800 |
|---|---|---|
| committer | jiahui.qiang <jiahui.qiang@easystack.cn> | 2017-01-17 17:49:16 +0800 |
| commit | 89d9449dcfd4679e8d786c73df4be67af8e3b04a (patch) | |
| tree | 94c94da048753624b5837cbc369fbfaf0804c037 /openstackclient/compute/v2 | |
| parent | 64c509cf76fd9529c93a7b37e16630f84aa6d0ed (diff) | |
| download | python-openstackclient-89d9449dcfd4679e8d786c73df4be67af8e3b04a.tar.gz | |
Error in the return of command server show, create
The raw output in the command 'openstack server create'(also in show) is
used in display table directily. the item like
os-extended-volumes:volumes_attached and security_groups needs to convert.
the worry output:
os-extended-volumes:volumes_attached | [{u'id': u'c3525de9-1cbf-4ac8-8b7a-ca295c46633b'}]
security_groups | [{u'name': u'default'}]
Change-Id: Id9db251c315f989e1dc5b1b6231ab328014213e3
Diffstat (limited to 'openstackclient/compute/v2')
| -rw-r--r-- | openstackclient/compute/v2/server.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/openstackclient/compute/v2/server.py b/openstackclient/compute/v2/server.py index d9221873..798d3d3f 100644 --- a/openstackclient/compute/v2/server.py +++ b/openstackclient/compute/v2/server.py @@ -144,6 +144,20 @@ def _prep_server_detail(compute_client, server): except Exception: info['flavor'] = flavor_id + if 'os-extended-volumes:volumes_attached' in info: + info.update( + { + 'volumes_attached': utils.format_list_of_dicts( + info.pop('os-extended-volumes:volumes_attached')) + } + ) + if 'security_groups' in info: + info.update( + { + 'security_groups': utils.format_list_of_dicts( + info.pop('security_groups')) + } + ) # NOTE(dtroyer): novaclient splits these into separate entries... # Format addresses in a useful way info['addresses'] = _format_servers_list_networks(server.networks) |
