Whole file

kellyjonbrazil/jc

The author described this change as fix uptime for "user" instead of "users". It counts as a record because the check below fails on the code as it stood at 71af0c555 and passes on 40eb2b7ef, with nothing else changed between the two runs.

Fix saved2024-09-07
Sharing licenceMIT · LICENSE.md
Change size+2 2

What the code was meant to do, written into the code itself as a save note

fix uptime for "user" instead of "users"

The change

6565
6666 class info():
6767 """Provides parser metadata (version, author, etc.)"""
68- version = '1.9'
68+ version = '1.10'
6969 description = '`uptime` command parser'
7070 author = 'Kelly Brazil'
7171 author_email = 'kellyjonbrazil@gmail.com'
162162 raw_output = {}
163163
164164 if jc.utils.has_data(data):
165- if 'users' in data:
165+ if 'user' in data:
166166 # standard uptime output
167167 time, _, *uptime, users, _, _, _, load_1m, load_5m, load_15m = data.split()
168168

The check that tells the two apart

failpass·tests/test_uptime.py::MyTests::test_uptime_user

Check file tests/test_uptime.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.

Origin and history

The code before it71af0c55553e17c598c9f43b8271bfb069795af5
Broken version dated2024-09-06
Modulejc.parsers.uptime
Units changedinfo, parse
Fingerprintb7f55d49838d18c7
Checked2026-08-18 by goldset/0.1

Every field above is generated by our program. None of it is written by hand.

Other bugs found in kellyjonbrazil/jc