Return complete response from compute extensions_client

Currently compute extensions_client returns Response by removing
top key from Response.
For example-
return service_client.ResponseBody(resp, body['extension'])

As service clients are in direction to move to Tempest-lib, all
service clients should return Response without any truncation.
One good example is Resource pagination links which are lost with current
way of return value. Resource pagination links are present in parallel
(not inside) to top key of Response.

This patch makes compute extensions_client to return complete
Response body.

Change-Id: I8dcb70ce6ba2af59c7636c5f83157dd058fb1df3
Implements: blueprint method-return-value-and-move-service-clients-to-lib
diff --git a/tempest/api/compute/test_extensions.py b/tempest/api/compute/test_extensions.py
index 4cc4328..6e57aff 100644
--- a/tempest/api/compute/test_extensions.py
+++ b/tempest/api/compute/test_extensions.py
@@ -32,7 +32,7 @@
         # List of all extensions
         if len(CONF.compute_feature_enabled.api_extensions) == 0:
             raise self.skipException('There are not any extensions configured')
-        extensions = self.extensions_client.list_extensions()
+        extensions = self.extensions_client.list_extensions()['extensions']
         ext = CONF.compute_feature_enabled.api_extensions[0]
         if ext == 'all':
             self.assertIn('Hosts', map(lambda x: x['name'], extensions))
@@ -49,4 +49,4 @@
     def test_get_extension(self):
         # get the specified extensions
         extension = self.extensions_client.show_extension('os-consoles')
-        self.assertEqual('os-consoles', extension['alias'])
+        self.assertEqual('os-consoles', extension['extension']['alias'])
diff --git a/tempest/services/compute/json/extensions_client.py b/tempest/services/compute/json/extensions_client.py
index da342a8..4741812 100644
--- a/tempest/services/compute/json/extensions_client.py
+++ b/tempest/services/compute/json/extensions_client.py
@@ -26,9 +26,9 @@
         resp, body = self.get(url)
         body = json.loads(body)
         self.validate_response(schema.list_extensions, resp, body)
-        return service_client.ResponseBodyList(resp, body['extensions'])
+        return service_client.ResponseBody(resp, body)
 
     def show_extension(self, extension_alias):
         resp, body = self.get('extensions/%s' % extension_alias)
         body = json.loads(body)
-        return service_client.ResponseBody(resp, body['extension'])
+        return service_client.ResponseBody(resp, body)
diff --git a/tempest/tests/services/compute/test_extensions_client.py b/tempest/tests/services/compute/test_extensions_client.py
index aa46efa..20a5b7b 100644
--- a/tempest/tests/services/compute/test_extensions_client.py
+++ b/tempest/tests/services/compute/test_extensions_client.py
@@ -34,7 +34,7 @@
         body = '{"extensions": []}'
         if bytes_body:
             body = body.encode('utf-8')
-        expected = []
+        expected = {"extensions": []}
         response = (httplib2.Response({'status': 200}), body)
         self.useFixture(mockpatch.Patch(
             'tempest.common.service_client.ServiceClient.get',
@@ -48,7 +48,7 @@
         self._test_list_extensions(bytes_body=True)
 
     def _test_show_extension(self, bytes_body=False):
-        expected = {
+        expected = {"extension": {
             "updated": "2011-06-09T00:00:00Z",
             "name": "Multinic",
             "links": [],
@@ -56,8 +56,8 @@
             "http://docs.openstack.org/compute/ext/multinic/api/v1.1",
             "alias": "NMN",
             "description": u'\u2740(*\xb4\u25e1`*)\u2740'
-        }
-        serialized_body = json.dumps({"extension": expected})
+        }}
+        serialized_body = json.dumps(expected)
         if bytes_body:
             serialized_body = serialized_body.encode('utf-8')