Fixes 1367 by preventing pyang discard repeated constituent-base-element-id
[osm/NBI.git] / osm_nbi / instance_topics.py
index 8ae3a45..c47ed9b 100644 (file)
@@ -481,8 +481,8 @@ class NsrTopic(BaseTopic):
         for cp in vnfd.get("ext-cpd", ()):
             vnf_cp = {
                 "name": cp.get("id"),
-                "connection-point-id": cp.get("int-cpd").get("cpd"),
-                "connection-point-vdu-id": cp.get("int-cpd").get("vdu-id"),
+                "connection-point-id": cp.get("int-cpd", {}).get("cpd"),
+                "connection-point-vdu-id": cp.get("int-cpd", {}).get("vdu-id"),
                 "id": cp.get("id"),
                 # "ip-address", "mac-address" # filled by LCM
                 # vim-id  # TODO it would be nice having a vim port id
@@ -528,7 +528,7 @@ class NsrTopic(BaseTopic):
             if kdu_params and kdu_params.get("config-units"):
                 kdur["config-units"] = kdu_params["config-units"]
 
-            kdu_model_data = all_kdu_models[all_kdu_profiles_models[kdur["name"]]]
+            kdu_model_data = all_kdu_models[all_kdu_profiles_models[kdur["kdu-name"]]]
             kdur[kdu_model_data.get("kdu-model-type")] = kdu_model or kdu_model_data
             if not vnfr_descriptor.get("kdur"):
                 vnfr_descriptor["kdur"] = []