From 6070e5379a56d3af1b43374722188c853b2cdb2a Mon Sep 17 00:00:00 2001 From: "ying.yunlong" Date: Fri, 3 Mar 2017 09:07:19 +0800 Subject: Modify code of update database table Change-Id: I7639d787d30cb8fc937a1eb0f5261326ad030dd6 Issue-Id: GVNFM-43 Signed-off-by: ying.yunlong --- lcm/lcm/nf/vnfs/vnf_create/inst_vnf.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/lcm/lcm/nf/vnfs/vnf_create/inst_vnf.py b/lcm/lcm/nf/vnfs/vnf_create/inst_vnf.py index 08a3c37d..aa72c4e7 100644 --- a/lcm/lcm/nf/vnfs/vnf_create/inst_vnf.py +++ b/lcm/lcm/nf/vnfs/vnf_create/inst_vnf.py @@ -86,12 +86,17 @@ class InstVnf(Thread): self.update_cps() self.check_parameter_exist() + metadata = ignore_case_get(self.vnfd_info, "metadata") + version = ignore_case_get(metadata, "vnfd_version") + vendor = ignore_case_get(metadata, "vendor") + netype = ignore_case_get(metadata, "vnf_type") + vnfsoftwareversion = ignore_case_get(metadata, "version") + vnfd_model = self.vnfd_info NfInstModel.objects.filter(nfinstid=self.nf_inst_id).\ - update(flavour_id=ignore_case_get(self.data, "flavourId"), - input_params=self.data, - vnfd_model=self.vnfd_info, - localizationLanguage=ignore_case_get(self.data, 'localizationLanguage'), - lastuptime=now_time()) + update(package_id=self.package_id, flavour_id=ignore_case_get(self.data, "flavourId"), version=version, + 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()) JobUtil.add_job_status(self.job_id, 15, 'Nf instancing pre-check finish') logger.info("Nf instancing pre-check finish") -- cgit 1.2.3-korg