1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-17 00:07:37 +02:00
This commit is contained in:
Kelly Brazil
2021-09-26 12:00:30 -07:00
parent 9904e0be61
commit ee075db598
4 changed files with 5 additions and 7 deletions

View File

@ -566,7 +566,7 @@ def main():
except FileNotFoundError: except FileNotFoundError:
if debug: if debug:
raise raise
jc.utils.error_message([f'"{run_command_str}" command could not be found. For details use the -d or -dd option.']) 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)) sys.exit(combined_exit_code(magic_exit_code, JC_ERROR_EXIT))

View File

@ -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) yield stream_success(output_line, ignore_exceptions) if raw else stream_success(_process(output_line), ignore_exceptions)
except Exception as e: except Exception as e:
yield stream_error(e, ignore_exceptions, line) yield stream_error(e, ignore_exceptions, line)

View File

@ -207,17 +207,16 @@ def parse(data, raw=False, quiet=False):
tstamp = '-timestamp-' in line tstamp = '-timestamp-' in line
continue continue
# skip header rows # skip header rows
if (procs or disk) and (line.startswith('procs') or line.startswith('disk')): if (procs or disk) and (line.startswith('procs') or line.startswith('disk')):
continue 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 buff_cache = True
tz = line.strip().split()[-1] if tstamp else None tz = line.strip().split()[-1] if tstamp else None
continue 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 buff_cache = False
tz = line.strip().split()[-1] if tstamp else None tz = line.strip().split()[-1] if tstamp else None
continue continue

View File

@ -167,11 +167,10 @@ def parse(data, raw=False, quiet=False, ignore_exceptions=False):
tstamp = '-timestamp-' in line tstamp = '-timestamp-' in line
continue continue
# skip header rows # skip header rows
if (procs or disk) and (line.startswith('procs') or line.startswith('disk')): if (procs or disk) and (line.startswith('procs') or line.startswith('disk')):
continue 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 buff_cache = True
tz = line.strip().split()[-1] if tstamp else None tz = line.strip().split()[-1] if tstamp else None