From: Bin Yang Date: Wed, 8 May 2019 03:29:18 +0000 (+0000) Subject: Fix error http code X-Git-Tag: 1.3.2~3 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F03%2F87203%2F1;p=multicloud%2Fopenstack.git Fix error http code Change-Id: I5a77f92d8cc8a49fd027933bee3c2eedfe89caed Issue-ID: MULTICLOUD-611 Signed-off-by: Bin Yang --- 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