Merge pull request #1763 from eikef/zabbix30apiexistsremoval
Replace deprecated exists API for Zabbix 3.0 compatibility
This commit is contained in:
commit
eb9e57407e
2 changed files with 1 additions and 6 deletions
|
@ -114,7 +114,7 @@ class HostGroup(object):
|
||||||
try:
|
try:
|
||||||
group_add_list = []
|
group_add_list = []
|
||||||
for group_name in 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:
|
if not result:
|
||||||
try:
|
try:
|
||||||
if self._module.check_mode:
|
if self._module.check_mode:
|
||||||
|
|
|
@ -108,11 +108,6 @@ class HostMacro(object):
|
||||||
self._module = module
|
self._module = module
|
||||||
self._zapi = zbx
|
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
|
# get host id by host name
|
||||||
def get_host_id(self, host_name):
|
def get_host_id(self, host_name):
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Add table
Reference in a new issue