diff options
author | maopengzhang <zhang.maopeng1@zte.com.cn> | 2019-07-05 19:08:58 +0800 |
---|---|---|
committer | maopengzhang <zhang.maopeng1@zte.com.cn> | 2019-07-05 19:08:58 +0800 |
commit | b3e72655bc777a95f28eface061e3fdfead148ca (patch) | |
tree | b493411c8d975cd109cba3129fefc9e2222b3f38 | |
parent | e573115e5f9a5c8ad89a519b81f5771553a7bb11 (diff) |
resolve job view issue
resolve job python2 to python3 issue
Change-Id: Ia81850707b003205ecb2e304e9ed495b3c608102
Issue-ID: VFC-1429
Signed-off-by: maopengzhang <zhang.maopeng1@zte.com.cn>
-rw-r--r-- | lcm/jobs/views.py | 6 |
1 files 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) |