From e2ba8e20ee24cb52dc35981848db788a86596d2b Mon Sep 17 00:00:00 2001 From: Yannik Schmidt Date: Thu, 10 Aug 2023 19:20:41 +0200 Subject: [PATCH] fix: show notification comment in message --- messagetools.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/messagetools.py b/messagetools.py index 19525c3..527f8a4 100644 --- a/messagetools.py +++ b/messagetools.py @@ -20,7 +20,12 @@ def make_icinga_message(struct): groups_strings = [ g + "-group" for g in groups ] fourth_line = "Notification to: " + ", ".join(owners) + " " + ", ".join(groups_strings) - return "\n".join([first_line, second_line, fourth_line]) + if struct.get("comment"): + fith_line = "Extra Comment: \n{}".format(struct.get("comment")) + return "\n".join([first_line, second_line, fourth_line, fith_line]) + else: + return "\n".join([first_line, second_line, fourth_line]) + def make_generic_message(struct): pass