diff options
author | yangyan <dengyuanhong@chinamobile.com> | 2020-05-20 15:38:39 +0800 |
---|---|---|
committer | Yuanhong Deng <dengyuanhong@chinamobile.com> | 2020-05-20 07:40:27 +0000 |
commit | b9d6ee2444e2d4cc8a32fc723a4d8b4c1d009259 (patch) | |
tree | 0ebd8119ccc2fdd09ab78ebd8e629d794893a988 | |
parent | 1f55bd9564c95d4eabd3addfe6d2542e9db853b5 (diff) |
Rm port inst data from db when terminate vnf
Change-Id: I3e3361d391fb645924d2b0c3e5507fb2a5ec7b7c
Issue-ID: VFC-1657
Signed-off-by: yangyan <dengyuanhong@chinamobile.com>
-rw-r--r-- | lcm/ns_vnfs/biz/terminate_nfs.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lcm/ns_vnfs/biz/terminate_nfs.py b/lcm/ns_vnfs/biz/terminate_nfs.py index 0205535b..397460ea 100644 --- a/lcm/ns_vnfs/biz/terminate_nfs.py +++ b/lcm/ns_vnfs/biz/terminate_nfs.py @@ -18,7 +18,7 @@ import threading import traceback from lcm.pub.config.config import REPORT_TO_AAI -from lcm.pub.database.models import NfInstModel, VmInstModel, OOFDataModel +from lcm.pub.database.models import NfInstModel, VmInstModel, OOFDataModel, PortInstModel from lcm.pub.exceptions import NSLCMException from lcm.pub.msapi import resmgr from lcm.pub.msapi.aai import query_vnf_aai, delete_vnf_aai, query_vserver_aai, delete_vserver_aai @@ -145,6 +145,7 @@ class TerminateVnfs(threading.Thread): logger.error("delete_subscription failed: %s", e.args[0]) def delete_data_from_db(self): + PortInstModel.objects.filter(instid=self.vnf_inst_id).delete() NfInstModel.objects.filter(nfinstid=self.vnf_inst_id).delete() VmInstModel.objects.filter(instid=self.vnf_inst_id).delete() OOFDataModel.objects.filter(service_resource_id=self.vnf_inst_id).delete() |