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
vnf_inst_info = self.get_vnf_inst()
if not vnf_inst_info:
self.add_progress(100, "TERM_VNF_NOT_EXIST_SUCCESS", "finished")
+ return None
self.add_progress(2, "GET_VNF_INST_SUCCESS")
self.vnfm_inst_id = vnf_inst_info.vnfm_inst_id
self.vnf_uuid = vnf_inst_info.mnfinstid
def delete_subscription(self):
try:
- SubscriptionDeletion(self.vnfm_inst_id, self.vnf_inst_id).do_biz()
+ SubscriptionDeletion(self.vnfm_inst_id, self.vnf_uuid).do_biz()
except Exception as e:
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()