From 667dd01ac786ea9d2913eaf9420b8c911fb13c9e Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Thu, 26 May 2022 09:29:59 -0700 Subject: [PATCH] fix process table detection --- jc/parsers/top.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/jc/parsers/top.py b/jc/parsers/top.py index 6d1e9cda..443a41cb 100644 --- a/jc/parsers/top.py +++ b/jc/parsers/top.py @@ -528,7 +528,7 @@ def parse( if jc.utils.has_data(data): - for line in filter(None, data.splitlines()): + for line in data.splitlines(): if line.startswith('top - '): if item_obj: if process_list: @@ -599,12 +599,11 @@ def parse( ) continue - if line.startswith(' PID '): + if not process_table and line == '': process_table = True - process_list.append(line) continue - if process_table: + if process_table and not line == '': process_list.append(line) continue