Commit a98f146d authored by Leo Iannacone's avatar Leo Iannacone

parse piuparts: back on readlines, more secure

parent 184b0a19
......@@ -213,15 +213,8 @@ class LogParser():
def parse_piuparts(self):
with open(self.file, 'r') as fd:
offs = -1024
while True:
fd.seek(offs, 2)
lines = fd.readlines()
if len(lines) > 1:
last_line = lines[-1]
break
offs *= 2
if last_line.find('ERROR:') >= 0:
lines = fd.readlines()
if len(lines) == 0 or lines[-1].find('ERROR:') >= 0:
return 'E'
return None
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment