Merge pull request #396 from asmikhailov/master
Fixed error with empty list
This commit is contained in:
commit
f3ffb96a17
@ -55,7 +55,10 @@ class Zabbix(IntervalModule):
|
||||
|
||||
cdict["default"] = "{0}:{a[5]}/{a[4]}/{a[3]}/{a[2]}/{a[1]}/{a[0]}".format(sum(alerts), a=alerts)
|
||||
cdict["total"] = sum(alerts)
|
||||
color = alerts_color[max(map(int, alerts_list))]
|
||||
if alerts_list:
|
||||
color = alerts_color[max(map(int, alerts_list))]
|
||||
else:
|
||||
color = alerts_color[0]
|
||||
result = self.format.format(**cdict)
|
||||
|
||||
except Exception as e:
|
||||
|
Loading…
Reference in New Issue
Block a user