From 907a83c471bb7befdb183b6eecb7623a7466d6e6 Mon Sep 17 00:00:00 2001 From: Scott McGillivray Date: Thu, 3 Jan 2019 14:23:53 +0800 Subject: [PATCH] Update zabbix.py As seen here https://www.zabbix.com/documentation/current/manual/api/reference/configuration/import Return values (boolean) Returns *true* if importing has been successful. Updated module to avoid 'Exception: object of type 'bool' has no len()' error. --- salt/modules/zabbix.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/modules/zabbix.py b/salt/modules/zabbix.py index fe8d523fca29..7e7a4804b81d 100644 --- a/salt/modules/zabbix.py +++ b/salt/modules/zabbix.py @@ -2426,7 +2426,7 @@ def run_query(method, params, **kwargs): 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 + return ret['result'] if (ret['result'] == True or len(ret['result']) > 0) else False else: raise KeyError except KeyError: