From a4d45b653f794033978940da14910f5d607a8254 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Fri, 24 Sep 2021 08:49:37 -0700 Subject: [PATCH] linting --- jc/parsers/foo_s.py | 2 ++ jc/parsers/vmstat.py | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/jc/parsers/foo_s.py b/jc/parsers/foo_s.py index 669a9a69..6d58664d 100644 --- a/jc/parsers/foo_s.py +++ b/jc/parsers/foo_s.py @@ -99,6 +99,8 @@ def parse(data, raw=False, quiet=False, ignore_exceptions=False): for line in data: try: + output_line = {} + # # parse the input here # diff --git a/jc/parsers/vmstat.py b/jc/parsers/vmstat.py index 71c96404..f4f75815 100644 --- a/jc/parsers/vmstat.py +++ b/jc/parsers/vmstat.py @@ -159,7 +159,7 @@ def _process(proc_data): ts = jc.utils.timestamp(f'{entry["timestamp"]} {entry["timezone"]}') entry['epoch'] = ts.naive entry['epoch_utc'] = ts.utc - + return proc_data @@ -195,12 +195,12 @@ def parse(data, raw=False, quiet=False): # detect output type if not procs and not disk and line.startswith('procs'): procs = True - tstamp = True if '-timestamp-' in line else False + tstamp = '-timestamp-' in line continue if not procs and not disk and line.startswith('disk'): disk = True - tstamp = True if '-timestamp-' in line else False + tstamp = '-timestamp-' in line continue @@ -210,7 +210,7 @@ def parse(data, raw=False, quiet=False): tz = line.strip().split()[-1] if tstamp else None continue - elif 'swpd' in line and 'free' in line and 'inact' in line and 'active' in line: + if 'swpd' in line and 'free' in line and 'inact' in line and 'active' in line: buff_cache = False tz = line.strip().split()[-1] if tstamp else None continue