From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id B2724158091 for ; Sat, 11 Jun 2022 09:55:28 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id DB623E0824; Sat, 11 Jun 2022 09:55:27 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id BBBE0E0824 for ; Sat, 11 Jun 2022 09:55:27 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 9F7AB34148B for ; Sat, 11 Jun 2022 09:55:26 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 28AA444B for ; Sat, 11 Jun 2022 09:55:25 +0000 (UTC) From: "Magnus Granberg" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Magnus Granberg" Message-ID: <1654941313.1d74ddc1298a77bab0de91d0d8f91a15c9c4ea17.zorry@gentoo> Subject: [gentoo-commits] proj/tinderbox-cluster:master commit in: buildbot_gentoo_ci/logs/ X-VCS-Repository: proj/tinderbox-cluster X-VCS-Files: buildbot_gentoo_ci/logs/log_parser.py X-VCS-Directories: buildbot_gentoo_ci/logs/ X-VCS-Committer: zorry X-VCS-Committer-Name: Magnus Granberg X-VCS-Revision: 1d74ddc1298a77bab0de91d0d8f91a15c9c4ea17 X-VCS-Branch: master Date: Sat, 11 Jun 2022 09:55:25 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 1f7160c0-2173-49c3-ae9e-51520a30c91a X-Archives-Hash: b649f96fb6cf5a9f65d7759b28016a3b commit: 1d74ddc1298a77bab0de91d0d8f91a15c9c4ea17 Author: Magnus Granberg gentoo org> AuthorDate: Sat Jun 11 09:55:13 2022 +0000 Commit: Magnus Granberg gentoo org> CommitDate: Sat Jun 11 09:55:13 2022 +0000 URL: https://gitweb.gentoo.org/proj/tinderbox-cluster.git/commit/?id=1d74ddc1 Add ignore_line = False Signed-off-by: Magnus Granberg gentoo.org> buildbot_gentoo_ci/logs/log_parser.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/buildbot_gentoo_ci/logs/log_parser.py b/buildbot_gentoo_ci/logs/log_parser.py index 448192c..b890c12 100644 --- a/buildbot_gentoo_ci/logs/log_parser.py +++ b/buildbot_gentoo_ci/logs/log_parser.py @@ -71,10 +71,11 @@ def search_buildlog(log_search_pattern_list, logfile_text_dict, tmp_index, max_t # loop true the pattern list for match for search_pattern in log_search_pattern_list: search_hit = False + ignore_line = False # check if should ignore the line #FIXME take the ignore line pattern from db - if text_line.startswith('>>> /'): - pass + if re.search('^>>> /', text_line): + ignore_line = True #if else re.search('./\w+/'): # pass else: @@ -134,9 +135,9 @@ def search_buildlog(log_search_pattern_list, logfile_text_dict, tmp_index, max_t summery_dict[i]['status'] = 'info' summery_dict[i]['id'] = 0 summery_dict[i]['search_pattern'] = 'auto' - else: + if not ignore_line or not search_hit: # we add all line that start with ' * ' as info - # we add all line that start with '>>>' but not '>>> /' as info + # we add all line that start with '>>>' as info if text_line.startswith(' * ') or text_line.startswith('>>>'): if not tmp_index in summery_dict: summery_dict[tmp_index] = {} @@ -146,7 +147,7 @@ def search_buildlog(log_search_pattern_list, logfile_text_dict, tmp_index, max_t summery_dict[tmp_index]['id'] = 0 summery_dict[tmp_index]['search_pattern'] = 'auto' if summery_dict == {}: - return None + return False return summery_dict def getConfigSettings(): @@ -173,7 +174,7 @@ def runLogParser(args): # run the parse patten on the line for tmp_index, text in logfile_text_dict.items(): res = mp_pool.apply_async(search_buildlog, (log_search_pattern_list, logfile_text_dict, tmp_index, max_text_lines,)) - if res.get() is not None: + if res.get(): print(json.dumps(res.get())) mp_pool.close() mp_pool.join()