From 12294d4a909ed51a54900feecc36c8f86e46bef2 Mon Sep 17 00:00:00 2001 From: soonann Date: Tue, 28 Jan 2025 15:15:47 +0800 Subject: [PATCH] fix: variable datasources shown as missing datasource --- grafana_wtf/core.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/grafana_wtf/core.py b/grafana_wtf/core.py index 941f023..131f64e 100644 --- a/grafana_wtf/core.py +++ b/grafana_wtf/core.py @@ -663,10 +663,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_name in values: - datasource = self.datasource_by_name.get(ds_name) + for ds_uid in values: + datasource = self.datasource_by_uid.get(ds_uid) if datasource is None: - log.warning(f"Data source '{ds_name}' not found") + log.warning(f"Data source '{ds_uid}' not found") continue ds = dict( type=datasource.get("type"),