From 729152f300acdec04fccb45974fdcd4a36aca4d6 Mon Sep 17 00:00:00 2001 From: fujinhua Date: Thu, 29 Nov 2018 08:59:06 +0800 Subject: Fix vnf notify logic Change-Id: I25cf6815d2e21a249774ab5ff693cd61d1b53f31 Issue-ID: VFC-1163 Signed-off-by: fujinhua (cherry picked from commit 0c6d0e485588ec6e557942a34b810ae65eda4d29) --- lcm/lcm/pub/msapi/gvnfmdriver.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lcm/lcm/pub/msapi/gvnfmdriver.py b/lcm/lcm/pub/msapi/gvnfmdriver.py index c2519ea0..41e04f87 100644 --- a/lcm/lcm/pub/msapi/gvnfmdriver.py +++ b/lcm/lcm/pub/msapi/gvnfmdriver.py @@ -101,15 +101,15 @@ def prepare_notification_data(nfinstid, jobid, changetype, operation): 'resourceProviderId': port.name, # TODO: is resourceName mapped to resourceProviderId? 'vimLevelResourceType': 'port' }, - 'cpInstanceId': port.cpinstanceid # TODO: port.cpinstanceid is not initiated when create port resource. + 'cpInstanceId': port.portid # TODO: port.cpinstanceid is not initiated when create port resource. }) for network_id, ext_link_ports in ext_connectivity_map.items(): networks = NetworkInstModel.objects.filter(networkid=network_id) - network = networks[0] + net_name = networks[0].name if networks else network_id network_resource = { - 'vimConnectionId': network.vimid, - 'resourceId': network.resourceid, - 'resourceProviderId': network.name, # TODO: is resourceName mapped to resourceProviderId? + 'vimConnectionId': ext_link_ports[0]['resourceHandle']['vimConnectionId'], + 'resourceId': network_id, + 'resourceProviderId': net_name, # TODO: is resourceName mapped to resourceProviderId? 'vimLevelResourceType': 'network' } ext_connectivity.append({ -- cgit 1.2.3-korg