2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-22 09:32:21 +00:00

Tolerate : without a space

E.g. grep does not space delimit.
This commit is contained in:
Jarrod Johnson 2020-07-10 08:53:57 -04:00
parent 4a23ca3db1
commit 1d596736f3

View File

@ -88,15 +88,18 @@ while fullline:
for line in fullline.split('\n'):
if not line:
continue
if ': ' not in line:
if ':' not in line:
line = 'UNKNOWN: ' + line
if options.log:
node, output = line.split(': ', 1)
node, output = line.split(':', 1)
output = output.lstrip()
currlog = options.log.format(node=node, nodename=node)
with open(currlog, mode='a') as log:
log.write(output + '\n')
continue
grouped.add_line(*line.split(': ', 1))
node, output = line.split(':', 1)
output = output.lstrip()
grouped.add_line(node, output)
if options.watch:
if not holdoff:
holdoff = os.times()[4] + 0.250