- _filter = self._get_project_filter(session, write=False, show_all=False)
- _filter["_id"] = _id
- nst = self.db.get_one("nsts", _filter)
-
- # Search NSIs using NST via nst-ref
- _filter = self._get_project_filter(session, write=False, show_all=False)
- _filter["nst-ref"] = nst["id"]
- nsis_list = self.db.get_list("nsis", _filter)
- for nsi_item in nsis_list:
- if nsi_item["_admin"].get("nsiState") != "TERMINATED":
- raise EngineException("There is some NSIS that depends on this NST", http_code=HTTPStatus.CONFLICT)
+ _filter = self._get_project_filter(session)
+ _filter["_admin.nst-id"] = _id
+ if self.db.get_list("nsis", _filter):
+ raise EngineException("there is at least one Netslice Instance using this descriptor",
+ http_code=HTTPStatus.CONFLICT)