fix kdu_model instantianion parameter 95/8795/2
authortierno <alfonso.tiernosepulveda@telefonica.com>
Fri, 17 Apr 2020 11:27:47 +0000 (11:27 +0000)
committertierno <alfonso.tiernosepulveda@telefonica.com>
Fri, 17 Apr 2020 13:09:18 +0000 (13:09 +0000)
Change-Id: Ia0afd32c664961216dad5a4c74dc93ea99103417
Signed-off-by: tierno <alfonso.tiernosepulveda@telefonica.com>
osm_nbi/__init__.py
osm_nbi/instance_topics.py

index 2c895ce..7bd5b6b 100644 (file)
@@ -12,8 +12,8 @@
 # under the License.
 ##
 
-version = '7.0.1.post17'
-version_date = '2019-03-31'
+version = '7.0.1.post23'
+version_date = '2020-04-17'
 
 # Obtain installed package version. Ignore if error, e.g. pkg_resources not installed
 try:
index 319a690..1a54135 100644 (file)
@@ -144,18 +144,18 @@ class NsrTopic(BaseTopic):
                 additional_params = copy(item.get("additionalParams")) or {}
                 if vdu_id and item.get("additionalParamsForVdu"):
                     item_vdu = next((x for x in item["additionalParamsForVdu"] if x["vdu_id"] == vdu_id), None)
+                    other_params = item_vdu
                     if item_vdu and item_vdu.get("additionalParams"):
                         where_ += ".additionalParamsForVdu[vdu_id={}]".format(vdu_id)
                         additional_params = item_vdu["additionalParams"]
-                        other_params = item_vdu
                 if kdu_name:
                     additional_params = {}
                     if item.get("additionalParamsForKdu"):
                         item_kdu = next((x for x in item["additionalParamsForKdu"] if x["kdu_name"] == kdu_name), None)
+                        other_params = item_kdu
                         if item_kdu and item_kdu.get("additionalParams"):
                             where_ += ".additionalParamsForKdu[kdu_name={}]".format(kdu_name)
                             additional_params = item_kdu["additionalParams"]
-                            other_params = item_kdu
 
         if additional_params:
             for k, v in additional_params.items():
@@ -376,7 +376,7 @@ class NsrTopic(BaseTopic):
                                                                                  member_vnf["member-vnf-index"],
                                                                                  kdu_name=kdu["name"], descriptor=vnfd)
                     kdu_k8s_namespace = vnf_k8s_namespace
-                    kdu_model = kdu_params.get("kdu_model")
+                    kdu_model = kdu_params.get("kdu_model") if kdu_params else None
                     if kdu_params and kdu_params.get("k8s-namespace"):
                         kdu_k8s_namespace = kdu_params["k8s-namespace"]