Bug 1133 fixed git add .
Change-Id: I08dc2c76b85b61212662680ad0d54af76a9c48a4
Signed-off-by: agarwalat <atul.agarwal@altran.com>
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 @@
{"_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 @@
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: