Skip to content

Commit 5311c45

Browse files
committed
Fix 404 error on "dash-folder" type when enumerating dashboards
1 parent 8d7f9ed commit 5311c45

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

CHANGES.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ grafana-wtf changelog
55

66
in progress
77
===========
8+
- Fixed 404 error on "dash-folder" type when enumerating dashboards.
9+
Thanks, @oxy-star and @GarbageYard.
810

911
2025-03-18 0.23.0
1012
=================

grafana_wtf/core.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,8 @@ def fetch_dashboards(self):
260260
log.info("Fetching dashboards one by one")
261261
results = self.data.dashboard_list
262262
for dashboard_info in results:
263+
if dashboard_info.get("type") == "dash-folder":
264+
continue
263265
self.fetch_dashboard(dashboard_info)
264266

265267
def fetch_dashboards_parallel(self):

tests/test_commands.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ def test_log_all(ldi_resources, capsys, caplog):
313313
# Verify output.
314314
assert "Aggregating edit history for multiple Grafana dashboards" in caplog.text
315315
history = json.loads(captured.out)
316-
assert len(history) == 3
316+
assert len(history) == 2
317317

318318

319319
def test_log_json_success(ldi_resources, capsys, caplog):
@@ -400,7 +400,7 @@ def test_log_yaml_success(ldi_resources, capsys, caplog):
400400

401401
data = yaml.safe_load(captured.out)
402402

403-
assert len(data) == 3
403+
assert len(data) == 2
404404

405405

406406
def test_log_filter_sql(ldi_resources, capsys, caplog):
@@ -429,7 +429,6 @@ def test_log_filter_sql(ldi_resources, capsys, caplog):
429429
assert set(captured.out.strip().split("\n")) == {
430430
"- url: http://localhost:33333/d/ioUrPwQiz/luftdaten-info-generic-trend-v27",
431431
"- url: http://localhost:33333/d/jpVsQxRja/luftdaten-info-generic-trend-v33",
432-
"- url: http://localhost:33333/dashboards/f/testdrive/testdrive",
433432
}
434433

435434

0 commit comments

Comments
 (0)