Skip to content

Commit

Permalink
Merge pull request Checkmk#564 from Mik3yZ/devel
Browse files Browse the repository at this point in the history
Change logic in rule.py irt conditions being overwritten
  • Loading branch information
robin-checkmk authored Feb 21, 2024
2 parents 12f8f94 + ebbc087 commit ff80cdf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changelogs/fragments/fix_rule_conditions_missing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- Rule module - Fix empty rule conditions.
2 changes: 1 addition & 1 deletion plugins/modules/rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ def run_module():
if not rule.get("value_raw"):
exit_failed(module, "Rule value_raw is required")
# Default to all hosts if conditions arent given
if rule.get("conditions"):
if not rule.get("conditions"):
rule["conditions"] = {
"host_tags": [],
"host_labels": [],
Expand Down

0 comments on commit ff80cdf

Please sign in to comment.