More detail error messages when parsing the out of tree json file
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Obsolete LAVA Test |
Fix Released
|
High
|
Le Chi Thu |
Bug Description
When run " lava-test register url" and "lava-test list-tests", it the json file is corrupt or missing, the lava-test only reports "Warning: Failed to load test from..". No hits on what is the root problem.
Tested with the url. http://
From the chat :
<benjiG> zyga: same error "Warning: Failed to load test from 'http://
<zyga> let's see again then
<zyga> benjiG, in general you must be able to do this
<zyga> python
<zyga> import json
<zyga> json.load(
<zyga> if that crashes then you've got a syntax error
* ramana has quit (Ping timeout: 248 seconds)
* davepigott has quit (Ping timeout: 240 seconds)
* davepigott_ is now known as davepigott
<ChiThu> benjiG, testing..
<benjiG> zyga: got this error IOError: [Errno 2] No such file or directory: 'http://
<zyga> still syntax ierror
<zyga> simplejson.
<zyga> benjiG, it seems you must quote your \w sequence
<zyga> as \\w
<zyga> try that
<zyga> yup
<zyga> that applies to all uses of \
<zyga> after doing that the file works
<zyga> :-)
<ChiThu> zyga, lava-test should print out the error messages from json parser. any tips how to do it ?
<zyga> ChiThu, er? I don't know what the problem is
<zyga> ChiThu, just use the parser and catch JSONDecodeError
<zyga> ChiThu, it's a subclass of ValueError
<zyga> ChiThu, also use simplejson, not json
<ChiThu> zyga, instead of "Warning: Failed to load test from...."
<zyga> ChiThu, sure, just do it :)
<ChiThu> zyga, more details error message..
* davidgiluk (~<email address hidden>) has joined #linaro
* davidgiluk has quit (Changing host)
* davidgiluk (~dg@linaro/
<ChiThu> zyga, ok catching the JSONDecodeError will do. Thanks for the tip
<zyga> ChiThu, it has a few extra attributes you can use to get the details
Changed in lava-test: | |
milestone: | none → 2012.01 |
Changed in lava-test: | |
milestone: | 2012.01 → none |
Changed in lava-test: | |
milestone: | none → 2012.01 |
assignee: | nobody → Le Chi Thu (le-chi-thu) |
Changed in lava-test: | |
status: | Confirmed → Fix Committed |
Changed in lava-test: | |
status: | Fix Committed → Fix Released |
Please fix this one! :)