Fixed error with empty triggers list

This commit is contained in:
asmikhailov 2016-01-19 12:33:13 +03:00
parent 86d876fd58
commit 0f23620336

View File

@ -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["default"] = "{0}:{a[5]}/{a[4]}/{a[3]}/{a[2]}/{a[1]}/{a[0]}".format(sum(alerts), a=alerts)
cdict["total"] = sum(alerts) cdict["total"] = sum(alerts)
if alerts_list:
color = alerts_color[max(map(int, alerts_list))] color = alerts_color[max(map(int, alerts_list))]
else:
color = alerts_color[0]
result = self.format.format(**cdict) result = self.format.format(**cdict)
except Exception as e: except Exception as e: