From ec322276ddf84d15e8941134f5c7eb66486d4ae0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= <40151420+ldericher@users.noreply.github.com> Date: Sat, 2 Sep 2023 15:16:42 +0000 Subject: [PATCH] handle empty aggregate reports correctly --- .vscode/launch.json | 1 - kiwi_simple_metrics/metrics/_report.py | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 3049ac8..f018c2c 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -12,7 +12,6 @@ "env": { "METRIC__INTERVAL": "5", "METRIC__LOG__ENABLED": "True", - "METRIC__DISK__PATHS": "[\"/var\", \"/\", \"/dev\"]", "METRIC__EXTERNAL__EXECUTABLES": "[\"${workspaceFolder}/dummy-metric\"]", }, "justMyCode": true diff --git a/kiwi_simple_metrics/metrics/_report.py b/kiwi_simple_metrics/metrics/_report.py index e974ab1..5cf4044 100644 --- a/kiwi_simple_metrics/metrics/_report.py +++ b/kiwi_simple_metrics/metrics/_report.py @@ -102,6 +102,9 @@ class Report: reports = [data.report for data in get_data()] + if not reports: + return None + return cls( result=settings.report_outer.format( name=settings.name,