From 7f3c2f5fd4a58b7a19b143b54f1121d3a97e50c3 Mon Sep 17 00:00:00 2001 From: Yikun Jiang Date: Wed, 31 Jan 2018 10:09:12 +0800 Subject: [PATCH] Use util.validate_query_params in list_traits This patch try to use util.validate_query_params in list_traits. trivial fix Change-Id: Ifeaf610200fe9dd825612b89cbf526b218af93a1 --- nova/api/openstack/placement/handlers/trait.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/nova/api/openstack/placement/handlers/trait.py b/nova/api/openstack/placement/handlers/trait.py index 28e503df7..558020100 100644 --- a/nova/api/openstack/placement/handlers/trait.py +++ b/nova/api/openstack/placement/handlers/trait.py @@ -148,13 +148,7 @@ def list_traits(req): want_version = req.environ[microversion.MICROVERSION_ENVIRON] filters = {} - try: - jsonschema.validate(dict(req.GET), schema.LIST_TRAIT_SCHEMA, - format_checker=jsonschema.FormatChecker()) - except jsonschema.ValidationError as exc: - raise webob.exc.HTTPBadRequest( - _('Invalid query string parameters: %(exc)s') % - {'exc': exc}) + util.validate_query_params(req, schema.LIST_TRAIT_SCHEMA) if 'name' in req.GET: filters = _normalize_traits_qs_param(req.GET['name'])