From b1c9f37d645d82c14f1ee85e8b9f8362cc978c94 Mon Sep 17 00:00:00 2001 From: ksaikiranr Date: Mon, 15 Mar 2021 11:07:29 +0530 Subject: [PATCH] Bug 1422 - NSR record contain stale vcaStatus after successful completion of day 2 fixed. Addressed review comments Change-Id: I2f5585ee48d4641136c6ac146bb10b3cf928b006 Signed-off-by: Priyadharshini G S Signed-off-by: ksaikiranr --- osm_lcm/ns.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/osm_lcm/ns.py b/osm_lcm/ns.py index fab078f..5b0b7b0 100644 --- a/osm_lcm/ns.py +++ b/osm_lcm/ns.py @@ -3607,16 +3607,19 @@ class NsLcm(LcmBase): ee_id, vca_type = self._look_for_deployed_vca(nsr_deployed["VCA"], member_vnf_index=vnf_index, vdu_id=vdu_id, vdu_count_index=vdu_count_index, ee_descriptor_id=ee_descriptor_id) - db_nslcmop_notif = {"collection": "nslcmops", - "filter": {"_id": nslcmop_id}, - "path": "admin.VCA"} + for vca_index, vca_deployed in enumerate(db_nsr['_admin']['deployed']['VCA']): + if vca_deployed.get("member-vnf-index") == vnf_index: + db_dict = {"collection": "nsrs", + "filter": {"_id": nsr_id}, + "path": "_admin.deployed.VCA.{}.".format(vca_index)} + break nslcmop_operation_state, detailed_status = await self._ns_execute_primitive( ee_id, primitive=primitive_name, primitive_params=self._map_primitive_params(config_primitive_desc, primitive_params, desc_params), timeout=timeout_ns_action, vca_type=vca_type, - db_dict=db_nslcmop_notif) + db_dict=db_dict) db_nslcmop_update["detailed-status"] = detailed_status error_description_nslcmop = detailed_status if nslcmop_operation_state == "FAILED" else "" -- 2.17.1