From 533481439602ab5814773b03329cc7f78e595fec Mon Sep 17 00:00:00 2001 From: jralbert Date: Thu, 16 Mar 2017 10:38:55 -0700 Subject: [PATCH] Cast syslogport value from getenv as int (#22664) SysLogHandler requires an int for port, but getenv produces a string. Cast return from getenv as int to overcome this mismatch. --- lib/ansible/plugins/callback/syslog_json.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/plugins/callback/syslog_json.py b/lib/ansible/plugins/callback/syslog_json.py index 2d67c09d16b..7a533860642 100644 --- a/lib/ansible/plugins/callback/syslog_json.py +++ b/lib/ansible/plugins/callback/syslog_json.py @@ -38,7 +38,7 @@ class CallbackModule(CallbackBase): self.handler = logging.handlers.SysLogHandler( address = (os.getenv('SYSLOG_SERVER','localhost'), - os.getenv('SYSLOG_PORT',514)), + int(os.getenv('SYSLOG_PORT',514))), facility= os.getenv('SYSLOG_FACILITY',logging.handlers.SysLogHandler.LOG_USER) ) self.logger.addHandler(self.handler)