Werk #13988: fileinfo: Fix crash for user-configured state in case of missing file

Component Checks & agents
Title fileinfo: Fix crash for user-configured state in case of missing file
Date May 31, 2022
Level Trivial Change
Class Bug Fix
Compatibility Compatible - no manual interaction needed
Checkmk versions & editions
2.2.0b1 Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk Cloud (CCE), Checkmk MSP (CME)
2.1.0p2 Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk MSP (CME)

The check plugin fileinfo reports UNKNOWN by default in case a file is missing. This behaviour is configurable via the option "State when file is missing" in the ruleset "Size and age of single files". However, if this option was used, the check plugin crashed with TypeError(f"'state' must be a checkmk State constant, got {state}") if the file was actually missing.

To the list of all Werks