Werk #15624: mk_logwatch.py: Do Not Crash Upon Entering Invalid Option

Komponente Checks & agents
Titel mk_logwatch.py: Do Not Crash Upon Entering Invalid Option
Datum 06.06.2023
Level Kleine Änderung
Klasse Bugfix
Kompatibilität Kompatibel - benötigt kein manuelles Eingreifen
Checkmk versions & editions
2.3.0b1 Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk Cloud (CCE), Checkmk MSP (CME)
2.2.0p3 Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk Cloud (CCE), Checkmk MSP (CME)
2.1.0p30 Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk MSP (CME)
2.0.0p37 Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk MSP (CME)

Previously, if the user entered an invalid option into a configuration file for mk_logwatch.py, the plugin would crash with the traceback:

ValueError: Invalid overflow: 'c' (choose from dict_keys(['C', 'W', 'I', 'O']))

or similar. This would cause the output to be assigned to the wrong service, since no section header was produced. With this Werk, the traceback will only be shown, if the option --debug is used. This is analogous to what happens if the configuration file is missing.

Zur Liste aller Werks