Pad out the segment identifier for Swift segments and change test back to string comparison

Makes us follow the docs closer
This commit is contained in:
Joseph Schorr 2017-11-28 09:40:14 +02:00
parent 3bbcb93977
commit 6cd8140c34
2 changed files with 2 additions and 2 deletions

View file

@ -298,7 +298,7 @@ class SwiftStorage(BaseStorage):
def _stream_upload_segment(self, uuid, offset, length, in_fp, storage_metadata, content_type):
updated_metadata = copy.deepcopy(storage_metadata)
segment_count = len(updated_metadata[_SEGMENTS_KEY])
segment_path = '%s/%s/%s' % (_SEGMENT_DIRECTORY, uuid, segment_count)
segment_path = '%s/%s/%s' % (_SEGMENT_DIRECTORY, uuid, '%09d' % segment_count)
# Track the number of bytes read and if an explicit length is specified, limit the
# file stream to that length.