Merge "Remove unnecessary parameter in Zaqar"

This commit is contained in:
Jenkins 2017-06-26 05:42:29 +00:00 committed by Gerrit Code Review
commit b1cd63c41c
3 changed files with 4 additions and 5 deletions

View File

@ -63,7 +63,7 @@ class Resource(object):
self._validate.queue_metadata_length(req.content_length)
# Deserialize queue metadata
document = wsgi_utils.deserialize(req.stream, req.content_length)
metadata = wsgi_utils.sanitize(document, spec=None)
metadata = wsgi_utils.sanitize(document)
# Restrict setting any reserved queue attributes
for key in metadata:
if key.startswith('_'):

View File

@ -66,7 +66,7 @@ class ItemResource(object):
if req.content_length:
document = wsgi_utils.deserialize(req.stream,
req.content_length)
metadata = wsgi_utils.sanitize(document, spec=None)
metadata = wsgi_utils.sanitize(document)
# NOTE(Eva-i): reserved queue attributes is Zaqar's feature since
# API v2. But we have to ensure the bad data will not come from
# older APIs, so we validate metadata here.

View File

@ -81,7 +81,7 @@ class ItemResource(object):
if req.content_length:
document = wsgi_utils.deserialize(req.stream,
req.content_length)
metadata = wsgi_utils.sanitize(document, spec=None)
metadata = wsgi_utils.sanitize(document)
self._validate.queue_metadata_putting(metadata)
except validation.ValidationFailed as ex:
LOG.debug(ex)
@ -156,8 +156,7 @@ class ItemResource(object):
if req.content_length:
try:
changes = utils.read_json(req.stream, req.content_length)
changes = wsgi_utils.sanitize(changes,
spec=None, doctype=list)
changes = wsgi_utils.sanitize(changes, doctype=list)
except utils.MalformedJSON as ex:
LOG.debug(ex)
description = _(u'Request body could not be parsed.')