aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhewei-cmss <hewei@cmss.chinamobile.com>2019-09-03 16:14:58 +0800
committerhewei-cmss <hewei@cmss.chinamobile.com>2019-09-03 16:58:51 +0800
commit3d48680800e728f149813c53bb7e7de02d7612f8 (patch)
tree32c329819b31c406df73225101b4037dcd481d9f
parentfbc82d28cf89b6dcdce81f4a7ae0bee0012bae6d (diff)
Add thread in waiting delete vnf
Issue-ID: VFC-1504 Signed-off-by: hewei-cmss <hewei@cmss.chinamobile.com> Change-Id: I04a2a5a3ecfed76285cee0bcb6560e1e5cddd8ba
-rw-r--r--lcm/ns/biz/ns_terminate.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/lcm/ns/biz/ns_terminate.py b/lcm/ns/biz/ns_terminate.py
index 30fbd4c9..6bb444ca 100644
--- a/lcm/ns/biz/ns_terminate.py
+++ b/lcm/ns/biz/ns_terminate.py
@@ -133,17 +133,24 @@ class TerminateNsService(threading.Thread):
JobUtil.add_job_status(self.job_id, cur_progress, job_msg)
vnf_jobs.append((vnfinst.nfinstid, vnf_job_id))
+ thread = threading.Thread(
+ target=self.wait_delete_vnfs,
+ args=(vnf_jobs, cur_progress, step_progress,))
+ thread.start()
+
+ def wait_delete_vnfs(self, vnf_jobs, cur_progress, step_progress):
for vnfinstid, vnfjobid in vnf_jobs:
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)
+ 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
+ msg = "Exception occurs(%s) when delete VNF(%s)" % (e, vnfinstid)
logger.debug(msg)
JobUtil.add_job_status(self.job_id, cur_progress, msg)