1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-07-17 01:32:37 +02:00

fix uptime parsing for short uptimes

This commit is contained in:
Kelly Brazil
2019-10-25 15:52:53 -07:00
parent 27245590ce
commit 1acc4d6c29

View File

@ -25,6 +25,10 @@ def parse(data):
if cleandata:
parsed_line = cleandata[0].split()
# fix parsing if uptime is only a few minutes
if len(parsed_line) == 11:
parsed_line.insert(2, 'only')
output['time'] = parsed_line[0]
output['uptime'] = ' '.join(parsed_line[2:5]).rstrip(',')
output['users'] = parsed_line[5]