added missing atexit logout for zabbix_host module (#63785)

pull/63911/head
Dusan Matejka 5 years ago committed by ansibot
parent 94e98d5369
commit 9dc94b32d2

@ -742,6 +742,7 @@ def main():
zbx = ZabbixAPI(server_url, timeout=timeout, user=http_login_user, passwd=http_login_password, zbx = ZabbixAPI(server_url, timeout=timeout, user=http_login_user, passwd=http_login_password,
validate_certs=validate_certs) validate_certs=validate_certs)
zbx.login(login_user, login_password) zbx.login(login_user, login_password)
atexit.register(zbx.logout)
except Exception as e: except Exception as e:
module.fail_json(msg="Failed to connect to Zabbix server: %s" % e) module.fail_json(msg="Failed to connect to Zabbix server: %s" % e)

Loading…
Cancel
Save