summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhewei-cmss <hewei@cmss.chinamobile.com>2019-10-14 09:35:48 +0800
committerhewei-cmss <hewei@cmss.chinamobile.com>2019-10-14 09:35:48 +0800
commit2ff0797f2bcc531acc56eef60aec40c5c6b1ef00 (patch)
treed6888abd68ba883c6a540e81e7eefa4661782c27
parentd68d40a34d7f73c1c700db5e62bd75c97365ad27 (diff)
modify ns terminate
Issue-ID: VFC-1504 Signed-off-by: hewei-cmss <hewei@cmss.chinamobile.com> Change-Id: I029e720ec6a984d976cc3bd17b7e5257e4ea407b
-rw-r--r--lcm/ns/biz/ns_terminate.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/lcm/ns/biz/ns_terminate.py b/lcm/ns/biz/ns_terminate.py
index 6bb444ca..06e84b7e 100644
--- a/lcm/ns/biz/ns_terminate.py
+++ b/lcm/ns/biz/ns_terminate.py
@@ -28,6 +28,8 @@ from lcm.ns.enum import OWNER_TYPE
from lcm.pub.database.models import PNFInstModel
from lcm.ns.biz.ns_lcm_op_occ import NsLcmOpOcc
from lcm.jobs.enum import JOB_PROGRESS
+from lcm.ns.enum import NS_INST_STATUS
+from lcm.workflows import build_in
logger = logging.getLogger(__name__)
@@ -48,6 +50,7 @@ class TerminateNsService(threading.Thread):
NsLcmOpOcc.update(self.occ_id, "COMPLETED")
return
JobUtil.add_job_status(self.job_id, 10, "Starting terminate...", '')
+ NSInstModel.objects.filter(id=self.ns_inst_id).update(status=NS_INST_STATUS.TERMINATING)
self.cancel_sfc_list()
self.cancel_vnf_list()
@@ -60,11 +63,13 @@ class TerminateNsService(threading.Thread):
except NSLCMException as e:
JobUtil.add_job_status(self.job_id, JOB_PROGRESS.ERROR, e.args[0])
NsLcmOpOcc.update(self.occ_id, operationState="FAILED", error=e.args[0])
+ build_in.post_deal(self.ns_inst_id, "false")
except Exception as e:
logger.error(e.args[0])
logger.error(traceback.format_exc())
JobUtil.add_job_status(self.job_id, JOB_PROGRESS.ERROR, "ns terminate fail.")
NsLcmOpOcc.update(self.occ_id, operationState="FAILED", error=e.args[0])
+ build_in.post_deal(self.ns_inst_id, "false")
def cancel_vl_list(self):
array_vlinst = VLInstModel.objects.filter(ownertype=OWNER_TYPE.NS, ownerid=self.ns_inst_id)