diff options
author | Fu Jinhua <fu.jinhua@zte.com.cn> | 2018-08-08 06:04:39 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-08-08 06:04:39 +0000 |
commit | 5e0b0a3a63ce9c70b3486cd6e5cd38e072f7c3e0 (patch) | |
tree | 7c1e3b802977c5582c34a6a9c4afb6a604845c49 | |
parent | f34bc365946d633a4f4802a7d7ffdd8e199623c4 (diff) | |
parent | a106582c20533074beab99eeed55f909735c8eca (diff) |
Merge "CreateVnf and DeleteVnf"
-rw-r--r-- | lcm/lcm/nf/biz/delete_vnf.py | 9 | ||||
-rw-r--r-- | lcm/lcm/nf/views/curd_vnf_views.py | 2 |
2 files changed, 2 insertions, 9 deletions
diff --git a/lcm/lcm/nf/biz/delete_vnf.py b/lcm/lcm/nf/biz/delete_vnf.py index c0940303..6148e6a6 100644 --- a/lcm/lcm/nf/biz/delete_vnf.py +++ b/lcm/lcm/nf/biz/delete_vnf.py @@ -13,10 +13,8 @@ # limitations under the License. import logging -import traceback from lcm.pub.database.models import NfInstModel, NfvoRegInfoModel -from lcm.pub.exceptions import NFLCMException logger = logging.getLogger(__name__) @@ -27,16 +25,9 @@ class DeleteVnf: self.nf_inst_id = instanceid def do_biz(self): - try: self.check_parameter() self.delete_info_from_db() logger.debug('VnfInst(%s) is deleted.' % self.nf_inst_id) - except NFLCMException as e: - logger.debug('Delete VNF instance[%s] failed: %s', self.nf_inst_id, e.message) - except Exception as e: - logger.error(e.message) - logger.error(traceback.format_exc()) - logger.debug('Delete VNF instance[%s] failed' % self.nf_inst_id) def check_parameter(self): vnf_insts = NfInstModel.objects.filter(nfinstid=self.nf_inst_id) diff --git a/lcm/lcm/nf/views/curd_vnf_views.py b/lcm/lcm/nf/views/curd_vnf_views.py index 33f32a10..0d3b5ff5 100644 --- a/lcm/lcm/nf/views/curd_vnf_views.py +++ b/lcm/lcm/nf/views/curd_vnf_views.py @@ -124,8 +124,10 @@ class DeleteVnfAndQueryVnf(APIView): return Response(data=None, status=status.HTTP_204_NO_CONTENT) except NFLCMException as e: logger.error(e.message) + logger.debug('Delete VNF instance[%s] failed' % instanceid) return Response(data={'error': '%s' % e.message}, status=status.HTTP_500_INTERNAL_SERVER_ERROR) except Exception as e: logger.error(e.message) logger.error(traceback.format_exc()) + logger.debug('Delete VNF instance[%s] failed' % instanceid) return Response(data={'error': 'unexpected exception'}, status=status.HTTP_500_INTERNAL_SERVER_ERROR) |