summaryrefslogtreecommitdiff
path: root/openstackclient/tests/unit
diff options
context:
space:
mode:
authorjay <jayadityagupta11@gmail.com>2020-06-04 14:09:03 +0200
committerjgupta <jayadityagupta11@gmail.com>2020-09-14 15:22:27 +0200
commitbae89b30144fdf40d0fea31e1a595b507e32c4f3 (patch)
treeef1d3ecf7453e3b98aefc90a426ef6b8d83e9397 /openstackclient/tests/unit
parent533af9f1b2de40d98f69e83cdf89ecf254cf3879 (diff)
downloadpython-openstackclient-bae89b30144fdf40d0fea31e1a595b507e32c4f3.tar.gz
Output correct json for security groups in 'openstack server show'
Fixes incorrect json output for 'openstack server show -f json'. The security group json output groups all the json as one for e.g. "security_groups": "name='group1'\nname='group2'" The correct output should be "security_groups" : [{"name" : "group1"}, {"name" : "group2"}] properties and volumes_attached fields also has similar issue. Story: 2007755 Change-Id: I1b1cac716329e0530400aff782c08000b21d8e1d
Diffstat (limited to 'openstackclient/tests/unit')
-rw-r--r--openstackclient/tests/unit/compute/v2/test_server.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/openstackclient/tests/unit/compute/v2/test_server.py b/openstackclient/tests/unit/compute/v2/test_server.py
index 7e4c71c5..933c4e7d 100644
--- a/openstackclient/tests/unit/compute/v2/test_server.py
+++ b/openstackclient/tests/unit/compute/v2/test_server.py
@@ -5166,6 +5166,8 @@ class TestServerGeneral(TestServer):
'tenant_id': u'tenant-id-xxx',
'networks': {u'public': [u'10.20.30.40', u'2001:db8::f']},
'links': u'http://xxx.yyy.com',
+ 'properties': '',
+ 'volumes_attached': [{"id": "6344fe9d-ef20-45b2-91a6"}],
}
_server = compute_fakes.FakeServer.create_one_server(attrs=server_info)
find_resource.side_effect = [_server, _flavor]
@@ -5182,6 +5184,7 @@ class TestServerGeneral(TestServer):
'properties': '',
'OS-EXT-STS:power_state': server._format_servers_list_power_state(
getattr(_server, 'OS-EXT-STS:power_state')),
+ 'volumes_attached': [{"id": "6344fe9d-ef20-45b2-91a6"}],
}
# Call _prep_server_detail().