From: agarwalat Date: Fri, 10 Jul 2020 08:33:23 +0000 (+0000) Subject: Bug 1133 fixed git add . X-Git-Tag: release-v9.0-start~12 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F82%2F9382%2F2;p=osm%2FMON.git Bug 1133 fixed git add . Change-Id: I08dc2c76b85b61212662680ad0d54af76a9c48a4 Signed-off-by: agarwalat --- diff --git a/osm_mon/core/common_db.py b/osm_mon/core/common_db.py index f15ae97..983d84d 100644 --- a/osm_mon/core/common_db.py +++ b/osm_mon/core/common_db.py @@ -62,6 +62,11 @@ class CommonDbClient: {"_id": vnfd_id}) return vnfd + def get_vnfd_by_id(self, vnfd_id: str): + vnfd = self.common_db.get_one("vnfds", + {"id": vnfd_id}) + return vnfd + def get_vnfd_by_name(self, vnfd_name: str): # TODO: optimize way of getting single VNFD in shared enviroments (RBAC) if self.common_db.get_list("vnfds", {"name": vnfd_name}): diff --git a/osm_mon/dashboarder/service.py b/osm_mon/dashboarder/service.py index 9f184d2..14ea0b9 100644 --- a/osm_mon/dashboarder/service.py +++ b/osm_mon/dashboarder/service.py @@ -69,7 +69,7 @@ class DashboarderService: constituent_vnfds = nsr['nsd']['constituent-vnfd'] for constituent_vnfd in constituent_vnfds: try: - vnfd = self.common_db.get_vnfd_by_name(constituent_vnfd['vnfd-id-ref']) + vnfd = self.common_db.get_vnfd_by_id(constituent_vnfd['vnfd-id-ref']) # If there are metrics, create dashboard (if exists) if 'monitoring-param' in vnfd: if nsr_id not in dashboard_uids: