ソースを参照

Remove trailing colon on empty evalMatches

master
JustAnotherArchivist 3年前
コミット
e4946a6b3c
1個のファイルの変更1行の追加1行の削除
  1. +1
    -1
      contrib/modules/grafana.py

+ 1
- 1
contrib/modules/grafana.py ファイルの表示

@@ -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:


読み込み中…
キャンセル
保存