diff options
author | Fu Jinhua <fu.jinhua@zte.com.cn> | 2019-09-03 09:25:20 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-09-03 09:25:20 +0000 |
commit | 2dc27ce8f84c77d3e2fe02576a222683aa19adf4 (patch) | |
tree | 7552e3639d962102c71f4b3898a303ee759e6c3b | |
parent | 26868e34de78e0b94835a9491294a27cf33ed1e3 (diff) | |
parent | 3d48680800e728f149813c53bb7e7de02d7612f8 (diff) |
Merge "Add thread in waiting delete vnf"
-rw-r--r-- | lcm/ns/biz/ns_terminate.py | 11 |
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) |