From 225ee7ae5117e0590eee008eca823fab1da0f528 Mon Sep 17 00:00:00 2001 From: Nicolai Buchwitz Date: Thu, 13 Feb 2025 13:43:28 +0100 Subject: [PATCH] fix: Use default value for status_reboot if not present Signed-off-by: Nicolai Buchwitz --- check_opnsense.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check_opnsense.py b/check_opnsense.py index 376676a..7411cb9 100755 --- a/check_opnsense.py +++ b/check_opnsense.py @@ -216,7 +216,7 @@ def check_updates(self) -> None: data = self.request(url, method="post") has_update = data["status"] in ("update", "upgrade") - needs_reboot = data["status_reboot"] == "1" + needs_reboot = data.get("status_reboot", 0) == "1" if has_update: self.check_result = CheckState.WARNING