Skip to content

Commit 89d9449

Browse files
author
jiahui.qiang
committed
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
1 parent 64c509c commit 89d9449

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

openstackclient/compute/v2/server.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,20 @@ def _prep_server_detail(compute_client, server):
144144
except Exception:
145145
info['flavor'] = flavor_id
146146

147+
if 'os-extended-volumes:volumes_attached' in info:
148+
info.update(
149+
{
150+
'volumes_attached': utils.format_list_of_dicts(
151+
info.pop('os-extended-volumes:volumes_attached'))
152+
}
153+
)
154+
if 'security_groups' in info:
155+
info.update(
156+
{
157+
'security_groups': utils.format_list_of_dicts(
158+
info.pop('security_groups'))
159+
}
160+
)
147161
# NOTE(dtroyer): novaclient splits these into separate entries...
148162
# Format addresses in a useful way
149163
info['addresses'] = _format_servers_list_networks(server.networks)

0 commit comments

Comments
 (0)