From 4b6428e387a5374003f369dca19185248e71558d Mon Sep 17 00:00:00 2001 From: agarwalat Date: Fri, 10 Jul 2020 08:33:23 +0000 Subject: [PATCH] Bug 1133 fixed git add . Change-Id: I08dc2c76b85b61212662680ad0d54af76a9c48a4 Signed-off-by: agarwalat --- osm_mon/core/common_db.py | 5 +++++ osm_mon/dashboarder/service.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) 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: -- 2.25.1