Fix notify lcm exception deal logic 73/28273/1
authorfujinhua <fu.jinhua@zte.com.cn>
Tue, 16 Jan 2018 08:27:06 +0000 (16:27 +0800)
committerfujinhua <fu.jinhua@zte.com.cn>
Tue, 16 Jan 2018 08:27:06 +0000 (16:27 +0800)
Change-Id: I127e1afea78410b11c2e9ec22be18fb7f979e01c
Issue-ID: VFC-654
Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
lcm/ns/vnfs/notify_lcm.py

index 4ec8052..619c671 100644 (file)
@@ -62,11 +62,11 @@ class NotifyLcm(object):
             self.exception('unexpected exception')
 
     def get_vnfinstid(self, mnfinstid, vnfm_inst_id):
+        logger.debug("mnfinstid=%s, vnfm_inst_id=%s", mnfinstid, vnfm_inst_id)
         nfinst = NfInstModel.objects.filter(mnfinstid=mnfinstid, vnfm_inst_id=vnfm_inst_id).first()
         if nfinst:
             return nfinst.nfinstid
-        else:
-            self.exception('vnfinstid not exist')
+        raise NSLCMException("vnfinstid not exist")
 
     def exception(self, error_msg):
         logger.error('Notify Lcm failed, detail message: %s' % error_msg)