From 2810e6542a776db97aff18b9196e034f1546bfab Mon Sep 17 00:00:00 2001 From: Eike Frost Date: Mon, 29 Feb 2016 22:58:23 +0000 Subject: [PATCH] Replace deprecated exists API for Zabbix 3.0 compatibility --- monitoring/zabbix_group.py | 2 +- monitoring/zabbix_hostmacro.py | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/monitoring/zabbix_group.py b/monitoring/zabbix_group.py index 730f791190d..4fc9631af9c 100644 --- a/monitoring/zabbix_group.py +++ b/monitoring/zabbix_group.py @@ -114,7 +114,7 @@ class HostGroup(object): try: group_add_list = [] 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: try: if self._module.check_mode: diff --git a/monitoring/zabbix_hostmacro.py b/monitoring/zabbix_hostmacro.py index 7895d8855cf..59193e257c4 100644 --- a/monitoring/zabbix_hostmacro.py +++ b/monitoring/zabbix_hostmacro.py @@ -108,11 +108,6 @@ class HostMacro(object): self._module = module self._zapi = zbx - # exist host - def is_host_exist(self, host_name): - result = self._zapi.host.exists({'host': host_name}) - return result - # get host id by host name def get_host_id(self, host_name): try: