From b9a7c4dec40ffe379aea5ef2bcf82a448ce9ee6e Mon Sep 17 00:00:00 2001 From: Pedro Escaleira Date: Thu, 31 Mar 2022 00:08:05 +0100 Subject: [PATCH] Bug 1949 fixed to update the deploy_params_kdu dict instead of overwriting it Change-Id: I47ffa741679a6942bd3f4e46ec0a382e8a55422c Signed-off-by: Pedro Escaleira --- osm_lcm/ns.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/osm_lcm/ns.py b/osm_lcm/ns.py index 613163b..8eccf05 100644 --- a/osm_lcm/ns.py +++ b/osm_lcm/ns.py @@ -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" -- 2.25.1