From: fujinhua Date: Mon, 4 Dec 2017 09:25:27 +0000 (+0800) Subject: Fix pep8 for vfc-nfvo-lcm X-Git-Tag: v1.1.0~261 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F33%2F25433%2F1;p=vfc%2Fnfvo%2Flcm.git Fix pep8 for vfc-nfvo-lcm Change-Id: I139834ea22c7e7bcc338c20bcc238306a3fb2e76 Issue-ID: VFC-610 Signed-off-by: fujinhua --- diff --git a/lcm/ns/vnfs/views.py b/lcm/ns/vnfs/views.py index 2a94c8ce..411ecf05 100644 --- a/lcm/ns/vnfs/views.py +++ b/lcm/ns/vnfs/views.py @@ -71,6 +71,7 @@ class NfDetailView(APIView): try: TerminateVnfs(data, vnf_inst_id, job_id).start() except Exception as e: + logger.error(e.message) return Response(data={'error': '%s' % e.message}, status=status.HTTP_409_CONFLICT) rsp = {'jobId': job_id} return Response(data=rsp, status=status.HTTP_201_CREATED) @@ -95,6 +96,7 @@ class NfGrant(APIView): """ return Response(data=rsp, status=status.HTTP_201_CREATED) except Exception as e: + logger.error(e.message) logger.error(traceback.format_exc()) return Response(data={'error': '%s' % e.message}, status=status.HTTP_409_CONFLICT) @@ -106,6 +108,7 @@ class LcmNotify(APIView): NotifyLcm(vnfmid, vnfInstanceId, request_paras.data).do_biz() return Response(data={}, status=status.HTTP_201_CREATED) except Exception as e: + logger.error(e.message) return Response(data={'error': '%s' % e.message}, status=status.HTTP_409_CONFLICT) @@ -116,6 +119,7 @@ class NfScaleView(APIView): NFManualScaleService(vnfinstid, request_paras.data).start() return Response(data={}, status=status.HTTP_202_ACCEPTED) except Exception as e: + logger.error(e.message) return Response(data={'error': '%s' % e.message}, status=status.HTTP_409_CONFLICT) @@ -135,7 +139,8 @@ class NfVnfmInfoView(APIView): except NSLCMException as e: logger.error(e.message) return Response(data={'error': '%s' % e.message}, status=status.HTTP_500_INTERNAL_SERVER_ERROR) - except: + except Exception as e: + logger.error(e.message) logger.error(traceback.format_exc()) return Response(data={'error': 'Failed to get vnfm info.'}, status=status.HTTP_500_INTERNAL_SERVER_ERROR) @@ -150,7 +155,8 @@ class NfVimInfoView(APIView): except NSLCMException as e: logger.error(e.message) return Response(data={'error': '%s' % e.message}, status=status.HTTP_500_INTERNAL_SERVER_ERROR) - except: + except Exception as e: + logger.error(e.message) logger.error(traceback.format_exc()) return Response(data={'error': 'Failed to get vim info.'}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)