From f312f1506d2d2fd4354b6adb90c8459882c776aa Mon Sep 17 00:00:00 2001 From: zhufl Date: Thu, 23 Nov 2017 16:51:37 +0800 Subject: [PATCH] Change Conflict's error message Conflict exception's error message is sometimes misleading, e.g., , An object with that identifier already exists Details: {u'message': u'Unable to complete operation on subnet 98575cac-0a2f-4214-8dea-50c62d31e736: One or more ports have an IP allocation from this subnet.', u'type': u'SubnetInUse', u'detail': u''} according to https://tools.ietf.org/html/rfc7231#section-6.5.8, "The 409 (Conflict) status code indicates that the request could not be completed due to a conflict with the current state of the target resource", so this is to change the error message to "Conflict with state of target resource". Change-Id: Icc118ec67f05cc7640e2b5f12162547ae5c3dae5 --- tempest/lib/exceptions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tempest/lib/exceptions.py b/tempest/lib/exceptions.py index 9b2e87e764..13af890510 100644 --- a/tempest/lib/exceptions.py +++ b/tempest/lib/exceptions.py @@ -96,7 +96,7 @@ class NotFound(ClientRestClientException): class Conflict(ClientRestClientException): status_code = 409 - message = "An object with that identifier already exists" + message = "Conflict with state of target resource" class Gone(ClientRestClientException):