summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfujinhua <fu.jinhua@zte.com.cn>2018-11-24 17:08:43 +0800
committerfujinhua <fu.jinhua@zte.com.cn>2018-11-24 17:08:43 +0800
commit4dbdc1c04cb58cb578e191f94bf9036d559a537c (patch)
treea0c7994b3210fd592b7de12ec43f3fd484d92c2b
parentefbe5c7963cb93e034189bb5ade804dd104e68f6 (diff)
Fix ns term logic
Change-Id: Idc2c908c3b28089ff5d30bc6a23974794993a2c9 Issue-ID: VFC-1163 Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
-rw-r--r--lcm/ns/biz/ns_terminate.py19
1 files changed, 12 insertions, 7 deletions
diff --git a/lcm/ns/biz/ns_terminate.py b/lcm/ns/biz/ns_terminate.py
index e2419821..9baabf97 100644
--- a/lcm/ns/biz/ns_terminate.py
+++ b/lcm/ns/biz/ns_terminate.py
@@ -128,13 +128,18 @@ class TerminateNsService(threading.Thread):
vnf_jobs.append((vnfinst.nfinstid, vnf_job_id))
for vnfinstid, vnfjobid in vnf_jobs:
- cur_progress += step_progress
- if not vnfjobid:
- continue
- is_job_ok = self.wait_delete_vnf_job_finish(vnfjobid)
- msg = "%s to delete VNF(%s)" % ("Succeed" if is_job_ok else "Failed", vnfinstid)
- logger.debug(msg)
- JobUtil.add_job_status(self.job_id, cur_progress, msg)
+ try:
+ cur_progress += step_progress
+ if not vnfjobid:
+ continue
+ is_job_ok = self.wait_delete_vnf_job_finish(vnfjobid)
+ msg = "%s to delete VNF(%s)" % ("Succeed" if is_job_ok else "Failed", vnfinstid)
+ logger.debug(msg)
+ JobUtil.add_job_status(self.job_id, cur_progress, msg)
+ except Exception as e:
+ msg = "Exception occurs when delete VNF(%s)" % vnfinstid
+ logger.debug(msg)
+ JobUtil.add_job_status(self.job_id, cur_progress, msg)
def delete_vnf(self, nf_instid):
term_param = {