fix 1073 obtain nsd from database, not from nsr[nsd] 55/9055/1
authortierno <alfonso.tiernosepulveda@telefonica.com>
Thu, 21 May 2020 13:18:23 +0000 (13:18 +0000)
committertierno <alfonso.tiernosepulveda@telefonica.com>
Tue, 9 Jun 2020 07:42:31 +0000 (07:42 +0000)
Change-Id: I2846a215d6144743ec7e52b81921ea1b557cc0fa
Signed-off-by: tierno <alfonso.tiernosepulveda@telefonica.com>
osm_lcm/ns.py

index 5d780d9..0a70367 100644 (file)
@@ -1605,8 +1605,9 @@ class NsLcm(LcmBase):
             # read from db: ns
             stage[1] = "Getting nsr={} from db".format(nsr_id)
             db_nsr = self.db.get_one("nsrs", {"_id": nsr_id})
-            # nsd is replicated into ns (no db read)
-            nsd = db_nsr["nsd"]
+            stage[1] = "Getting nsd={} from db".format(db_nsr["nsd-id"])
+            nsd = self.db.get_one("nsds", {"_id": db_nsr["nsd-id"]})
+            db_nsr["nsd"] = nsd
             # nsr_name = db_nsr["name"]   # TODO short-name??
 
             # read from db: vnf's of this ns