Module: check_mk
Branch: master
Commit: 728f745e28644e975db4fb4f8c392d061f371d54
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=728f745e28644e…
Author: Tom Baerwinkel <tb(a)mathias-kettner.de>
Date: Wed Sep 13 18:10:49 2017 +0200
Fix notification cancelling when no notification is present
Change-Id: I753e09200be714200776ca355ada6027aab07b9c
---
cmk_base/notify.py | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/cmk_base/notify.py b/cmk_base/notify.py
index 692898e..bfe4073 100644
--- a/cmk_base/notify.py
+++ b/cmk_base/notify.py
@@ -447,13 +447,14 @@ def notify_rulebased(raw_context, analyse=False):
plugintxt = plugin or "plain email"
key = contacts, plugin
- if plugin_parameters is None and key in notifications: # cancelling
- locked, plugin_parameters, bulk = notifications[key]
- if locked and "contact" in rule:
- notify_log(" - cannot cancel notification of %s via %s: it is
locked" % (contactstxt, plugintxt))
- else:
- notify_log(" - cancelling notification of %s via %s" %
(contactstxt, plugintxt))
- del notifications[key]
+ if plugin_parameters is None: # cancelling
+ if key in notifications:
+ locked, plugin_parameters, bulk = notifications[key]
+ if locked and "contact" in rule:
+ notify_log(" - cannot cancel notification of %s via %s: it
is locked" % (contactstxt, plugintxt))
+ else:
+ notify_log(" - cancelling notification of %s via %s"
% (contactstxt, plugintxt))
+ del notifications[key]
elif contacts:
if key in notifications:
locked = notifications[key][0]