Don't include trailing \n or <br/> if summary is missing
This commit is contained in:
parent
c24d9d6953
commit
e1893769da
1 changed files with 8 additions and 3 deletions
11
bot.py
11
bot.py
|
@ -27,8 +27,10 @@ TEMPLATE_TEXT = (
|
|||
"{% elif labels.severity == 'warning' %}"
|
||||
"ATTENTION "
|
||||
"{% endif %}"
|
||||
"{{ labels.alertname }} {{ labels.instance }}\n"
|
||||
"{{ annotations.summary }}"
|
||||
"{{ labels.alertname }} {{ labels.instance }}"
|
||||
"{% if annotations.summary %}"
|
||||
"\n{{ annotations.summary }}"
|
||||
"{% endif %}"
|
||||
)
|
||||
|
||||
TEMPLATE_HTML = (
|
||||
|
@ -40,8 +42,11 @@ TEMPLATE_HTML = (
|
|||
"<b><font color='orange'>ATTENTION</font></b> "
|
||||
"{% endif %}"
|
||||
"<b>{{ labels.alertname }}</b> "
|
||||
"{{ labels.instance }}<br/>"
|
||||
"{{ labels.instance }}"
|
||||
"{% if annotations.summary %}"
|
||||
"<br/>"
|
||||
"<blockquote>{{ annotations.summary }}</blockquote>"
|
||||
"{% endif %}"
|
||||
)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue