Fix bug 1206: add relations between VNF and VDU 59/9759/1 v7.0
authorDavid Garcia <david.garcia@canonical.com>
Wed, 9 Sep 2020 13:40:44 +0000 (15:40 +0200)
committergarciadav <david.garcia@canonical.com>
Fri, 25 Sep 2020 13:36:57 +0000 (15:36 +0200)
Change-Id: Ibad63bd0dc3692018c2c14487ab6923390a152c5
Signed-off-by: David Garcia <david.garcia@canonical.com>
(cherry picked from commit b3972b9d8f791732f836bf101de62a192adf23f2)

osm_lcm/ns.py

index 489c436..bcd675b 100644 (file)
@@ -2067,10 +2067,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: