Bug 1949 fixed to update the deploy_params_kdu dict instead of overwriting it 03/11803/4
authorPedro Escaleira <escaleira@av.it.pt>
Wed, 30 Mar 2022 23:08:05 +0000 (00:08 +0100)
committercubag <gcuba@whitestack.com>
Tue, 5 Apr 2022 01:33:40 +0000 (03:33 +0200)
Change-Id: I47ffa741679a6942bd3f4e46ec0a382e8a55422c
Signed-off-by: Pedro Escaleira <escaleira@av.it.pt>
osm_lcm/ns.py

index 613163b..8eccf05 100644 (file)
@@ -892,8 +892,12 @@ class NsLcm(LcmBase):
         for flavor in target["flavor"]:
             flavor["vim_info"] = {}
         if db_nsr.get("affinity-or-anti-affinity-group"):
-            target["affinity-or-anti-affinity-group"] = deepcopy(db_nsr["affinity-or-anti-affinity-group"])
-            for affinity_or_anti_affinity_group in target["affinity-or-anti-affinity-group"]:
+            target["affinity-or-anti-affinity-group"] = deepcopy(
+                db_nsr["affinity-or-anti-affinity-group"]
+            )
+            for affinity_or_anti_affinity_group in target[
+                "affinity-or-anti-affinity-group"
+            ]:
                 affinity_or_anti_affinity_group["vim_info"] = {}
 
         if db_nslcmop.get("lcmOperationType") != "instantiate":
@@ -2381,7 +2385,9 @@ class NsLcm(LcmBase):
                     kdur_list = []
                     for kdur in vnfr["kdur"]:
                         if kdur.get("additionalParams"):
-                            kdur["additionalParams"] = json.loads(kdur["additionalParams"])
+                            kdur["additionalParams"] = json.loads(
+                                kdur["additionalParams"]
+                            )
                         kdur_list.append(kdur)
                     vnfr["kdur"] = kdur_list
 
@@ -2579,8 +2585,8 @@ class NsLcm(LcmBase):
                         )
                         deploy_params_kdu = {"OSM": get_osm_params(db_vnfr)}
                         if kdur.get("additionalParams"):
-                            deploy_params_kdu = parse_yaml_strings(
-                                kdur["additionalParams"]
+                            deploy_params_kdu.update(
+                                parse_yaml_strings(kdur["additionalParams"].copy())
                             )
 
                         self._deploy_n2vc(
@@ -4936,7 +4942,9 @@ class NsLcm(LcmBase):
                     kdur_list = []
                     for kdur in db_vnfr["kdur"]:
                         if kdur.get("additionalParams"):
-                            kdur["additionalParams"] = json.loads(kdur["additionalParams"])
+                            kdur["additionalParams"] = json.loads(
+                                kdur["additionalParams"]
+                            )
                         kdur_list.append(kdur)
                     db_vnfr["kdur"] = kdur_list
                 step = "Getting vnfd from database"