From 97be683b1391039d4fa9a20fda666a18f16b862f Mon Sep 17 00:00:00 2001 From: David Garcia Date: Wed, 9 Sep 2020 15:40:44 +0200 Subject: [PATCH] Fix bug 1206: add relations between VNF and VDU Change-Id: Ibad63bd0dc3692018c2c14487ab6923390a152c5 Signed-off-by: David Garcia --- osm_lcm/ns.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/osm_lcm/ns.py b/osm_lcm/ns.py index 1e56e32..2fad94e 100644 --- a/osm_lcm/ns.py +++ b/osm_lcm/ns.py @@ -2380,10 +2380,13 @@ class NsLcm(LcmBase): to_vca_endpoint = None vca_list = deep_get(db_nsr, ('_admin', 'deployed', 'VCA')) for vca in vca_list: - if vca.get('vdu_id') == r.get('entities')[0].get('id') and vca.get('config_sw_installed'): + key_to_check = "vdu_id" + if vca.get("vdu_id") is None: + key_to_check = "vnfd_id" + if vca.get(key_to_check) == r.get('entities')[0].get('id') and vca.get('config_sw_installed'): from_vca_ee_id = vca.get('ee_id') from_vca_endpoint = r.get('entities')[0].get('endpoint') - if vca.get('vdu_id') == r.get('entities')[1].get('id') and vca.get('config_sw_installed'): + if vca.get(key_to_check) == r.get('entities')[1].get('id') and vca.get('config_sw_installed'): to_vca_ee_id = vca.get('ee_id') to_vca_endpoint = r.get('entities')[1].get('endpoint') if from_vca_ee_id and to_vca_ee_id: -- 2.25.1