Bug 1133 fixed git add . 82/9382/2
authoragarwalat <atul.agarwal@altran.com>
Fri, 10 Jul 2020 08:33:23 +0000 (08:33 +0000)
committerpalsus <subhankar.pal@altran.com>
Thu, 8 Oct 2020 06:31:56 +0000 (08:31 +0200)
Change-Id: I08dc2c76b85b61212662680ad0d54af76a9c48a4
Signed-off-by: agarwalat <atul.agarwal@altran.com>
osm_mon/core/common_db.py
osm_mon/dashboarder/service.py

index f15ae97..983d84d 100644 (file)
@@ -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}):
index 9f184d2..14ea0b9 100644 (file)
@@ -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: