From e7c4c4b028c2f8bdb371207eeb915065f10e7e30 Mon Sep 17 00:00:00 2001 From: Mark McLoughlin Date: Fri, 30 Sep 2011 12:06:24 +0100 Subject: Do not return identical error messages twice 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 --- keystone/controllers/auth.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/keystone/controllers/auth.py b/keystone/controllers/auth.py index 9f34bc15..36f244f2 100644 --- a/keystone/controllers/auth.py +++ b/keystone/controllers/auth.py @@ -24,7 +24,10 @@ class AuthController(wsgi.Controller): 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) -- cgit