From: fujinhua Date: Thu, 22 Nov 2018 07:42:46 +0000 (+0800) Subject: Fix vnf heal logic X-Git-Tag: 1.2.2~7 X-Git-Url: https://gerrit.onap.org/r/gitweb?p=vfc%2Fgvnfm%2Fvnflcm.git;a=commitdiff_plain;h=8e603024f9d1a6292b9cafffb336966b75eeff35 Fix vnf heal logic Change-Id: I45c581a8423695f3287edd664250c1992df3d01b Issue-ID: VFC-1163 Signed-off-by: fujinhua --- diff --git a/lcm/lcm/nf/biz/heal_vnf.py b/lcm/lcm/nf/biz/heal_vnf.py index 4d32d509..5e013042 100644 --- a/lcm/lcm/nf/biz/heal_vnf.py +++ b/lcm/lcm/nf/biz/heal_vnf.py @@ -143,12 +143,13 @@ class HealVnf(Thread): 'resourceId': vm[0].resourceid, 'vimLevelResourceType': 'vm' } - affected_vnfcs.append({ - 'id': vnfcs[0].vnfcinstanceid, - 'vduId': vnfcs[0].vduid, - 'changeType': chtype, - 'computeResource': vm_resource - }) + if vnfcs: + affected_vnfcs.append({ + 'id': vnfcs[0].vnfcinstanceid, + 'vduId': vnfcs[0].vduid, + 'changeType': chtype, + 'computeResource': vm_resource + }) notification_content = { "id": str(uuid.uuid4()),