+ async def _wait_dependent_n2vc(self, nsr_id, vca_deployed_list, vca_index):
+ """
+ Wait until dependent VCA deployments have been finished. NS wait for VNFs and VDUs. VNFs for VDUs
+ """
+ my_vca = vca_deployed_list[vca_index]
+ if my_vca.get("vdu_id") or my_vca.get("kdu_name"):
+ return
+ timeout = 300
+ while timeout >= 0:
+ for index, vca_deployed in enumerate(vca_deployed_list):
+ if index == vca_index:
+ continue
+ if not my_vca.get("member-vnf-index") or \
+ (vca_deployed.get("member-vnf-index") == my_vca.get("member-vnf-index")):
+ if not vca_deployed.get("instantiation"):
+ break # wait
+ if vca_deployed["instantiation"] == "FAILED":
+ raise LcmException("Configuration aborted because dependent charm/s has failed")
+ else:
+ return
+ await asyncio.sleep(10)
+ timeout -= 1
+ db_nsr = self.db.get_one("nsrs", {"_id": nsr_id})
+ vca_deployed_list = db_nsr["_admin"]["deployed"]["VCA"]
+
+ raise LcmException("Configuration aborted because dependent charm/s timeout")
+