Commit 5a50beb6 authored by Ronny Bruska's avatar Ronny Bruska
Browse files

14118 FIX Notification spooler: Fix execution of notifications on sites only forwarding

CMK-10544

Change-Id: I04e70bf7f837954979d5417044891c1a7253d3ad
parent dd940bfe
Title: Notification spooler: Fix execution of notifications on sites only forwarding
Class: fix
Compatible: compat
Component: notifications
Date: 1652947508
Edition: cee
Knowledge: doc
Level: 1
State: unknown
Version: 2.2.0i1
On sites which had the option "Forward to remote site by notification spooler"
configured, the answer of the target site also lead to execution of of the
notification at this site, leading to duplicated notifications.
Furthermore, the result of the execution was not logged to history.
......@@ -7,7 +7,7 @@
import os
import subprocess
from logging import Logger
from typing import List, NewType, Optional
from typing import List, NewType, Optional, TypedDict
import cmk.utils.defines
from cmk.utils.exceptions import MKGeneralException
......@@ -25,6 +25,14 @@ NotificationPluginName = NewType("NotificationPluginName", str)
NotificationContext = NewType("NotificationContext", dict[str, str])
class NotificationResult(TypedDict, total=False):
plugin: NotificationPluginName
status: NotificationResultCode
output: List[str]
forward: bool
context: NotificationContext
def _state_for(exit_code: NotificationResultCode) -> str:
return cmk.utils.defines.service_state_name(exit_code, "UNKNOWN")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment