Skip to content

Commit

Permalink
Fixed version compatibility for zabbix 7.0 proxy get by name
Browse files Browse the repository at this point in the history
  • Loading branch information
miksonx committed Sep 3, 2024
1 parent b5c237f commit d4c7f0a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion plugins/modules/zabbix_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -1013,9 +1013,13 @@ def get_proxy_by_proxy_name(self, proxy_name):
"""
try:
if LooseVersion(self._zbx_api_version) >= LooseVersion('7.0'):
filter = {'name': [proxy_name]}

Check warning on line 1017 in plugins/modules/zabbix_action.py

View check run for this annotation

Codecov / codecov/patch

plugins/modules/zabbix_action.py#L1017

Added line #L1017 was not covered by tests
else:
filter = {'host': [proxy_name]}

Check warning on line 1019 in plugins/modules/zabbix_action.py

View check run for this annotation

Codecov / codecov/patch

plugins/modules/zabbix_action.py#L1019

Added line #L1019 was not covered by tests
proxy_list = self._zapi.proxy.get({
"output": "extend",
"filter": {"host": [proxy_name]}
"filter": filter,
})
if len(proxy_list) < 1:
self._module.fail_json(msg="Proxy not found: %s" % proxy_name)
Expand Down

0 comments on commit d4c7f0a

Please sign in to comment.