From 83f105056ceb1b57753312949017a916d0111cb0 Mon Sep 17 00:00:00 2001 From: Teresa Ho Date: Thu, 16 Jul 2020 14:04:08 -0400 Subject: [PATCH] Update device image delete api This commit updates the device image delete api to return the device image information required by sysinv-api-proxy in order to delete the image file from vault. Story: 2007875 Task: 40372 Change-Id: Ie19993b9124a0fe82118462e1ccc25ba606a14ac Signed-off-by: Teresa Ho --- sysinv/sysinv/sysinv/sysinv/api/controllers/v1/device_image.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sysinv/sysinv/sysinv/sysinv/api/controllers/v1/device_image.py b/sysinv/sysinv/sysinv/sysinv/api/controllers/v1/device_image.py index 5864874997..158fd421d4 100644 --- a/sysinv/sysinv/sysinv/sysinv/api/controllers/v1/device_image.py +++ b/sysinv/sysinv/sysinv/sysinv/api/controllers/v1/device_image.py @@ -259,7 +259,7 @@ class DeviceImageController(rest.RestController): return dict(success="", error="", device_image=device_image_dict) @cutils.synchronized(LOCK_NAME) - @wsme_pecan.wsexpose(None, types.uuid, status_code=204) + @wsme_pecan.wsexpose(DeviceImage, types.uuid, status_code=202) def delete(self, deviceimage_uuid): """Delete a device image.""" device_image = objects.device_image.get_by_uuid( @@ -278,6 +278,7 @@ class DeviceImageController(rest.RestController): filename = cutils.format_image_filename(device_image) pecan.request.rpcapi.delete_bitstream_file(pecan.request.context, filename) + return DeviceImage.convert_with_links(device_image) @cutils.synchronized(LOCK_NAME) @wsme_pecan.wsexpose(DeviceImage, types.uuid, wtypes.text, body=types.apidict)