Skip to content

Commit c2c96a5

Browse files
committed
refactor(statuspal): improve import of flatdict
1 parent aaa21ed commit c2c96a5

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

check-plugins/statuspal/statuspal

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import argparse # pylint: disable=C0413
1515
import json # pylint: disable=C0413
1616
import sys # pylint: disable=C0413
17-
import flatdict # pylint: disable=C0413
1817

1918
import lib.args # pylint: disable=C0413
2019
import lib.base # pylint: disable=C0413
@@ -25,8 +24,15 @@ import lib.url # pylint: disable=C0413
2524
from lib.globals import (STATE_CRIT, STATE_OK, # pylint: disable=C0413
2625
STATE_UNKNOWN, STATE_WARN)
2726

27+
try:
28+
import flatdict # pylint: disable=C0413
29+
except ImportError as e:
30+
print('Python module "flatdict" is not installed.')
31+
sys.exit(STATE_UNKNOWN)
32+
33+
2834
__author__ = 'Linuxfabrik GmbH, Zurich/Switzerland'
29-
__version__ = '2025021501'
35+
__version__ = '2025030601'
3036

3137
DESCRIPTION = """Statuspal is a status page provider from Germany. This check plugin gets
3238
the summary of a Statuspal status page, checks its status, services,

0 commit comments

Comments
 (0)