From 602562e1a56e72ee6ac463a22caba990917f62ea Mon Sep 17 00:00:00 2001 From: Thorsten Spille Date: Wed, 19 Jan 2022 18:19:09 +0100 Subject: [PATCH] Update opnsense_checkmk_agent.py --- opnsense_checkmk_agent.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/opnsense_checkmk_agent.py b/opnsense_checkmk_agent.py index 73bc298..241f8ee 100644 --- a/opnsense_checkmk_agent.py +++ b/opnsense_checkmk_agent.py @@ -167,7 +167,10 @@ class checkmk_checker(object): _ret = filter(lambda x: x.get("common_name") == cn and x.get("caref") == caref,self._certificate_store.values()) else: _ret = filter(lambda x: x.get("common_name") == cn,self._certificate_store.values()) - return next(_ret) if _ret else {} + try: + return next(_ret) + except StopIteration: + return {} def get_opnsense_interfaces(self): _ifs = {}