summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbiancunkang <bian.cunkang@zte.com.cn>2018-08-08 13:47:58 +0800
committerbiancunkang <bian.cunkang@zte.com.cn>2018-08-08 13:47:58 +0800
commita106582c20533074beab99eeed55f909735c8eca (patch)
treea58f063b45f6fe54f7fae8ac9287fb06a21649b8
parentc0683afc58b07bba7f5105d9785e19adf84e9bdc (diff)
CreateVnf and DeleteVnf
Modify delete_vnf.py and curd_vnf_views.py Change-Id: I045c52d84ebe80f8eb454eaf1f7750a383c31289 Issue-ID: VFC-1015 Signed-off-by: biancunkang <bian.cunkang@zte.com.cn>
-rw-r--r--lcm/lcm/nf/biz/delete_vnf.py9
-rw-r--r--lcm/lcm/nf/views/curd_vnf_views.py2
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)