summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfujinhua <fu.jinhua@zte.com.cn>2017-12-04 17:25:27 +0800
committerfujinhua <fu.jinhua@zte.com.cn>2017-12-04 17:25:27 +0800
commitf1c3a65a24b92d29ca43065117ba71c07255366e (patch)
tree9e105a83932ee7286cf02e3d6a55ef9756591eb7
parent87750a79b0f803dad5c46609b1c99d3a42ccf877 (diff)
Fix pep8 for vfc-nfvo-lcm
Change-Id: I139834ea22c7e7bcc338c20bcc238306a3fb2e76 Issue-ID: VFC-610 Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
-rw-r--r--lcm/ns/vnfs/views.py10
1 files changed, 8 insertions, 2 deletions
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)