Merge "Fix missing volume name on launch instance modal"

This commit is contained in:
Jenkins 2017-08-02 21:06:16 +00:00 committed by Gerrit Code Review
commit adb2583e90
2 changed files with 6 additions and 4 deletions

View File

@ -68,7 +68,7 @@ class Volumes(generic.View):
search_opts=search_opts, **kwargs search_opts=search_opts, **kwargs
) )
return { return {
'items': [u.to_dict() for u in result], 'items': [api.cinder.Volume(u).to_dict() for u in result],
'has_more_data': has_more, 'has_more_data': has_more,
'has_prev_data': has_prev 'has_prev_data': has_prev
} }

View File

@ -44,14 +44,16 @@ class CinderRestTestCase(test.TestCase):
request = self.mock_rest_request(GET={'all_projects': 'true'}) request = self.mock_rest_request(GET={'all_projects': 'true'})
else: else:
request = self.mock_rest_request(**{'GET': filters}) request = self.mock_rest_request(**{'GET': filters})
cc.volume_list_paged.return_value = [ cc.volume_list_paged.return_value = [
mock.Mock(**{'to_dict.return_value': {'id': 'one'}}), mock.Mock(**{'to_dict.return_value': {'id': 'test123'}}),
mock.Mock(**{'to_dict.return_value': {'id': 'two'}}),
], False, False ], False, False
cc.Volume.return_value = mock.Mock(
**{'to_dict.return_value': {"id": "test123"}})
response = cinder.Volumes().get(request) response = cinder.Volumes().get(request)
self.assertStatusCode(response, 200) self.assertStatusCode(response, 200)
self.assertEqual(response.json, self.assertEqual(response.json,
{"items": [{"id": "one"}, {"id": "two"}], {"items": [{"id": "test123"}],
"has_more_data": False, "has_more_data": False,
"has_prev_data": False}) "has_prev_data": False})
if all: if all: