Skip to content

Commit 86b25d1

Browse files
committed
Fix collecting data sources defined by dashboard variables
1 parent d4abbdf commit 86b25d1

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
@@ -7,6 +7,8 @@ in progress
77
===========
88
- Fixed 404 error on "dash-folder" type when enumerating dashboards.
99
Thanks, @oxy-star and @GarbageYard.
10+
- Fixed collecting data sources defined by dashboard variables. Thanks,
11+
@GrgDev, @cronosnull, and @nikodemas.
1012

1113
2025-03-18 0.23.0
1214
=================

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)