-
Type: Bug
-
Resolution: Done
-
Priority: Minor - P4
-
Affects Version/s: 1.6.3
-
Component/s: None
-
None
-
ALL
While creating a collector for graphing in ZenOSS using the serverStatus?text url, it was found that the resulting output is merely JSON-like and not actually JSON.
{ "version" : "1.6.3",
"uptime" : 4712,
"uptimeEstimate" : 3844,
"localTime" : Date( "Wed Oct 13 20:52:15 2010" ),
...
Python's simplejson and json modules cannot load this due to the Date( "" ) which is not valid JSON. However, simplejson DOES support ISO datetimes, as per one of the answers found here: http://stackoverflow.com/questions/455580/json-datetime-between-python-and-javascript .
So, either the date needs to be returned as an ISO datetime string, or it needs to become an actual object like:
{"localTime":
{ "date" : "Wed Oct 13 20:52:15 2010" ) }}
Otherwise, to parse this in Python, one has to manually remove the Date( ) wrapper around the string, which I am doing for now, but would like to not do.