X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_mon%2Fcore%2Fcommon_db.py;h=8f2f552c6efef80eb429c1f69682e961f0b49f83;hb=628df021896fa8775f9743af62a4267b617cc35c;hp=7bd2491e51a5984f0b2467eb441f59c70096cb35;hpb=456d0f323cfcb5fe6b8cad5a6c3e6633875633cd;p=osm%2FMON.git diff --git a/osm_mon/core/common_db.py b/osm_mon/core/common_db.py index 7bd2491..8f2f552 100644 --- a/osm_mon/core/common_db.py +++ b/osm_mon/core/common_db.py @@ -61,9 +61,11 @@ class CommonDbClient: def get_vnfd_by_name(self, vnfd_name: str): # TODO: optimize way of getting single VNFD in shared enviroments (RBAC) - vnfd = self.common_db.get_list("vnfds", - {"name": vnfd_name})[0] - return vnfd + if self.common_db.get_list("vnfds", {"name": vnfd_name}): + vnfd = self.common_db.get_list("vnfds", {"name": vnfd_name})[0] + return vnfd + else: + return None def get_nsrs(self): return self.common_db.get_list('nsrs')