Avoid double-counting errors and ignore test runs

This commit is contained in:
James Howe 2019-01-21 15:02:40 +00:00 committed by James Howe
parent 6ca7deb268
commit d809b9bd9c

View file

@ -60,10 +60,10 @@ def returner(ret):
if type(ret['return']) is dict:
for state, item in six.iteritems(ret['return']):
if 'comment' in item and 'name' in item and not item['result']:
if 'comment' in item and 'name' in item and item['result'] is False:
errors = True
zabbix_send("salt.trap.high", 'SALT:\nname: {0}\ncomment: {1}'.format(item['name'], item['comment']))
if 'comment' in item and 'name' in item and item['changes']:
elif 'comment' in item and 'name' in item and item['changes']:
changes = True
zabbix_send("salt.trap.warning", 'SALT:\nname: {0}\ncomment: {1}'.format(item['name'], item['comment']))