Added statuscode 406 support
Added "NotAllowed" exception support. In general, 406 is returned when the requested microversion is not supported. https://specs.openstack.org/openstack/api-wg/guidelines/microversion_specification.html Change-Id: If5dda8254e8077070e77e8d56ecc6721222ef410
This commit is contained in:
parent
14588c55b3
commit
e60b317062
@ -881,6 +881,11 @@ class RestClient(object):
|
||||
resp_body = self._parse_resp(resp_body)
|
||||
raise exceptions.Gone(resp_body, resp=resp)
|
||||
|
||||
if resp.status == 406:
|
||||
if parse_resp:
|
||||
resp_body = self._parse_resp(resp_body)
|
||||
raise exceptions.NotAcceptable(resp_body, resp=resp)
|
||||
|
||||
if resp.status == 409:
|
||||
if parse_resp:
|
||||
resp_body = self._parse_resp(resp_body)
|
||||
|
@ -94,6 +94,11 @@ class NotFound(ClientRestClientException):
|
||||
message = "Object not found"
|
||||
|
||||
|
||||
class NotAcceptable(ClientRestClientException):
|
||||
status_code = 406
|
||||
message = "Not Acceptable"
|
||||
|
||||
|
||||
class Conflict(ClientRestClientException):
|
||||
status_code = 409
|
||||
message = "Conflict with state of target resource"
|
||||
|
Loading…
x
Reference in New Issue
Block a user