summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryuan-zhou <yuan.zhou@intel.com>2012-11-26 15:20:39 +0800
committeryuan-zhou <yuan.zhou@intel.com>2012-12-04 10:27:13 +0800
commitd702d00ab439159e3f125cfa5e9fa94b048b3397 (patch)
tree41828080425a6f7b429581e5c5655d88c51c1888
parent4efe3bfa7e7fc1af4ab5d64c934076bf2fa4a80c (diff)
downloadpython-swiftclient-d702d00ab439159e3f125cfa5e9fa94b048b3397.tar.gz
Don't segment objects smaller than --segment-size
Fix bug 1075184 Change-Id: I369e742ca802744ac20e3575828cfa881018de6d
-rwxr-xr-xbin/swift3
1 files changed, 2 insertions, 1 deletions
diff --git a/bin/swift b/bin/swift
index 267744a..5760730 100755
--- a/bin/swift
+++ b/bin/swift
@@ -845,8 +845,9 @@ def st_upload(parser, args, print_queue, error_queue):
except ClientException, err:
if err.http_status != 404:
raise
+ # Don't do segment job if object is not big enough
if options.segment_size and \
- getsize(path) < options.segment_size:
+ getsize(path) > int(options.segment_size):
full_size = getsize(path)
segment_queue = Queue(10000)
segment_threads = [QueueFunctionThread(segment_queue,