Kaynağa Gözat

Remove trailing colon on empty evalMatches

master
JustAnotherArchivist 3 yıl önce
ebeveyn
işleme
e4946a6b3c
1 değiştirilmiş dosya ile 1 ekleme ve 1 silme
  1. +1
    -1
      contrib/modules/grafana.py

+ 1
- 1
contrib/modules/grafana.py Dosyayı Görüntüle

@@ -3,7 +3,7 @@ import json

async def process(request):
obj = json.loads(await request.text())
evalMatchesStr = (': ' + ', '.join(f'{x["metric"]} = {x["value"]}' for x in obj['evalMatches'])) if 'evalMatches' in obj else ''
evalMatchesStr = (': ' + ', '.join(f'{x["metric"]} = {x["value"]}' for x in obj['evalMatches'])) if 'evalMatches' in obj and obj['evalMatches'] else ''
if 'message' in obj:
return f'{obj["title"]} - {obj["message"]}{evalMatchesStr}'
else:


Yükleniyor…
İptal
Kaydet