1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-08-08 22:36:48 +02:00

process ps data

This commit is contained in:
Kelly Brazil
2019-11-07 15:24:03 -08:00
parent bcd28f06f8
commit 4802222ad5

View File

@ -67,6 +67,7 @@ $ ps -ef | jc --ps -p
"""
import jc.utils
def process(proc_data):
'''schema:
[
@ -82,6 +83,16 @@ def process(proc_data):
}
]
'''
for entry in proc_data:
int_list = ['pid', 'ppid', 'c']
for key in int_list:
if key in entry:
try:
key_int = int(entry[key])
entry[key] = key_int
except (ValueError):
entry[key] = None
return proc_data