aboutsummaryrefslogtreecommitdiff
path: root/py
diff options
context:
space:
mode:
authorMagnus Granberg <zorry@gentoo.org>2023-06-10 12:04:53 +0200
committerMagnus Granberg <zorry@gentoo.org>2023-06-10 12:04:53 +0200
commitb5356f7674336d08ecbbe6a27602d12bb2beea5e (patch)
tree679e54358867990e073e2b5fae0791481df33016 /py
parentAdd support for SetupBugReportSteps and compression with xz (diff)
downloadtinderbox-cluster-b5356f7674336d08ecbbe6a27602d12bb2beea5e.tar.gz
tinderbox-cluster-b5356f7674336d08ecbbe6a27602d12bb2beea5e.tar.bz2
tinderbox-cluster-b5356f7674336d08ecbbe6a27602d12bb2beea5e.zip
Compression logs with xz
Signed-off-by: Magnus Granberg <zorry@gentoo.org>
Diffstat (limited to 'py')
-rw-r--r--py/log_parser.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/py/log_parser.py b/py/log_parser.py
index f5c4eb5..eb081a9 100644
--- a/py/log_parser.py
+++ b/py/log_parser.py
@@ -5,7 +5,6 @@ import sys
from multiprocessing import Pool, cpu_count
import re
import io
-import gzip
import json
import os
from sqlalchemy.ext.declarative import declarative_base
@@ -138,9 +137,13 @@ def runLogParser(args):
log_search_pattern = get_log_search_pattern(Session, args.uuid, config['default_uuid'])
Session.close()
# read the log file to dict
- for text_line in io.TextIOWrapper(io.BufferedReader(gzip.open(args.file)), encoding='utf8', errors='ignore'):
- logfile_text_dict[index] = text_line.strip('\n')
- index = index + 1
+ with open(args.file, encoding='utf8', errors='ignore') as f:
+ for text_line in f:
+ logfile_text_dict[index] = text_line.strip('\n')
+ index = index + 1
+ #for text_line in io.TextIOWrapper(io.BufferedReader(open(args.file)), encoding='utf8', errors='ignore'):
+ # logfile_text_dict[index] = text_line.strip('\n')
+ # index = index + 1
# run the search parse pattern on the text lines
#params = [(log_search_pattern, text, line_index,) for line_index, text in logfile_text_dict.items()]
with getMultiprocessingPool(config) as pool: