merge upstream formatter for grafana_9x

This commit is contained in:
Alex Kelly 2022-11-29 22:09:11 -05:00
parent 6781f994f9
commit 6e05a2a3f9

View file

@ -0,0 +1,9 @@
def grafana_9x(data, headers):
"""Pretty-print a Grafana newer than v9.x notification."""
text = ""
if "title" in data:
text = "#### " + data["title"] + "\n"
if "message" in data:
text = text + data["message"].replace("\n", "\n\n") + "\n\n"
data["body"] = text
return data