Bug 2365 fixed: Modified time in vnfrs collection of mongo database is not updated...
[osm/LCM.git] / osm_lcm / ns.py
index 25ae038..43e699f 100644 (file)
@@ -7912,6 +7912,7 @@ class NsLcm(LcmBase):
             old_config_status = db_nsr["config-status"]
 
             db_nsr_update = {
+                "operational-status": "healing",
                 "_admin.deployed.RO.operational-status": "healing",
             }
             self.update_db_2("nsrs", nsr_id, db_nsr_update)
@@ -8057,7 +8058,6 @@ class NsLcm(LcmBase):
                                 task_instantiation_info=tasks_dict_info,
                                 stage=stage,
                             )
-
         except (
             ROclient.ROClientException,
             DbException,
@@ -8079,6 +8079,15 @@ class NsLcm(LcmBase):
             )
         finally:
             error_list = list()
+            if db_vnfrs_list and target_list:
+                for vnfrs in db_vnfrs_list:
+                    for vnf_instance in target_list:
+                        if vnfrs["_id"] == vnf_instance.get("vnfInstanceId"):
+                            self.db.set_list(
+                                "vnfrs",
+                                {"_id": vnfrs["_id"]},
+                                {"_admin.modified": time()},
+                            )
             if exc:
                 error_list.append(str(exc))
             try: