Fix pep8 for vfc-nfvo-lcm 33/25433/1
authorfujinhua <fu.jinhua@zte.com.cn>
Mon, 4 Dec 2017 09:25:27 +0000 (17:25 +0800)
committerfujinhua <fu.jinhua@zte.com.cn>
Mon, 4 Dec 2017 09:25:27 +0000 (17:25 +0800)
Change-Id: I139834ea22c7e7bcc338c20bcc238306a3fb2e76
Issue-ID: VFC-610
Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
lcm/ns/vnfs/views.py

index 2a94c8c..411ecf0 100644 (file)
@@ -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)