From da668dca56e966ec2e4b4c1594c64b7fcd65fdcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20Mart=C3=ADn?= Date: Fri, 19 Feb 2016 20:01:08 +0100 Subject: [PATCH] Replace deprecated zabbix api method 'exists' to support zabbix 3.0 --- lib/ansible/modules/extras/monitoring/zabbix_host.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/extras/monitoring/zabbix_host.py b/lib/ansible/modules/extras/monitoring/zabbix_host.py index 02209f4995..fd8af087eb 100644 --- a/lib/ansible/modules/extras/monitoring/zabbix_host.py +++ b/lib/ansible/modules/extras/monitoring/zabbix_host.py @@ -159,13 +159,13 @@ class Host(object): # exist host def is_host_exist(self, host_name): - result = self._zapi.host.exists({'host': host_name}) + result = self._zapi.host.get({'filter': {'host': host_name}}) return result # check if host group exists def check_host_group_exist(self, group_names): for group_name in group_names: - result = self._zapi.hostgroup.exists({'name': group_name}) + result = self._zapi.hostgroup.get({'filter': {'name': group_name}}) if not result: self._module.fail_json(msg="Hostgroup not found: %s" % group_name) return True