summaryrefslogtreecommitdiffstats
path: root/swift/1.4.8
diff options
context:
space:
mode:
authorPeter Portante <peter.portante@redhat.com>2012-10-05 16:41:48 -0400
committerAnand Avati <avati@redhat.com>2012-10-16 14:14:38 -0700
commit49a3d884c985cd2f0f8622844b1b9307294a1fcc (patch)
tree66226fbc4f600a1d4dfea12c57201cbde69d1642 /swift/1.4.8
parent3d10587d9d6400c9141b1f278bb5e2027fa784b8 (diff)
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 <peter.portante@redhat.com> Reviewed-on: http://review.gluster.org/4081 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'swift/1.4.8')
-rw-r--r--swift/1.4.8/plugins/constraints.py10
1 files changed, 6 insertions, 4 deletions
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')