Make sure to strip any newlines off the name.

This commit is contained in:
Ralph Bean 2015-02-02 15:34:41 +00:00
parent 31c2f11411
commit 9671d2bb8c

View file

@ -141,7 +141,7 @@ class LogMech(object):
sanitize_host = host.replace(' ', '_').replace('>', '-')
fd = open(self.logpath_play + '/' + sanitize_host + '.log', 'a')
now = time.strftime(TIME_FORMAT, time.localtime())
fd.write(MSG_FORMAT % dict(now=now, name=name, count=count, category=category, data=json.dumps(data)))
fd.write(MSG_FORMAT % dict(now=now, name=name.strip(), count=count, category=category, data=json.dumps(data)))
fd.close()