Change Conflict's error message

Conflict exception's error message is sometimes misleading,
e.g.,

<class 'tempest.lib.exceptions.Conflict'>,
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
This commit is contained in:
zhufl 2017-11-23 16:51:37 +08:00
parent 87adf8d84f
commit f312f1506d
1 changed files with 1 additions and 1 deletions

View File

@ -96,7 +96,7 @@ class NotFound(ClientRestClientException):
class Conflict(ClientRestClientException): class Conflict(ClientRestClientException):
status_code = 409 status_code = 409
message = "An object with that identifier already exists" message = "Conflict with state of target resource"
class Gone(ClientRestClientException): class Gone(ClientRestClientException):