Bug 1422 - NSR record contain stale vcaStatus after successful completion of day... 86/10486/2 ELCM
authorksaikiranr <saikiran.k@tataelxsi.co.in>
Mon, 15 Mar 2021 05:37:29 +0000 (11:07 +0530)
committerbravof <fbravo@whitestack.com>
Fri, 26 Mar 2021 13:48:03 +0000 (14:48 +0100)
Addressed review comments

Change-Id: I2f5585ee48d4641136c6ac146bb10b3cf928b006
Signed-off-by: Priyadharshini G S <priyadharshini.g@tataelxsi.co.in>
Signed-off-by: ksaikiranr <saikiran.k@tataelxsi.co.in>
osm_lcm/ns.py

index fab078f..5b0b7b0 100644 (file)
@@ -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 ""