Skip to content

Commit

Permalink
Merge pull request #55706 from dwoz/zabbix-exceptiono
Browse files Browse the repository at this point in the history
Update zabbix module to avoid exception
  • Loading branch information
dwoz authored Dec 23, 2019
2 parents a764150 + 37385c2 commit 091cbbd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion salt/modules/zabbix.py
Original file line number Diff line number Diff line change
Expand Up @@ -2426,7 +2426,10 @@ def run_query(method, params, **connection_args):
ret = _query(method, params, conn_args['url'], conn_args['auth'])
if isinstance(ret['result'], bool):
return ret['result']
return ret['result'] if len(ret['result']) > 0 else False
if ret['result'] is True or len(ret['result']) > 0:
return ret['result']
else:
return False
else:
raise KeyError
except KeyError:
Expand Down

0 comments on commit 091cbbd

Please sign in to comment.