From b3e72655bc777a95f28eface061e3fdfead148ca Mon Sep 17 00:00:00 2001 From: maopengzhang Date: Fri, 5 Jul 2019 19:08:58 +0800 Subject: resolve job view issue resolve job python2 to python3 issue Change-Id: Ia81850707b003205ecb2e304e9ed495b3c608102 Issue-ID: VFC-1429 Signed-off-by: maopengzhang --- lcm/jobs/views.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lcm/jobs/views.py b/lcm/jobs/views.py index 1fbaf0d8..3079c168 100644 --- a/lcm/jobs/views.py +++ b/lcm/jobs/views.py @@ -62,7 +62,7 @@ class JobView(APIView): return Response(data=ret, status=status.HTTP_200_OK) except Exception as e: logger.error(traceback.format_exc()) - return Response(data={'error': e.message}, status=status.HTTP_500_INTERNAL_SERVER_ERROR) + return Response(data={'error': e.args[0]}, status=status.HTTP_500_INTERNAL_SERVER_ERROR) @swagger_auto_schema( operation_description="Update job", @@ -94,10 +94,10 @@ class JobView(APIView): resp_serializer = JobUpdRespSerializer(job_update_resp) return Response(data=resp_serializer.data, status=status.HTTP_202_ACCEPTED) except NSLCMException as e: - job_update_resp = JobUpdResp('error', e.message) + job_update_resp = JobUpdResp('error', e.args[0]) resp_serializer = JobUpdRespSerializer(job_update_resp) return Response(data=resp_serializer.data, status=status.HTTP_400_BAD_REQUEST) except Exception as e: - job_update_resp = JobUpdResp('error', e.message) + job_update_resp = JobUpdResp('error', e.args[0]) resp_serializer = JobUpdRespSerializer(job_update_resp) return Response(data=resp_serializer.data, status=status.HTTP_500_INTERNAL_SERVER_ERROR) -- cgit 1.2.3-korg