diff --git a/tempest/lib/common/rest_client.py b/tempest/lib/common/rest_client.py index b656b7a546..b360569dcc 100644 --- a/tempest/lib/common/rest_client.py +++ b/tempest/lib/common/rest_client.py @@ -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) diff --git a/tempest/lib/exceptions.py b/tempest/lib/exceptions.py index dd7885e014..0242de2e12 100644 --- a/tempest/lib/exceptions.py +++ b/tempest/lib/exceptions.py @@ -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"