summaryrefslogtreecommitdiffstats
path: root/lcm
diff options
context:
space:
mode:
authorying.yunlong <ying.yunlong@zte.com.cn>2017-04-22 00:04:32 +0800
committerying.yunlong <ying.yunlong@zte.com.cn>2017-04-22 00:04:32 +0800
commitab3d6a2654b0a280288d683e0348d8914e1746e7 (patch)
tree7c29ec177ff57760706d216d597f135d0739e00c /lcm
parent277f28e784719d0705c027858005cc9c400e9766 (diff)
Modify some logic of vnflcm
Change-Id: Ib3febe26004086cceb53223e01ed6d4d4ec51816 Issue-Id: GVNFM-50 Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
Diffstat (limited to 'lcm')
-rw-r--r--lcm/lcm/nf/vnfs/vnf_create/inst_vnf.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/lcm/lcm/nf/vnfs/vnf_create/inst_vnf.py b/lcm/lcm/nf/vnfs/vnf_create/inst_vnf.py
index a09ac84e..f9300540 100644
--- a/lcm/lcm/nf/vnfs/vnf_create/inst_vnf.py
+++ b/lcm/lcm/nf/vnfs/vnf_create/inst_vnf.py
@@ -19,7 +19,7 @@ from threading import Thread
from lcm.nf.vnfs.const import vnfd_model_dict
from lcm.pub.database.models import NfInstModel, VmInstModel, NetworkInstModel, \
- SubNetworkInstModel, PortInstModel, StorageInstModel, FlavourInstModel, VNFCInstModel
+ SubNetworkInstModel, PortInstModel, StorageInstModel, FlavourInstModel, VNFCInstModel, NfvoRegInfoModel
from lcm.pub.exceptions import NFLCMException
from lcm.pub.msapi.catalog import query_rawdata_from_catalog
from lcm.pub.msapi.gvnfmdriver import apply_grant_to_nfvo, notify_lcm_to_nfvo, get_packageinfo_by_vnfdid
@@ -101,6 +101,7 @@ class InstVnf(Thread):
vendor=vendor, netype=netype, vnfd_model=vnfd_model, status='NOT_INSTANTIATED', vnfdid=self.vnfd_id,
localizationLanguage=ignore_case_get(self.data, 'localizationLanguage'), input_params=self.data,
vnfSoftwareVersion=vnfsoftwareversion, lastuptime=now_time())
+ NfvoRegInfoModel.objects.create(nfvoid=str(uuid.uuid4()), vnfminstid=ignore_case_get(self.data, "vnfmId"))
JobUtil.add_job_status(self.job_id, 15, 'Nf instancing pre-check finish')
logger.info("Nf instancing pre-check finish")
@@ -120,6 +121,8 @@ class InstVnf(Thread):
content_args['addResource'].append(res_def)
res_index += 1
+ vnfmInfo = NfvoRegInfoModel.objects.all()
+ content_args['additionalParam']['vnfmid'] = vnfmInfo[0].vnfminstid
logger.info('content_args=%s' % content_args)
apply_result = apply_grant_to_nfvo(json.dumps(content_args))
vim_info = ignore_case_get(apply_result, "vim")