From 75fe1a4a1705c050478a532a576870471779162f Mon Sep 17 00:00:00 2001 From: wanghao Date: Mon, 26 Jun 2017 10:02:56 +0800 Subject: [PATCH] Remove unnecessary parameter in Zaqar There is spec=None by default in utils.sanitize, so no need to speicfy it as None again when calling it. Change-Id: I2774be16dbc8ee0747c31fe2f3946dca96357bf9 --- zaqar/transport/wsgi/v1_0/metadata.py | 2 +- zaqar/transport/wsgi/v1_1/queues.py | 2 +- zaqar/transport/wsgi/v2_0/queues.py | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/zaqar/transport/wsgi/v1_0/metadata.py b/zaqar/transport/wsgi/v1_0/metadata.py index 0fb7d1465..f044ad89a 100644 --- a/zaqar/transport/wsgi/v1_0/metadata.py +++ b/zaqar/transport/wsgi/v1_0/metadata.py @@ -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('_'): diff --git a/zaqar/transport/wsgi/v1_1/queues.py b/zaqar/transport/wsgi/v1_1/queues.py index b031ac79f..e61c48085 100644 --- a/zaqar/transport/wsgi/v1_1/queues.py +++ b/zaqar/transport/wsgi/v1_1/queues.py @@ -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. diff --git a/zaqar/transport/wsgi/v2_0/queues.py b/zaqar/transport/wsgi/v2_0/queues.py index 9d0b7d88d..b5db7d601 100644 --- a/zaqar/transport/wsgi/v2_0/queues.py +++ b/zaqar/transport/wsgi/v2_0/queues.py @@ -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.')