diff --git a/CHANGES.rst b/CHANGES.rst index bf93aa1..5dceb71 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -7,6 +7,8 @@ in progress =========== - Fixed 404 error on "dash-folder" type when enumerating dashboards. Thanks, @oxy-star and @GarbageYard. +- Fixed collecting data sources defined by dashboard variables. Thanks, + @GrgDev, @cronosnull, and @nikodemas. 2025-03-18 0.23.0 ================= diff --git a/grafana_wtf/core.py b/grafana_wtf/core.py index 2aa804b..47389c7 100644 --- a/grafana_wtf/core.py +++ b/grafana_wtf/core.py @@ -715,10 +715,10 @@ def add(item): # Datasources defined as variables. if "type" in node and node["type"] == "datasource": values = to_list(node.get("current", {}).get("value")) - for ds_uid in values: - datasource = self.datasource_by_uid.get(ds_uid) + for ds_name in values: + datasource = self.datasource_by_name.get(ds_name) if datasource is None: - log.warning(f"Data source '{ds_uid}' not found") + log.warning(f"Data source '{ds_name}' not found") continue ds = dict( type=datasource.get("type"),