Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .werks/20201.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[//]: # (werk v3)
# Fix crash when editing rules with predefined conditions whose ID contains hyphens

key | value
---------- | ---
date | 2026-07-13T00:00:00+00:00
version | 3.0.0b1
class | fix
edition | community
component | wato
level | 1
compatible | yes

Previously, opening or editing a rule that referenced a predefined condition whose unique ID
contained a hyphen (e.g. `cond_host_monitoring-01`) caused a crash with the error:

_ValueError: 'cond_host_monitoring-01' is not a valid, non-reserved Python identifier_

This affected predefined conditions created in Checkmk 2.4 or earlier that used hyphens in
their ID. The issue only appeared in the rule editor — the conditions themselves still matched
correctly at runtime.
4 changes: 2 additions & 2 deletions cmk/gui/watolib/rulesets.py
Original file line number Diff line number Diff line change
Expand Up @@ -2452,10 +2452,10 @@ def _create_rule_conditions_catalog_topic(
CascadingSingleChoiceElementAPI(
name="predefined",
title=Title("Predefined conditions"),
parameter_form=SingleChoiceAPI(
parameter_form=SingleChoiceExtendedAPI(
title=Title("Predefined condition"),
elements=[
SingleChoiceElementAPI(
SingleChoiceElementExtendedAPI(
name=n, title=Title("%(title)s") % {"title": t}
)
for n, t in PredefinedConditionStore().choices()
Expand Down
Loading