added missing atexit logout for zabbix_host module (#63785)

This commit is contained in:
Dusan Matejka 2019-11-12 14:28:08 +01:00 committed by ansibot
parent 94e98d5369
commit 9dc94b32d2

View file

@ -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)