Skip to content

Commit

Permalink
17172 FIX Better log message for notification tests
Browse files Browse the repository at this point in the history
SUP-21533

Change-Id: Ia253753567986ed3db819d86d9fcddda30a489eb
  • Loading branch information
makanakoeln committed Nov 25, 2024
1 parent a766728 commit e9b1573
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
20 changes: 20 additions & 0 deletions .werks/17172.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[//]: # (werk v2)
# Better log message for notification tests

key | value
---------- | ---
date | 2024-11-22T08:27:23+00:00
version | 2.4.0b1
class | fix
edition | cre
component | notifications
level | 1
compatible | yes

If you enabled "Send out HTML/ASCII email notification according to
notification rules" in the "Test notifications" section and a rule with a
plug-in other than "HTML Email" or "ASCII Email" matched, the notify.log showed
something like "notifying USERNAME via ...".

As you can only send out HTML Email and ASCII Email notifications, the log will
now show "would notify cmkadmin via ...".
6 changes: 5 additions & 1 deletion cmk/base/notify.py
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,11 @@ def _process_notifications(
# Now do the actual notifications
logger.info("Executing %d notifications:", len(notifications))
for (contacts, plugin_name), (_locked, params, bulk) in sorted(notifications.items()):
verb = "would notify" if analyse and not dispatch else "notifying"
verb = (
"would notify"
if analyse and (not dispatch or plugin_name not in ["mail", "asciimail"])
else "notifying"
)
contactstxt = ", ".join(contacts)
plugintxt = plugin_name
# Hack for "Call with the following..." find a better solution
Expand Down

0 comments on commit e9b1573

Please sign in to comment.