summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark McLoughlin <markmc@redhat.com>2011-09-30 12:06:24 +0100
committerMark McLoughlin <markmc@redhat.com>2011-09-30 15:59:51 +0100
commite7c4c4b028c2f8bdb371207eeb915065f10e7e30 (patch)
tree1d8dac1ea4d4c690b13cb429be738a6c8f4e2810
parent8948d10db417b13d6f3c07ad0d77b70c21a87498 (diff)
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
-rw-r--r--keystone/controllers/auth.py5
1 files changed, 4 insertions, 1 deletions
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)