Return complete response from flavors_client part-1
Currently compute flavors_client returns Response by removing
top key from Response.
For example-
return service_client.ResponseBody(resp, body['flavor'])
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 create/show/list flavor methods of compute flavors_client
to return complete Response body.
Implements: blueprint method-return-value-and-move-service-clients-to-lib
Change-Id: If9ef2db0c78ebfd668c262c2ea57e303c953b048
diff --git a/tempest/api/compute/admin/test_flavors.py b/tempest/api/compute/admin/test_flavors.py
index a3c25a2..42a2984 100644
--- a/tempest/api/compute/admin/test_flavors.py
+++ b/tempest/api/compute/admin/test_flavors.py
@@ -69,7 +69,7 @@
id=flavor_id,
ephemeral=self.ephemeral,
swap=self.swap,
- rxtx_factor=self.rxtx)
+ rxtx_factor=self.rxtx)['flavor']
self.addCleanup(self.flavor_clean_up, flavor['id'])
self.assertEqual(flavor['name'], flavor_name)
self.assertEqual(flavor['vcpus'], self.vcpus)
@@ -82,7 +82,7 @@
self.assertEqual(flavor['os-flavor-access:is_public'], True)
# Verify flavor is retrieved
- flavor = self.client.show_flavor(flavor['id'])
+ flavor = self.client.show_flavor(flavor['id'])['flavor']
self.assertEqual(flavor['name'], flavor_name)
return flavor['id']
@@ -121,11 +121,11 @@
id=new_flavor_id,
ephemeral=self.ephemeral,
swap=self.swap,
- rxtx_factor=self.rxtx)
+ rxtx_factor=self.rxtx)['flavor']
self.addCleanup(self.flavor_clean_up, flavor['id'])
flag = False
# Verify flavor is retrieved
- flavors = self.client.list_flavors(detail=True)
+ flavors = self.client.list_flavors(detail=True)['flavors']
for flavor in flavors:
if flavor['name'] == flavor_name:
flag = True
@@ -150,7 +150,7 @@
flavor = self.client.create_flavor(name=flavor_name,
ram=self.ram, vcpus=self.vcpus,
disk=self.disk,
- id=new_flavor_id)
+ id=new_flavor_id)['flavor']
self.addCleanup(self.flavor_clean_up, flavor['id'])
self.assertEqual(flavor['name'], flavor_name)
self.assertEqual(flavor['ram'], self.ram)
@@ -160,12 +160,12 @@
verify_flavor_response_extension(flavor)
# Verify flavor is retrieved
- flavor = self.client.show_flavor(new_flavor_id)
+ flavor = self.client.show_flavor(new_flavor_id)['flavor']
self.assertEqual(flavor['name'], flavor_name)
verify_flavor_response_extension(flavor)
# Check if flavor is present in list
- flavors = self.user_client.list_flavors(detail=True)
+ flavors = self.user_client.list_flavors(detail=True)['flavors']
for flavor in flavors:
if flavor['name'] == flavor_name:
verify_flavor_response_extension(flavor)
@@ -186,11 +186,11 @@
ram=self.ram, vcpus=self.vcpus,
disk=self.disk,
id=new_flavor_id,
- is_public="False")
+ is_public="False")['flavor']
self.addCleanup(self.flavor_clean_up, flavor['id'])
# Verify flavor is retrieved
flag = False
- flavors = self.client.list_flavors(detail=True)
+ flavors = self.client.list_flavors(detail=True)['flavors']
for flavor in flavors:
if flavor['name'] == flavor_name:
flag = True
@@ -198,7 +198,7 @@
# Verify flavor is not retrieved with other user
flag = False
- flavors = self.user_client.list_flavors(detail=True)
+ flavors = self.user_client.list_flavors(detail=True)['flavors']
for flavor in flavors:
if flavor['name'] == flavor_name:
flag = True
@@ -215,7 +215,7 @@
ram=self.ram, vcpus=self.vcpus,
disk=self.disk,
id=new_flavor_id,
- is_public="False")
+ is_public="False")['flavor']
self.addCleanup(self.flavor_clean_up, flavor['id'])
# Verify flavor is not used by other user
@@ -235,12 +235,12 @@
ram=self.ram, vcpus=self.vcpus,
disk=self.disk,
id=new_flavor_id,
- is_public="True")
+ is_public="True")['flavor']
self.addCleanup(self.flavor_clean_up, flavor['id'])
flag = False
self.new_client = self.flavors_client
# Verify flavor is retrieved with new user
- flavors = self.new_client.list_flavors(detail=True)
+ flavors = self.new_client.list_flavors(detail=True)['flavors']
for flavor in flavors:
if flavor['name'] == flavor_name:
flag = True
@@ -258,7 +258,7 @@
ram=self.ram, vcpus=self.vcpus,
disk=self.disk,
id=flavor_id_not_public,
- is_public="False")
+ is_public="False")['flavor']
self.addCleanup(self.flavor_clean_up, flavor['id'])
# Create a public flavor
@@ -266,7 +266,7 @@
ram=self.ram, vcpus=self.vcpus,
disk=self.disk,
id=flavor_id_public,
- is_public="True")
+ is_public="True")['flavor']
self.addCleanup(self.flavor_clean_up, flavor['id'])
def _flavor_lookup(flavors, flavor_name):
@@ -278,7 +278,8 @@
def _test_string_variations(variations, flavor_name):
for string in variations:
params = {'is_public': string}
- flavors = self.client.list_flavors(detail=True, **params)
+ flavors = (self.client.list_flavors(detail=True, **params)
+ ['flavors'])
flavor = _flavor_lookup(flavors, flavor_name)
self.assertIsNotNone(flavor)
@@ -297,7 +298,7 @@
flavor = self.client.create_flavor(name=flavor_name,
ram=ram, vcpus=self.vcpus,
disk=self.disk,
- id=new_flavor_id)
+ id=new_flavor_id)['flavor']
self.addCleanup(self.flavor_clean_up, flavor['id'])
self.assertEqual(flavor['name'], flavor_name)
self.assertEqual(flavor['vcpus'], self.vcpus)
diff --git a/tempest/api/compute/admin/test_flavors_access.py b/tempest/api/compute/admin/test_flavors_access.py
index ccfe20b..b60272f 100644
--- a/tempest/api/compute/admin/test_flavors_access.py
+++ b/tempest/api/compute/admin/test_flavors_access.py
@@ -60,7 +60,7 @@
ram=self.ram, vcpus=self.vcpus,
disk=self.disk,
id=new_flavor_id,
- is_public='False')
+ is_public='False')['flavor']
self.addCleanup(self.client.delete_flavor, new_flavor['id'])
flavor_access = self.client.list_flavor_access(new_flavor_id)
self.assertEqual(len(flavor_access), 0, str(flavor_access))
@@ -74,7 +74,7 @@
ram=self.ram, vcpus=self.vcpus,
disk=self.disk,
id=new_flavor_id,
- is_public='False')
+ is_public='False')['flavor']
self.addCleanup(self.client.delete_flavor, new_flavor['id'])
# Add flavor access to a tenant.
resp_body = {
@@ -86,7 +86,7 @@
self.assertIn(resp_body, add_body)
# The flavor is present in list.
- flavors = self.flavors_client.list_flavors(detail=True)
+ flavors = self.flavors_client.list_flavors(detail=True)['flavors']
self.assertIn(new_flavor['id'], map(lambda x: x['id'], flavors))
# Remove flavor access from a tenant.
@@ -95,5 +95,5 @@
self.assertNotIn(resp_body, remove_body)
# The flavor is not present in list.
- flavors = self.flavors_client.list_flavors(detail=True)
+ flavors = self.flavors_client.list_flavors(detail=True)['flavors']
self.assertNotIn(new_flavor['id'], map(lambda x: x['id'], flavors))
diff --git a/tempest/api/compute/admin/test_flavors_access_negative.py b/tempest/api/compute/admin/test_flavors_access_negative.py
index 03898c2..89ae1b5 100644
--- a/tempest/api/compute/admin/test_flavors_access_negative.py
+++ b/tempest/api/compute/admin/test_flavors_access_negative.py
@@ -61,7 +61,7 @@
ram=self.ram, vcpus=self.vcpus,
disk=self.disk,
id=new_flavor_id,
- is_public='True')
+ is_public='True')['flavor']
self.addCleanup(self.client.delete_flavor, new_flavor['id'])
self.assertRaises(lib_exc.NotFound,
self.client.list_flavor_access,
@@ -77,7 +77,7 @@
ram=self.ram, vcpus=self.vcpus,
disk=self.disk,
id=new_flavor_id,
- is_public='False')
+ is_public='False')['flavor']
self.addCleanup(self.client.delete_flavor, new_flavor['id'])
self.assertRaises(lib_exc.Forbidden,
self.flavors_client.add_flavor_access,
@@ -94,7 +94,7 @@
ram=self.ram, vcpus=self.vcpus,
disk=self.disk,
id=new_flavor_id,
- is_public='False')
+ is_public='False')['flavor']
self.addCleanup(self.client.delete_flavor, new_flavor['id'])
# Add flavor access to a tenant.
self.client.add_flavor_access(new_flavor['id'], self.tenant_id)
@@ -115,7 +115,7 @@
ram=self.ram, vcpus=self.vcpus,
disk=self.disk,
id=new_flavor_id,
- is_public='False')
+ is_public='False')['flavor']
self.addCleanup(self.client.delete_flavor, new_flavor['id'])
# Add flavor access to a tenant.
@@ -140,7 +140,7 @@
ram=self.ram, vcpus=self.vcpus,
disk=self.disk,
id=new_flavor_id,
- is_public='False')
+ is_public='False')['flavor']
self.addCleanup(self.client.delete_flavor, new_flavor['id'])
# An exception should be raised when flavor access is not found
diff --git a/tempest/api/compute/admin/test_flavors_extra_specs.py b/tempest/api/compute/admin/test_flavors_extra_specs.py
index 6039cb2..2cdaa62 100644
--- a/tempest/api/compute/admin/test_flavors_extra_specs.py
+++ b/tempest/api/compute/admin/test_flavors_extra_specs.py
@@ -55,7 +55,8 @@
disk=disk,
id=cls.new_flavor_id,
ephemeral=ephemeral,
- swap=swap, rxtx_factor=rxtx)
+ swap=swap,
+ rxtx_factor=rxtx)['flavor']
@classmethod
def resource_cleanup(cls):
diff --git a/tempest/api/compute/admin/test_flavors_extra_specs_negative.py b/tempest/api/compute/admin/test_flavors_extra_specs_negative.py
index f1e11f4..20fada8 100644
--- a/tempest/api/compute/admin/test_flavors_extra_specs_negative.py
+++ b/tempest/api/compute/admin/test_flavors_extra_specs_negative.py
@@ -58,7 +58,8 @@
disk=disk,
id=cls.new_flavor_id,
ephemeral=ephemeral,
- swap=swap, rxtx_factor=rxtx)
+ swap=swap,
+ rxtx_factor=rxtx)['flavor']
@classmethod
def resource_cleanup(cls):
diff --git a/tempest/api/compute/admin/test_servers_negative.py b/tempest/api/compute/admin/test_servers_negative.py
index 0241e70..7dc631c 100644
--- a/tempest/api/compute/admin/test_servers_negative.py
+++ b/tempest/api/compute/admin/test_servers_negative.py
@@ -75,7 +75,8 @@
disk = 10
flavor_ref = self.flavors_client.create_flavor(name=flavor_name,
ram=ram, vcpus=vcpus,
- disk=disk, id=flavor_id)
+ disk=disk,
+ id=flavor_id)['flavor']
self.addCleanup(self.flavors_client.delete_flavor, flavor_id)
self.assertRaises((lib_exc.Forbidden, lib_exc.OverLimit),
self.client.resize,
@@ -97,7 +98,8 @@
disk = 10
flavor_ref = self.flavors_client.create_flavor(name=flavor_name,
ram=ram, vcpus=vcpus,
- disk=disk, id=flavor_id)
+ disk=disk,
+ id=flavor_id)['flavor']
self.addCleanup(self.flavors_client.delete_flavor, flavor_id)
self.assertRaises((lib_exc.Forbidden, lib_exc.OverLimit),
self.client.resize,
diff --git a/tempest/api/compute/flavors/test_flavors.py b/tempest/api/compute/flavors/test_flavors.py
index 728fefb..e114c80 100644
--- a/tempest/api/compute/flavors/test_flavors.py
+++ b/tempest/api/compute/flavors/test_flavors.py
@@ -32,8 +32,8 @@
@test.idempotent_id('e36c0eaa-dff5-4082-ad1f-3f9a80aa3f59')
def test_list_flavors(self):
# List of all flavors should contain the expected flavor
- flavors = self.client.list_flavors()
- flavor = self.client.show_flavor(self.flavor_ref)
+ flavors = self.client.list_flavors()['flavors']
+ flavor = self.client.show_flavor(self.flavor_ref)['flavor']
flavor_min_detail = {'id': flavor['id'], 'links': flavor['links'],
'name': flavor['name']}
self.assertIn(flavor_min_detail, flavors)
@@ -41,89 +41,89 @@
@test.idempotent_id('6e85fde4-b3cd-4137-ab72-ed5f418e8c24')
def test_list_flavors_with_detail(self):
# Detailed list of all flavors should contain the expected flavor
- flavors = self.client.list_flavors(detail=True)
- flavor = self.client.show_flavor(self.flavor_ref)
+ flavors = self.client.list_flavors(detail=True)['flavors']
+ flavor = self.client.show_flavor(self.flavor_ref)['flavor']
self.assertIn(flavor, flavors)
@test.attr(type='smoke')
@test.idempotent_id('1f12046b-753d-40d2-abb6-d8eb8b30cb2f')
def test_get_flavor(self):
# The expected flavor details should be returned
- flavor = self.client.show_flavor(self.flavor_ref)
+ flavor = self.client.show_flavor(self.flavor_ref)['flavor']
self.assertEqual(self.flavor_ref, flavor['id'])
@test.idempotent_id('8d7691b3-6ed4-411a-abc9-2839a765adab')
def test_list_flavors_limit_results(self):
# Only the expected number of flavors should be returned
params = {'limit': 1}
- flavors = self.client.list_flavors(**params)
+ flavors = self.client.list_flavors(**params)['flavors']
self.assertEqual(1, len(flavors))
@test.idempotent_id('b26f6327-2886-467a-82be-cef7a27709cb')
def test_list_flavors_detailed_limit_results(self):
# Only the expected number of flavors (detailed) should be returned
params = {'limit': 1}
- flavors = self.client.list_flavors(detail=True, **params)
+ flavors = self.client.list_flavors(detail=True, **params)['flavors']
self.assertEqual(1, len(flavors))
@test.idempotent_id('e800f879-9828-4bd0-8eae-4f17189951fb')
def test_list_flavors_using_marker(self):
# The list of flavors should start from the provided marker
- flavor = self.client.show_flavor(self.flavor_ref)
+ flavor = self.client.show_flavor(self.flavor_ref)['flavor']
flavor_id = flavor['id']
params = {'marker': flavor_id}
- flavors = self.client.list_flavors(**params)
+ flavors = self.client.list_flavors(**params)['flavors']
self.assertFalse(any([i for i in flavors if i['id'] == flavor_id]),
'The list of flavors did not start after the marker.')
@test.idempotent_id('6db2f0c0-ddee-4162-9c84-0703d3dd1107')
def test_list_flavors_detailed_using_marker(self):
# The list of flavors should start from the provided marker
- flavor = self.client.show_flavor(self.flavor_ref)
+ flavor = self.client.show_flavor(self.flavor_ref)['flavor']
flavor_id = flavor['id']
params = {'marker': flavor_id}
- flavors = self.client.list_flavors(detail=True, **params)
+ flavors = self.client.list_flavors(detail=True, **params)['flavors']
self.assertFalse(any([i for i in flavors if i['id'] == flavor_id]),
'The list of flavors did not start after the marker.')
@test.idempotent_id('3df2743e-3034-4e57-a4cb-b6527f6eac79')
def test_list_flavors_detailed_filter_by_min_disk(self):
# The detailed list of flavors should be filtered by disk space
- flavor = self.client.show_flavor(self.flavor_ref)
+ flavor = self.client.show_flavor(self.flavor_ref)['flavor']
flavor_id = flavor['id']
params = {self._min_disk: flavor['disk'] + 1}
- flavors = self.client.list_flavors(detail=True, **params)
+ flavors = self.client.list_flavors(detail=True, **params)['flavors']
self.assertFalse(any([i for i in flavors if i['id'] == flavor_id]))
@test.idempotent_id('09fe7509-b4ee-4b34-bf8b-39532dc47292')
def test_list_flavors_detailed_filter_by_min_ram(self):
# The detailed list of flavors should be filtered by RAM
- flavor = self.client.show_flavor(self.flavor_ref)
+ flavor = self.client.show_flavor(self.flavor_ref)['flavor']
flavor_id = flavor['id']
params = {self._min_ram: flavor['ram'] + 1}
- flavors = self.client.list_flavors(detail=True, **params)
+ flavors = self.client.list_flavors(detail=True, **params)['flavors']
self.assertFalse(any([i for i in flavors if i['id'] == flavor_id]))
@test.idempotent_id('10645a4d-96f5-443f-831b-730711e11dd4')
def test_list_flavors_filter_by_min_disk(self):
# The list of flavors should be filtered by disk space
- flavor = self.client.show_flavor(self.flavor_ref)
+ flavor = self.client.show_flavor(self.flavor_ref)['flavor']
flavor_id = flavor['id']
params = {self._min_disk: flavor['disk'] + 1}
- flavors = self.client.list_flavors(**params)
+ flavors = self.client.list_flavors(**params)['flavors']
self.assertFalse(any([i for i in flavors if i['id'] == flavor_id]))
@test.idempotent_id('935cf550-e7c8-4da6-8002-00f92d5edfaa')
def test_list_flavors_filter_by_min_ram(self):
# The list of flavors should be filtered by RAM
- flavor = self.client.show_flavor(self.flavor_ref)
+ flavor = self.client.show_flavor(self.flavor_ref)['flavor']
flavor_id = flavor['id']
params = {self._min_ram: flavor['ram'] + 1}
- flavors = self.client.list_flavors(**params)
+ flavors = self.client.list_flavors(**params)['flavors']
self.assertFalse(any([i for i in flavors if i['id'] == flavor_id]))
diff --git a/tempest/api/compute/images/test_images_oneserver.py b/tempest/api/compute/images/test_images_oneserver.py
index 06b7cac..4f15ce1 100644
--- a/tempest/api/compute/images/test_images_oneserver.py
+++ b/tempest/api/compute/images/test_images_oneserver.py
@@ -71,7 +71,7 @@
cls.server_id = server['id']
def _get_default_flavor_disk_size(self, flavor_id):
- flavor = self.flavors_client.show_flavor(flavor_id)
+ flavor = self.flavors_client.show_flavor(flavor_id)['flavor']
return flavor['disk']
@test.idempotent_id('3731d080-d4c5-4872-b41a-64d0d0021314')
diff --git a/tempest/api/compute/servers/test_create_server.py b/tempest/api/compute/servers/test_create_server.py
index c6fb2fb..f56c1de 100644
--- a/tempest/api/compute/servers/test_create_server.py
+++ b/tempest/api/compute/servers/test_create_server.py
@@ -117,7 +117,7 @@
def test_verify_created_server_vcpus(self):
# Verify that the number of vcpus reported by the instance matches
# the amount stated by the flavor
- flavor = self.flavors_client.show_flavor(self.flavor_ref)
+ flavor = self.flavors_client.show_flavor(self.flavor_ref)['flavor']
linux_client = remote_client.RemoteClient(
self.get_server_ip(self.server),
self.ssh_user,
@@ -275,7 +275,7 @@
create_flavor(name=flavor_with_eph_disk_name,
ram=ram, vcpus=vcpus, disk=disk,
id=flavor_with_eph_disk_id,
- ephemeral=1))
+ ephemeral=1))['flavor']
self.addCleanup(flavor_clean_up, flavor['id'])
return flavor['id']
@@ -292,7 +292,7 @@
flavor = (self.flavor_client.
create_flavor(name=flavor_no_eph_disk_name,
ram=ram, vcpus=vcpus, disk=disk,
- id=flavor_no_eph_disk_id))
+ id=flavor_no_eph_disk_id))['flavor']
self.addCleanup(flavor_clean_up, flavor['id'])
return flavor['id']
diff --git a/tempest/api/database/flavors/test_flavors.py b/tempest/api/database/flavors/test_flavors.py
index e698baa..c97ddd7 100644
--- a/tempest/api/database/flavors/test_flavors.py
+++ b/tempest/api/database/flavors/test_flavors.py
@@ -58,7 +58,8 @@
@test.services('compute')
def test_compare_db_flavors_with_os(self):
db_flavors = self.client.list_db_flavors()
- os_flavors = self.os_flavors_client.list_flavors(detail=True)
+ os_flavors = (self.os_flavors_client.list_flavors(detail=True)
+ ['flavors'])
self.assertEqual(len(os_flavors), len(db_flavors),
"OS flavors %s do not match DB flavors %s" %
(os_flavors, db_flavors))
diff --git a/tempest/cmd/cleanup_service.py b/tempest/cmd/cleanup_service.py
index 3550842..863717a 100644
--- a/tempest/cmd/cleanup_service.py
+++ b/tempest/cmd/cleanup_service.py
@@ -731,7 +731,7 @@
def list(self):
client = self.client
- flavors = client.list_flavors({"is_public": None})
+ flavors = client.list_flavors({"is_public": None})['flavors']
if not self.is_save_state:
# recreate list removing saved flavors
flavors = [flavor for flavor in flavors if flavor['id']
diff --git a/tempest/cmd/javelin.py b/tempest/cmd/javelin.py
index 71aacbd..32c6af1 100755
--- a/tempest/cmd/javelin.py
+++ b/tempest/cmd/javelin.py
@@ -840,7 +840,7 @@
def _get_flavor_by_name(client, name):
- body = client.flavors.list_flavors()
+ body = client.flavors.list_flavors()['flavors']
for flavor in body:
if name == flavor['name']:
return flavor
diff --git a/tempest/scenario/test_baremetal_basic_ops.py b/tempest/scenario/test_baremetal_basic_ops.py
index 346f56b..e93fca7 100644
--- a/tempest/scenario/test_baremetal_basic_ops.py
+++ b/tempest/scenario/test_baremetal_basic_ops.py
@@ -101,7 +101,7 @@
def get_flavor_ephemeral_size(self):
"""Returns size of the ephemeral partition in GiB."""
f_id = self.instance['flavor']['id']
- flavor = self.flavors_client.show_flavor(f_id)
+ flavor = self.flavors_client.show_flavor(f_id)['flavor']
ephemeral = flavor.get('OS-FLV-EXT-DATA:ephemeral')
if not ephemeral or ephemeral == 'N/A':
return None
diff --git a/tempest/scenario/utils.py b/tempest/scenario/utils.py
index b1246d2..41b3470 100644
--- a/tempest/scenario/utils.py
+++ b/tempest/scenario/utils.py
@@ -65,7 +65,7 @@
def is_flavor_enough(self, flavor_id, image_id):
_image = self.images_client.show_image(image_id)
- _flavor = self.flavors_client.show_flavor(flavor_id)
+ _flavor = self.flavors_client.show_flavor(flavor_id)['flavor']
return self._is_flavor_enough(_flavor, _image)
@@ -148,7 +148,7 @@
"""
if not hasattr(self, '_scenario_flavors'):
try:
- flavors = self.flavors_client.list_flavors()
+ flavors = self.flavors_client.list_flavors()['flavors']
self._scenario_flavors = [
(self._normalize_name(f['name']), dict(flavor_ref=f['id']))
for f in flavors if re.search(self.flavor_pattern,
diff --git a/tempest/services/compute/json/flavors_client.py b/tempest/services/compute/json/flavors_client.py
index 1422944..de3fd75 100644
--- a/tempest/services/compute/json/flavors_client.py
+++ b/tempest/services/compute/json/flavors_client.py
@@ -39,13 +39,13 @@
resp, body = self.get(url)
body = json.loads(body)
self.validate_response(_schema, resp, body)
- return service_client.ResponseBodyList(resp, body['flavors'])
+ return service_client.ResponseBody(resp, body)
def show_flavor(self, flavor_id):
resp, body = self.get("flavors/%s" % flavor_id)
body = json.loads(body)
self.validate_response(schema.create_get_flavor_details, resp, body)
- return service_client.ResponseBody(resp, body['flavor'])
+ return service_client.ResponseBody(resp, body)
def create_flavor(self, **kwargs):
"""Creates a new flavor or instance type.
@@ -64,7 +64,7 @@
body = json.loads(body)
self.validate_response(schema.create_get_flavor_details, resp, body)
- return service_client.ResponseBody(resp, body['flavor'])
+ return service_client.ResponseBody(resp, body)
def delete_flavor(self, flavor_id):
"""Deletes the given flavor."""
@@ -76,7 +76,7 @@
# Did not use show_flavor(id) for verification as it gives
# 200 ok even for deleted id. LP #981263
# we can remove the loop here and use get by ID when bug gets sortedout
- flavors = self.list_flavors(detail=True)
+ flavors = self.list_flavors(detail=True)['flavors']
for flavor in flavors:
if flavor['id'] == id:
return False