From: Pedro Escaleira Date: Wed, 30 Mar 2022 23:08:05 +0000 (+0100) Subject: Bug 1949 fixed to update the deploy_params_kdu dict instead of overwriting it X-Git-Tag: v12.0.0rc1~24 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F03%2F11803%2F4;p=osm%2FLCM.git Bug 1949 fixed to update the deploy_params_kdu dict instead of overwriting it Change-Id: I47ffa741679a6942bd3f4e46ec0a382e8a55422c Signed-off-by: Pedro Escaleira --- 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"