Skip to content

Commit

Permalink
Do not return identical error messages twice
Browse files Browse the repository at this point in the history
e.g.

 $> curl -d '{"passwordCredentials": ...}' -H "Content-type: application/json" http://localhost:5000/v2.0/tokens

should return:

 {"badRequest": {"message": "Expecting auth", "code": "400"}}

not:

 {"badRequest": {"message": "Expecting auth or Expecting auth", "code": "400"}}

Change-Id: I76a432cbb4c964f4050b8596c773e0a553120ca3
  • Loading branch information
markmc committed Sep 30, 2011
1 parent 8948d10 commit e7c4c4b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion keystone/controllers/auth.py
Expand Up @@ -24,7 +24,10 @@ def authenticate(self, req):
result = config.SERVICE.authenticate_with_unscoped_token(
unscoped)
except fault.BadRequestFault as e2:
raise fault.BadRequestFault(e1.msg + ' or ' + e2.msg)
if e1.msg == e2.msg:
raise e1
else:
raise fault.BadRequestFault(e1.msg + ' or ' + e2.msg)

return utils.send_result(200, req, result)

Expand Down

0 comments on commit e7c4c4b

Please sign in to comment.