1 |
commit: c6162bc10dd6f86d170b31c1a33932d96dd5360b |
2 |
Author: Magnus Granberg <zorry <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Jan 24 00:49:01 2022 +0000 |
4 |
Commit: Magnus Granberg <zorry <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Jan 24 00:49:01 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/tinderbox-cluster.git/commit/?id=c6162bc1 |
7 |
|
8 |
disable some small checks like ('./\w+/') |
9 |
|
10 |
Signed-off-by: Magnus Granberg <zorry <AT> gentoo.org> |
11 |
|
12 |
buildbot_gentoo_ci/logs/log_parser.py | 19 +++++++++---------- |
13 |
1 file changed, 9 insertions(+), 10 deletions(-) |
14 |
|
15 |
diff --git a/buildbot_gentoo_ci/logs/log_parser.py b/buildbot_gentoo_ci/logs/log_parser.py |
16 |
index 11faf48..7531532 100644 |
17 |
--- a/buildbot_gentoo_ci/logs/log_parser.py |
18 |
+++ b/buildbot_gentoo_ci/logs/log_parser.py |
19 |
@@ -75,8 +75,8 @@ def search_buildlog(log_search_pattern_list, logfile_text_dict, tmp_index, max_t |
20 |
#FIXME take the ignore line pattern from db |
21 |
if text_line.startswith('>>> /'): |
22 |
pass |
23 |
- if else re.search('./\w+/'): |
24 |
- pass |
25 |
+ #if else re.search('./\w+/'): |
26 |
+ # pass |
27 |
else: |
28 |
# search for match |
29 |
if search_pattern['search_type'] == 'in': |
30 |
@@ -137,7 +137,7 @@ def search_buildlog(log_search_pattern_list, logfile_text_dict, tmp_index, max_t |
31 |
else: |
32 |
# we add all line that start with ' * ' as info |
33 |
# we add all line that start with '>>>' but not '>>> /' as info |
34 |
- if text_line.startswith(' * ') or (text_line.startswith('>>>') and not text_line.startswith('>>> /')): |
35 |
+ if text_line.startswith(' * ') or text_line.startswith('>>>'): |
36 |
if not tmp_index in summery_dict: |
37 |
summery_dict[tmp_index] = {} |
38 |
summery_dict[tmp_index]['text'] = text_line |
39 |
@@ -145,7 +145,6 @@ def search_buildlog(log_search_pattern_list, logfile_text_dict, tmp_index, max_t |
40 |
summery_dict[tmp_index]['status'] = 'info' |
41 |
summery_dict[tmp_index]['id'] = 0 |
42 |
summery_dict[tmp_index]['search_pattern'] = 'auto' |
43 |
- #FIXME: print json |
44 |
if summery_dict == {}: |
45 |
return None |
46 |
return summery_dict |
47 |
@@ -167,13 +166,13 @@ def runLogParser(args): |
48 |
# Is stored in a db instead of files. |
49 |
log_search_pattern_list = get_log_search_pattern(Session, args.uuid, config['default_uuid']) |
50 |
Session.close() |
51 |
+ #FIXME: UnicodeDecodeError: 'utf-8' codec can't decode byte ... in some logs |
52 |
with io.TextIOWrapper(io.BufferedReader(gzip.open(args.file, 'rb'))) as f: |
53 |
- #FIXME: add support for multiprocessing |
54 |
- for text_line in f: |
55 |
- logfile_text_dict[index] = text_line.strip('\n') |
56 |
- index = index + 1 |
57 |
- max_text_lines = index |
58 |
- f.close() |
59 |
+ for text_line in f: |
60 |
+ logfile_text_dict[index] = text_line.strip('\n') |
61 |
+ index = index + 1 |
62 |
+ max_text_lines = index |
63 |
+ f.close() |
64 |
# run the parse patten on the line |
65 |
for tmp_index, text in logfile_text_dict.items(): |
66 |
res = mp_pool.apply_async(search_buildlog, (log_search_pattern_list, logfile_text_dict, tmp_index, max_text_lines,)) |