Skip to content

Commit f2c9049

Browse files
committed
Fix collecting data sources defined by dashboard variables
1 parent 8a0a9df commit f2c9049

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

CHANGES.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ in progress
1010
=================
1111
- Fixed 404 error on "dash-folder" type when enumerating dashboards.
1212
Thanks, @oxy-star and @GarbageYard.
13+
- Fixed collecting data sources defined by dashboard variables. Thanks,
14+
@GrgDev, @cronosnull, and @nikodemas.
1315

1416
2025-03-18 0.23.0
1517
=================

grafana_wtf/core.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -715,10 +715,10 @@ def add(item):
715715
# Datasources defined as variables.
716716
if "type" in node and node["type"] == "datasource":
717717
values = to_list(node.get("current", {}).get("value"))
718-
for ds_uid in values:
719-
datasource = self.datasource_by_uid.get(ds_uid)
718+
for ds_name in values:
719+
datasource = self.datasource_by_name.get(ds_name)
720720
if datasource is None:
721-
log.warning(f"Data source '{ds_uid}' not found")
721+
log.warning(f"Data source '{ds_name}' not found")
722722
continue
723723
ds = dict(
724724
type=datasource.get("type"),

0 commit comments

Comments
 (0)