Bug 1309692 - sadf -j does not output valid json
sadf -j does not output valid json
Product: Fedora
Classification: Fedora
Component: sysstat (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Peter Schiffer
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2016-02-18 08:54 EST by Bowe Strickland
Modified: 2016-03-09 02:58 EST (History)
2 users (show)

See Also:
Fixed In Version: sysstat-11.3.1-1.fc25
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-03-09 02:57:13 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Bowe Strickland 2016-02-18 08:54:53 EST
Description of problem:

sadf -j outputs invalid json

Version-Release number of selected component (if applicable):


How reproducible:

Steps to Reproduce:
1. sadf -j | python -c "import json, sys; print json.load(sys.stdin)"

Actual results:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib64/python2.7/json/__init__.py", line 290, in load
  File "/usr/lib64/python2.7/json/__init__.py", line 338, in loads
    return _default_decoder.decode(s)
  File "/usr/lib64/python2.7/json/decoder.py", line 366, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib64/python2.7/json/decoder.py", line 382, in raw_decode
    obj, end = self.scan_once(s, idx)
ValueError: Expecting , delimiter: line 17 column 12 (char 521)

Expected results:
loadable json

Additional info:

it looks like there's a comma missing before the 'fchosts' dict key?

[bowe@catbus ~]$ sadf -j | head -n 20 | tail -n 5
						{"cpu": "all", "user": 7.81, "nice": 0.09, "system": 1.77, "iowait": 0.11, "steal": 0.00, "idle": 90.22}
					]					"fchosts": [

Comment 1 Peter Schiffer 2016-03-01 06:16:55 EST
Thanks for the bug report.

The issue was fixed in upstream in:

And currently is also fixed in rawhide. Is that enough for you? Not sure when I will have time to back-port this patch.

Comment 2 Bowe Strickland 2016-03-08 16:40:17 EST
yep, just raising the flag... thanks! --b
Comment 3 Peter Schiffer 2016-03-09 02:57:13 EST
Thank you.
Comment 4 Peter Schiffer 2016-03-09 02:58:22 EST
fixed in:

Note You need to log in before you can comment on or make changes to this bug.