Skip to content

Commit 9e879d0

Browse files
committed
teuthology/scrape.py: Remove empty string and space in _get_service_types
Problem: the function grep returns a list contianing empty string which results in scrape.py throwing the warning "Misunderstood line: ". Solution: filter out empty strings, blank space and None before getting match with regex. Fixes: https://tracker.ceph.com/issues/62534 Signed-off-by: Kamoltat Sirivadhna <[email protected]>
1 parent 54e62bc commit 9e879d0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

teuthology/scrape.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,10 @@ def _get_service_types(self, job):
410410
result = defaultdict(list)
411411
# Lines like:
412412
# 2014-08-22T20:07:18.668 ERROR:tasks.ceph:saw valgrind issue <kind>Leak_DefinitelyLost</kind> in /var/log/ceph/valgrind/osd.3.log.gz
413-
for line in grep(os.path.join(job.path, "teuthology.log"), "</kind> in "):
413+
valgrind_err_line = grep(os.path.join(job.path, "teuthology.log"), "</kind> in ")
414+
# removes blank space, empty string and None
415+
valgrind_err_line = [line for line in valgrind_err_line if line and line.strip()]
416+
for line in valgrind_err_line:
414417
match = re.search("<kind>(.+)</kind> in .+/(.+)", line)
415418
if not match:
416419
log.warning("Misunderstood line: {0}".format(line))

0 commit comments

Comments
 (0)