Merge "Remove unnecessary parameter in Zaqar"
This commit is contained in:
commit
b1cd63c41c
@ -63,7 +63,7 @@ class Resource(object):
|
|||||||
self._validate.queue_metadata_length(req.content_length)
|
self._validate.queue_metadata_length(req.content_length)
|
||||||
# Deserialize queue metadata
|
# Deserialize queue metadata
|
||||||
document = wsgi_utils.deserialize(req.stream, req.content_length)
|
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
|
# Restrict setting any reserved queue attributes
|
||||||
for key in metadata:
|
for key in metadata:
|
||||||
if key.startswith('_'):
|
if key.startswith('_'):
|
||||||
|
@ -66,7 +66,7 @@ class ItemResource(object):
|
|||||||
if req.content_length:
|
if req.content_length:
|
||||||
document = wsgi_utils.deserialize(req.stream,
|
document = wsgi_utils.deserialize(req.stream,
|
||||||
req.content_length)
|
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
|
# 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
|
# API v2. But we have to ensure the bad data will not come from
|
||||||
# older APIs, so we validate metadata here.
|
# older APIs, so we validate metadata here.
|
||||||
|
@ -81,7 +81,7 @@ class ItemResource(object):
|
|||||||
if req.content_length:
|
if req.content_length:
|
||||||
document = wsgi_utils.deserialize(req.stream,
|
document = wsgi_utils.deserialize(req.stream,
|
||||||
req.content_length)
|
req.content_length)
|
||||||
metadata = wsgi_utils.sanitize(document, spec=None)
|
metadata = wsgi_utils.sanitize(document)
|
||||||
self._validate.queue_metadata_putting(metadata)
|
self._validate.queue_metadata_putting(metadata)
|
||||||
except validation.ValidationFailed as ex:
|
except validation.ValidationFailed as ex:
|
||||||
LOG.debug(ex)
|
LOG.debug(ex)
|
||||||
@ -156,8 +156,7 @@ class ItemResource(object):
|
|||||||
if req.content_length:
|
if req.content_length:
|
||||||
try:
|
try:
|
||||||
changes = utils.read_json(req.stream, req.content_length)
|
changes = utils.read_json(req.stream, req.content_length)
|
||||||
changes = wsgi_utils.sanitize(changes,
|
changes = wsgi_utils.sanitize(changes, doctype=list)
|
||||||
spec=None, doctype=list)
|
|
||||||
except utils.MalformedJSON as ex:
|
except utils.MalformedJSON as ex:
|
||||||
LOG.debug(ex)
|
LOG.debug(ex)
|
||||||
description = _(u'Request body could not be parsed.')
|
description = _(u'Request body could not be parsed.')
|
||||||
|
Loading…
Reference in New Issue
Block a user