and we make logfile names suck less.

This commit is contained in:
Stephen Smoogen 2015-01-13 00:25:01 +00:00
parent a87f2b4325
commit ca66b2b7ab

View file

@ -138,7 +138,8 @@ class LogMech(object):
elif self.play_info.get('check', False):
category = 'CHECK:' + category
fd = open(self.logpath_play + '/' + host + '.log', 'a')
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.close()