1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

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.
This commit is contained in:
jralbert 2017-03-16 10:38:55 -07:00 committed by Matt Davis
parent f7c83ccdc0
commit 5334814396

View file

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