Skip to content

Commit

Permalink
Update rule.py
Browse files Browse the repository at this point in the history
rule.py always overwrites rule["conditions"] when conditions are given, and doesn't fill it with an empty dict when no conditions are given
  • Loading branch information
Mik3yZ authored Feb 20, 2024
1 parent 12f8f94 commit ad44786
Showing 1 changed file with 1 addition and 1 deletion.
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 ad44786

Please sign in to comment.