diff --git a/jc/cli.py b/jc/cli.py index 6a46007e..f9629b1f 100644 --- a/jc/cli.py +++ b/jc/cli.py @@ -566,7 +566,7 @@ def main(): except FileNotFoundError: if debug: raise - + jc.utils.error_message([f'"{run_command_str}" command could not be found. For details use the -d or -dd option.']) sys.exit(combined_exit_code(magic_exit_code, JC_ERROR_EXIT)) diff --git a/jc/parsers/foo_s.py b/jc/parsers/foo_s.py index ab5c88ae..121f3455 100644 --- a/jc/parsers/foo_s.py +++ b/jc/parsers/foo_s.py @@ -106,6 +106,6 @@ def parse(data, raw=False, quiet=False, ignore_exceptions=False): # yield stream_success(output_line, ignore_exceptions) if raw else stream_success(_process(output_line), ignore_exceptions) - + except Exception as e: yield stream_error(e, ignore_exceptions, line) diff --git a/jc/parsers/vmstat.py b/jc/parsers/vmstat.py index 1e7d52d6..7978d4ba 100644 --- a/jc/parsers/vmstat.py +++ b/jc/parsers/vmstat.py @@ -207,17 +207,16 @@ def parse(data, raw=False, quiet=False): tstamp = '-timestamp-' in line continue - # skip header rows if (procs or disk) and (line.startswith('procs') or line.startswith('disk')): continue - if 'swpd' in line and 'free' in line and 'buff' in line and 'cache' in line: + if 'swpd' in line and 'free' in line and 'buff' in line and 'cache' in line: buff_cache = True tz = line.strip().split()[-1] if tstamp else None continue - if '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 diff --git a/jc/parsers/vmstat_s.py b/jc/parsers/vmstat_s.py index 663c5316..e194ab42 100644 --- a/jc/parsers/vmstat_s.py +++ b/jc/parsers/vmstat_s.py @@ -167,11 +167,10 @@ def parse(data, raw=False, quiet=False, ignore_exceptions=False): tstamp = '-timestamp-' in line continue - # skip header rows if (procs or disk) and (line.startswith('procs') or line.startswith('disk')): continue - + if 'swpd' in line and 'free' in line and 'buff' in line and 'cache' in line: buff_cache = True tz = line.strip().split()[-1] if tstamp else None