RestClient assumes too much about error bodies
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
tempest |
Fix Released
|
Medium
|
David Kranz |
Bug Description
While trying to remove the skips from the identity tests I discovered this general bug. The particular case I found was this code:
if resp.status == 400:
raise exceptions.
This assumes that the response body is nested json tagged by "badRequest" and then "message" which is what nova does. It seems that 400 errors from keystone give ["error"
Changed in tempest: | |
status: | Fix Committed → Fix Released |
Yeah, this is true. I fixed this up for the 500 error series (looking up various things like 'computeFault', 'cloudServersFa ult', and 'error' keys in the returned body).
You can go either route I suppose... or do something like check for 'badRequest in body, and if so, grab the message, if not just dump the body text/json to the exception raised.