Full response for VolumeServicesClient methods
Provide the entire response object for all methods of the
VolumeServicesClient
partially implements: blueprint method-return-value-and-move-service-clients-to-lib
Change-Id: I0c6e43352bea25029dd2e46d45907b93bae8d28e
diff --git a/tempest/api/volume/admin/test_volume_services.py b/tempest/api/volume/admin/test_volume_services.py
index 4f80a31..74fffb9 100644
--- a/tempest/api/volume/admin/test_volume_services.py
+++ b/tempest/api/volume/admin/test_volume_services.py
@@ -26,19 +26,22 @@
@classmethod
def resource_setup(cls):
super(VolumesServicesV2TestJSON, cls).resource_setup()
- cls.services = cls.admin_volume_services_client.list_services()
+ cls.services = (cls.admin_volume_services_client.list_services()
+ ['services'])
cls.host_name = cls.services[0]['host']
cls.binary_name = cls.services[0]['binary']
@test.idempotent_id('e0218299-0a59-4f43-8b2b-f1c035b3d26d')
def test_list_services(self):
- services = self.admin_volume_services_client.list_services()
+ services = (self.admin_volume_services_client.list_services()
+ ['services'])
self.assertNotEqual(0, len(services))
@test.idempotent_id('63a3e1ca-37ee-4983-826d-83276a370d25')
def test_get_service_by_service_binary_name(self):
params = {'binary': self.binary_name}
- services = self.admin_volume_services_client.list_services(params)
+ services = (self.admin_volume_services_client.list_services(params)
+ ['services'])
self.assertNotEqual(0, len(services))
for service in services:
self.assertEqual(self.binary_name, service['binary'])
@@ -49,7 +52,8 @@
service['host'] == self.host_name]
params = {'host': self.host_name}
- services = self.admin_volume_services_client.list_services(params)
+ services = (self.admin_volume_services_client.list_services(params)
+ ['services'])
# we could have a periodic job checkin between the 2 service
# lookups, so only compare binary lists.
@@ -63,7 +67,8 @@
def test_get_service_by_service_and_host_name(self):
params = {'host': self.host_name, 'binary': self.binary_name}
- services = self.admin_volume_services_client.list_services(params)
+ services = (self.admin_volume_services_client.list_services(params)
+ ['services'])
self.assertEqual(1, len(services))
self.assertEqual(self.host_name, services[0]['host'])
self.assertEqual(self.binary_name, services[0]['binary'])
diff --git a/tempest/services/volume/json/admin/volume_services_client.py b/tempest/services/volume/json/admin/volume_services_client.py
index c8607c1..798a642 100644
--- a/tempest/services/volume/json/admin/volume_services_client.py
+++ b/tempest/services/volume/json/admin/volume_services_client.py
@@ -29,7 +29,7 @@
resp, body = self.get(url)
body = json.loads(body)
self.expected_success(200, resp.status)
- return service_client.ResponseBodyList(resp, body['services'])
+ return service_client.ResponseBody(resp, body)
class VolumesServicesClient(BaseVolumesServicesClient):