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 6, 2024
1 parent b5c237f commit 89e3901
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- zabbix_actions - fix proxy get compatibility for zabbix 7.0
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]}
else:
filter = {'host': [proxy_name]}
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 89e3901

Please sign in to comment.