Bug 1309692 - sadf -j does not output valid json
Summary: sadf -j does not output valid json
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: sysstat
Version: 23
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Peter Schiffer
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-02-18 13:54 UTC by Bowe Strickland
Modified: 2016-03-09 07:58 UTC (History)
2 users (show)

Fixed In Version: sysstat-11.3.1-1.fc25
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-03-09 07:57:13 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Bowe Strickland 2016-02-18 13:54:53 UTC
Description of problem:

sadf -j outputs invalid json


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

sysstat-11.1.5-1.fc23.x86_64


How reproducible:
very

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

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
    **kw)
  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 11:16:55 UTC
Thanks for the bug report.

The issue was fixed in upstream in:
https://github.com/sysstat/sysstat/commit/54b03d154d46cbb94d2f29c2f85cafb69962660e

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

peter

Comment 2 Bowe Strickland 2016-03-08 21:40:17 UTC
yep, just raising the flag... thanks! --b

Comment 3 Peter Schiffer 2016-03-09 07:57:13 UTC
Thank you.

Comment 4 Peter Schiffer 2016-03-09 07:58:22 UTC
fixed in:
sysstat-11.3.1-1.fc25
http://koji.fedoraproject.org/koji/buildinfo?buildID=740001


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