Merge "Placement api: set custom json_error_formatter in root"

This commit is contained in:
Jenkins 2017-03-16 11:23:57 +00:00 committed by Gerrit Code Review
commit 285e4f1133
2 changed files with 8 additions and 2 deletions

View File

@ -13,13 +13,13 @@
from oslo_serialization import jsonutils
from oslo_utils import encodeutils
import webob
from nova.api.openstack.placement import microversion
from nova.api.openstack.placement import wsgi_wrapper
@webob.dec.wsgify
@wsgi_wrapper.PlacementWsgify
def home(req):
min_version = microversion.min_version_string()
max_version = microversion.max_version_string()

View File

@ -36,6 +36,8 @@ tests:
$.errors.[0].min_version: /^\d+\.\d+$/
response_strings:
- "Unacceptable version header: 0.5"
response_json_paths:
$.errors[0].title: Not Acceptable
- name: latest microversion is 1.4
GET: /
@ -63,6 +65,8 @@ tests:
status: 400
response_strings:
- "invalid version string: pony.horse"
response_json_paths:
$.errors[0].title: Bad Request
- name: bad format multidot raises 400
GET: /
@ -71,6 +75,8 @@ tests:
status: 400
response_strings:
- "invalid version string: 1.2.3"
response_json_paths:
$.errors[0].title: Bad Request
- name: error in application produces microversion headers
desc: we do not want xml