From 3c4f84448181551a9daa5804b6512aee8f7e903c Mon Sep 17 00:00:00 2001 From: fujinhua Date: Wed, 14 Nov 2018 17:36:10 +0800 Subject: Fix vm data save logic Change-Id: I7a384f91a971356a4cb976ff89063d497dc6565e Issue-ID: VFC-1163 Signed-off-by: fujinhua (cherry picked from commit 26cb6aa172fe074cfc25effe0abdc8b5b15ba149) --- lcm/lcm/nf/biz/common.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lcm/lcm/nf/biz/common.py b/lcm/lcm/nf/biz/common.py index 308ba060..3c21ab5a 100644 --- a/lcm/lcm/nf/biz/common.py +++ b/lcm/lcm/nf/biz/common.py @@ -120,13 +120,14 @@ def flavor_save(job_id, nf_inst_id, ret): def vm_save(job_id, nf_inst_id, ret): JobUtil.add_job_status(job_id, 70, 'Create vms!') vm_id = str(uuid.uuid4()) + nics = ignore_case_get(ret, "nicArray") VmInstModel.objects.create( vmid=vm_id, vmname=ignore_case_get(ret, "name"), vimid=ignore_case_get(ret, "vimId"), resourceid=ignore_case_get(ret, "id"), tenant=ignore_case_get(ret, "tenantId"), - nic_array=ignore_case_get(ret, "nicArray"), + nic_array=nics if nics else "null", metadata=ignore_case_get(ret, "metadata"), volume_array=ignore_case_get(ret, "volumeArray"), server_group=ignore_case_get(ret, "serverGroup"), -- cgit 1.2.3-korg