fix(FS): sync problems fixed syncing only the particular NSD and VNFD that the instan... 78/10478/2
authorbravof <fbravo@whitestack.com>
Thu, 11 Mar 2021 15:03:30 +0000 (12:03 -0300)
committerbravof <fbravo@whitestack.com>
Thu, 6 May 2021 21:56:43 +0000 (23:56 +0200)
Change-Id: I7410f6f39aa58a57ab91410c45dc7d7042b0293d
Signed-off-by: bravof <fbravo@whitestack.com>
osm_lcm/ns.py

index 443a09e..6b82da9 100644 (file)
@@ -1696,9 +1696,6 @@ class NsLcm(LcmBase):
             # wait for any previous tasks in process
             await self.lcm_tasks.waitfor_related_HA('ns', 'nslcmops', nslcmop_id)
 
-            stage[1] = "Sync filesystem from database."
-            self.fs.sync()  # TODO, make use of partial sync, only for the needed packages
-
             # STEP 0: Reading database (nslcmops, nsrs, nsds, vnfrs, vnfds)
             stage[1] = "Reading from database."
             # nsState="BUILDING", currentOperation="INSTANTIATING", currentOperationID=nslcmop_id
@@ -1731,6 +1728,7 @@ class NsLcm(LcmBase):
             db_nsr = self.db.get_one("nsrs", {"_id": nsr_id})
             stage[1] = "Getting nsd={} from db.".format(db_nsr["nsd-id"])
             nsd = self.db.get_one("nsds", {"_id": db_nsr["nsd-id"]})
+            self.fs.sync(db_nsr["nsd-id"])
             db_nsr["nsd"] = nsd
             # nsr_name = db_nsr["name"]   # TODO short-name??
 
@@ -1747,6 +1745,7 @@ class NsLcm(LcmBase):
                 db_vnfrs[vnfr["member-vnf-index-ref"]] = vnfr
                 vnfd_id = vnfr["vnfd-id"]
                 vnfd_ref = vnfr["vnfd-ref"]
+                self.fs.sync(vnfd_id)
 
                 # if we haven't this vnfd, read it from db
                 if vnfd_id not in db_vnfds: