From 9dc94b32d2945f6354d4c95d3070b273e677a677 Mon Sep 17 00:00:00 2001 From: Dusan Matejka Date: Tue, 12 Nov 2019 14:28:08 +0100 Subject: [PATCH] added missing atexit logout for zabbix_host module (#63785) --- lib/ansible/modules/monitoring/zabbix/zabbix_host.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/ansible/modules/monitoring/zabbix/zabbix_host.py b/lib/ansible/modules/monitoring/zabbix/zabbix_host.py index bfee73f6a5..0454591bb0 100644 --- a/lib/ansible/modules/monitoring/zabbix/zabbix_host.py +++ b/lib/ansible/modules/monitoring/zabbix/zabbix_host.py @@ -742,6 +742,7 @@ def main(): zbx = ZabbixAPI(server_url, timeout=timeout, user=http_login_user, passwd=http_login_password, validate_certs=validate_certs) zbx.login(login_user, login_password) + atexit.register(zbx.logout) except Exception as e: module.fail_json(msg="Failed to connect to Zabbix server: %s" % e)