From 49a3d884c985cd2f0f8622844b1b9307294a1fcc Mon Sep 17 00:00:00 2001 From: Peter Portante Date: Fri, 5 Oct 2012 16:41:48 -0400 Subject: Reduce the number of gratuitous differences in constraints. Ahead of further refactoring to make things a bit easier to review, we have restored some of the code formatting as it was in the original constraints.py file from which this file as copied. Change-Id: Icd0b42b4790bc076c54dcbf08a9745648769acfd BUG: 862052 Signed-off-by: Peter Portante Reviewed-on: http://review.gluster.org/4081 Tested-by: Gluster Build System Reviewed-by: Kaleb KEITHLEY Reviewed-by: Anand Avati --- swift/1.4.8/plugins/constraints.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'swift/1.4.8') diff --git a/swift/1.4.8/plugins/constraints.py b/swift/1.4.8/plugins/constraints.py index 6be853629fb..26640717684 100644 --- a/swift/1.4.8/plugins/constraints.py +++ b/swift/1.4.8/plugins/constraints.py @@ -64,7 +64,8 @@ def check_object_creation(req, object_name): """ if req.content_length and req.content_length > MAX_FILE_SIZE: return HTTPRequestEntityTooLarge(body='Your request is too large.', - request=req, content_type='text/plain') + request=req, + content_type='text/plain') if req.content_length is None and \ req.headers.get('transfer-encoding') != 'chunked': return HTTPLengthRequired(request=req) @@ -78,10 +79,10 @@ def check_object_creation(req, object_name): content_type='text/plain') if 'Content-Type' not in req.headers: return HTTPBadRequest(request=req, content_type='text/plain', - body='No content type') + body='No content type') if not check_utf8(req.headers['Content-Type']): return HTTPBadRequest(request=req, body='Invalid Content-Type', - content_type='text/plain') + content_type='text/plain') if 'x-object-manifest' in req.headers: value = req.headers['x-object-manifest'] container = prefix = None @@ -91,7 +92,8 @@ def check_object_creation(req, object_name): pass if not container or not prefix or '?' in value or '&' in value or \ prefix[0] == '/': - return HTTPBadRequest(request=req, + return HTTPBadRequest( + request=req, body='X-Object-Manifest must in the format container/prefix') return check_metadata(req, 'object') -- cgit