From: garciadeblas Date: Thu, 1 Sep 2022 11:09:47 +0000 (+0200) Subject: Fix bug 2098 to heal VDU when no VDU is specified in the heal operation X-Git-Tag: release-v13.0-start~14 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F14%2F12514%2F2;p=osm%2FLCM.git Fix bug 2098 to heal VDU when no VDU is specified in the heal operation Change-Id: I1c6f618797f407da856400915d0825767069d6da Signed-off-by: garciadeblas --- diff --git a/osm_lcm/ns.py b/osm_lcm/ns.py index 6cb46e1..8a99e91 100644 --- a/osm_lcm/ns.py +++ b/osm_lcm/ns.py @@ -7565,7 +7565,17 @@ class NsLcm(LcmBase): member_vnf_index = db_vnfr.get("member-vnf-index-ref") # Check each target VDU and deploy N2VC - for target_vdu in target_vnf["additionalParams"].get("vdu", None): + target_vdu_list = target_vnf.get("additionalParams", {}).get("vdu", []) + if not target_vdu_list: + # Codigo nuevo para crear diccionario + target_vdu_list = [] + for existing_vdu in db_vnfr.get("vdur"): + vdu_name = existing_vdu.get("vdu-name", None) + vdu_index = existing_vdu.get("count-index", 0) + vdu_run_day1 = target_vnf.get("additionalParams", {}).get("run-day1", False) + vdu_to_be_healed = {"vdu-id": vdu_name, "count-index": vdu_index, "run-day1": vdu_run_day1} + target_vdu_list.append(vdu_to_be_healed) + for target_vdu in target_vdu_list: deploy_params_vdu = target_vdu # Set run-day1 vnf level value if not vdu level value exists if not deploy_params_vdu.get("run-day1") and target_vnf["additionalParams"].get("run-day1"):