From d80634ce2a300cd3256b789e9e0bb8df82db2b41 Mon Sep 17 00:00:00 2001 From: Bin Yang Date: Wed, 8 May 2019 03:29:18 +0000 Subject: Fix error http code Change-Id: I5a77f92d8cc8a49fd027933bee3c2eedfe89caed Issue-ID: MULTICLOUD-611 Signed-off-by: Bin Yang --- share/starlingx_base/resource/infra_workload.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/share/starlingx_base/resource/infra_workload.py b/share/starlingx_base/resource/infra_workload.py index af5f5531..48990d28 100644 --- a/share/starlingx_base/resource/infra_workload.py +++ b/share/starlingx_base/resource/infra_workload.py @@ -125,7 +125,7 @@ class InfraWorkload(newton_infra_workload.InfraWorkload): else: progress = backlog_item.get( "status", - (13, "DELETE_FAILED", + (13, "UPDATE_FAILED", "Unexpected:status not found in backlog item") ) @@ -136,9 +136,10 @@ class InfraWorkload(newton_infra_workload.InfraWorkload): resp_template["workload_status"] = progress_status resp_template["workload_status_reason"] = progress_msg - status_code = status.HTTP_200_ACCEPTED\ + status_code = status.HTTP_202_ACCEPTED\ if progress_code == 0 else progress_code except Exception as e: + self._logger.warn("Exception: %s" % e.message) resp_template["workload_status_reason"] = progress return Response(data=resp_template, status=status_code) @@ -332,7 +333,7 @@ class InfraWorkload(newton_infra_workload.InfraWorkload): resp_template["workload_status"] = progress_status resp_template["workload_status_reason"] = progress_msg - status_code = status.HTTP_200_ACCEPTED \ + status_code = status.HTTP_202_ACCEPTED \ if progress_code == 0 else progress_code except Exception as e: resp_template["workload_status_reason"] = progress -- cgit 1.2.3-korg