fix(mongodb): query now with filters to get just the VNFD referenced by the NSR....
[osm/MON.git] / osm_mon / dashboarder / service.py
index 0dd3d90..79cccb4 100644 (file)
@@ -27,7 +27,7 @@ from osm_mon.core.config import Config
 from osm_mon.core.keystone import KeystoneConnection
 from osm_mon.dashboarder.backends.grafana import GrafanaBackend
 from osm_mon import __path__ as mon_path
-from osm_mon.dashboarder.utils import find_in_list
+from osm_mon.core.utils import find_in_list, create_filter_from_nsr
 
 log = logging.getLogger(__name__)
 
@@ -91,7 +91,7 @@ class DashboarderService:
             vnfds_profiles = nsr['nsd']["df"][0]['vnf-profile']
             for vnf_profile in vnfds_profiles:
                 try:
-                    vnfd = self.common_db.get_vnfd_by_id(vnf_profile['vnfd-id'])
+                    vnfd = self.common_db.get_vnfd_by_id(vnf_profile['vnfd-id'], create_filter_from_nsr(nsr))
                     # If there are metrics, create dashboard (if exists)
                     vdu_found = find_in_list(vnfd["vdu"], lambda a_vdu: "monitoring-parameter" in a_vdu)
                     if vdu_found: