Merge "Fix default maximum value of max-parts for List Parts"

This commit is contained in:
Jenkins
2015-01-23 04:58:43 +00:00
committed by Gerrit Code Review
4 changed files with 10 additions and 7 deletions

View File

@@ -45,7 +45,10 @@ use = egg:swift3#swift3
# max_bucket_listing = 1000
#
# Set the maximum number of parts returned in the List Parts operation.
# max_parts = 10000
# (default: 1000)
# When setting it to be larger than 10000, set to be larger
# container_listing_limit in swift.conf.(specification of S3: 1000)
# max_parts_listing = 1000
#
# Set the maximum number of objects we can delete with the Multi-Object Delete
# operation.
@@ -81,7 +84,7 @@ use = egg:swift3#swift3
#
# Set the maximum number of parts for Upload Part operation.(default: 1000)
# When setting it to be larger than the default value in order to match the
# specification of S3, please set to be larger max_manifest_segments for slo
# specification of S3, set to be larger max_manifest_segments for slo
# middleware.(specification of S3: 10000)
# max_upload_part_num = 1000
#

View File

@@ -54,7 +54,7 @@ CONF = Config({
'allow_no_owner': False,
'location': 'US',
'max_bucket_listing': 1000,
'max_parts': 10000,
'max_parts_listing': 1000,
'max_multi_delete_objects': 1000,
's3_acl': False,
'storage_domain': '',

View File

@@ -58,7 +58,7 @@ from swift3.etree import Element, SubElement, fromstring, tostring, \
XMLSyntaxError, DocumentInvalid
from swift3.cfg import CONF
DEFAULT_MAX_PARTS = 1000
DEFAULT_MAX_PARTS_LISTING = 1000
DEFAULT_MAX_UPLOADS = 1000
MAX_COMPLETE_UPLOAD_BODY_SIZE = 2048 * 1024
@@ -289,9 +289,9 @@ class UploadController(Controller):
_check_upload_info(req, self.app, upload_id)
maxparts = req.get_validated_param(
'max-parts', DEFAULT_MAX_PARTS, CONF.max_parts)
'max-parts', DEFAULT_MAX_PARTS_LISTING, CONF.max_parts_listing)
part_num_marker = req.get_validated_param(
'part-number-marker', 0, CONF.max_parts)
'part-number-marker', 0, CONF.max_parts_listing)
query = {
'format': 'json',

View File

@@ -562,7 +562,7 @@ class TestSwift3MultiUpload(Swift3TestCase):
def test_object_list_parts_over_max_parts(self):
req = Request.blank('/bucket/object?uploadId=X&max-parts=%d' %
(CONF.max_parts + 1),
(CONF.max_parts_listing + 1),
environ={'REQUEST_METHOD': 'GET'},
headers={'Authorization': 'AWS test:tester:hmac'})
status, headers, body = self.call_swift3(req)