If you specific the segment size to be X, files smaller than X should NOT be put into the _segment container and be created in the main container as manifest files. Currently the do due to the following :
if options.segment_size and \ getsize(path) < options.segment_size:
two problems to my eyes - the comparison is wrong (should be greater than) and we're comparing with a string. The fix would be:
if options.segment_size and \ getsize(path) > int(options.segment_size):
bin/swift in python-swiftclient.
If you specific the segment size to be X, files smaller than X should NOT be put into the _segment container and be created in the main container as manifest files. Currently the do due to the following :
if options. segment_ size and \
getsize( path) < options. segment_ size:
two problems to my eyes - the comparison is wrong (should be greater than) and we're comparing with a string. The fix would be:
if options. segment_ size and \
getsize( path) > int(options. segment_ size):
>>> bigfile = '/path/ to/file/ bigger/ than/1gig'
>>> smallfile = '/etc/hosts'
>>> segment_size = '1073741824' getsize( bigfile) < segment_size getsize( smallfile) < segment_size
>>> segment_size and os.path.
True
>>> segment_size and os.path.
True
>>> segment_size and os.path. getsize( bigfile) > segment_size getsize( smallfile) > segment_size
False
>>> segment_size and os.path.
False
>>> segment_size and os.path. getsize( smallfile) > int(segment_size) getsize( bigfile) > int(segment_size)
False
>>> segment_size and os.path.
True